Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cpytoimpf

Status
Not open for further replies.

kckanda

Programmer
Mar 6, 2003
1
US
Hi i am trying to figure out how to use get rid of trailing blanks from outfile which is created by cpytoimpf.

any responses would be helpfull.


thanks in advance
kailash
 
What kind of output file? A AS/400 PF, or a IFS file?

RedMage1967
RPG IV Programmer
 
Unfortunately, CPYTOIMPF doesn't seem to allow trailing blanks to be trimmed. It's a pain when you try to copy something to a .csv file because Excel stores all of the blanks as well. The only way I've been able to get rid of them was to write specific code for each file I was transferring
Code:
C           Eval      FTPFLD = DQuote                +
C                              %TRIM(ITEMH1)         +
C                              Dquote + ' , '        +
C                              Dquote                +
C                              %TRIM(DESCH1)         +
C                              Dquote + ' , '        +
C                              %TRIM(DATES1) + ' , ' +
C                              %CHAR(REPLS1) + ' , ' +
C                              %CHAR(PLANS1) + ' , ' +
C                              %CHAR(ACTLS1)
The DQuote field puts quotes around the character fields, %TRIM removes the trailing blanks and %CHAR converts numeric to character. It's a pain because you need to write some RPG instead of just using a single CL command but I haven't found a way around it. If anyone has found a way of doing it I'd be Very happy if you could pass it on!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top