My guess is that you are putting quotes around your variable name. Here is an example CL program that may help.
PGM
DCL VAR(&FNM) TYPE(*CHAR) LEN(10) VALUE('MYFILE')
DCL VAR(&TOSTMF) TYPE(*CHAR) LEN(30)
CHGVAR VAR(&TOSTMF) VALUE('MYDIR' *TCAT &FNM)
CPYTOIMPF FROMFILE(&FNM) TOSTMF(&TOSTMF) +
STMFCODPAG(*PCASCII) RCDDLM(*CR)
ENDPGM ================================== MORE INFORMATION ON THIS TOPIC ==================================
The Best Web Links: Tips, tutorials and more.
Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.
Read this Search400.com Featured Topic: Managing your iSeries.
This was first published in October 2002