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!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.