I have problem in CPYTOPCD command; I have on PF and one flat file, My RPG1 program dump data first in PF then RPG2 program dump data with (~) saprater In Flat file, Then my CL program dump data from flat file to QDLS folder in TXT format, when I open the TXT folder in last row I see some wild character CPYTOPCD FROMFILE (BIDETAIL) TOFLR(&FOLDER1) TODOC(&FILE2) REPLACE(*YES) How can I avoid this wild character?
Software/Hardware used:
CPYTOPCD
ASKED:
August 17, 2009 11:22 AM
UPDATED:
August 17, 2009 3:19 PM
I believe you are seeing the end of file characters (look at the help text for the command for “Format of PC data (TRNFMT)”). By default the command adds this to the document. I believe you would get what you want by using the CPYTOIMPF on the first file (assuming it has externally defined fields) and inserting the character you want for the field separator. This would eliminate the second program.
You might end up with something like this:
CPYTOIMPF FROMFILE(BIDETAIL) TOSTMF('/qdls/somefolder/textfile.txt') RCDDLM(*CRLF) STRDLM('"') FLDDLM('~')You could even put the file in some other directory. I prefer to avoid using the QDLS folder and create a directory in the IFS that I control authority to.