CPYTOPCD creates wild character

50 pts.
Tags:
CPYTOPCD
Crystal Reports
I have problem in CPYTOPCD command; I have one PF and one flat file.My RPG1 program dumps 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 26, 2013  4:27 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

I’m having a bit of difficulty understanding process and problem

1. Pgm RPG1 – creates PF
2. Pgm RPG2 – reads PF and writes flat file with ‘~’ seperators
3. CPYTOPCD copies flat file but last record has an unexpected value.

Questions
1. Are all other rows in the file exactly like the flat file?
2. Is there a row in the flat file that represents the last row of the output file or is the row of the output file extra?
3. Can you tell us or show us what the “wild” chararcter looks like?

Phil

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • hafwhit
    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.
    1,145 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following