I am trying to create a file on the IFS and then ftp this
to our client. He requires a line feed between certain fields and Cr/LF (x'25') at the end of the record. I do not have a problem with the end of record requirement. I am using codepage 437 on the as400 and tried x'15' to get only a line feed but get gibberish.
Please help!
Software/Hardware used:
ASKED:
July 26, 2005 7:19 AM
UPDATED:
October 31, 2009 4:33 AM
If there are difficulties with figuring out ASCII v. EBCDIC character codes, just ignore them. Have the system do it for you.
First thing that should always be done is setting the QCCSID system value to a correct CCSID. Do not let it sit at 65535. Use CCSID 37 for normal U.S. English systems for example. The most likely CCSID to choose is the one that is shown as ‘Default coded character set identifier’ for most interactive jobs on the system when you run the DSPJOB OPTION(*DFNA) command.
Assuming CCSID 37 –
Create the streamfile as CCSID 37. Give it an extension that you’ll recognize, e.g., [myfile.ebcdic]. Hard to misunderstand that one. Write your text data, adding normal EBCDIC carriage-return and line-feed characters. Do everything as normal. Pay no attention to thoughts of ANSI/ASCII.
When the file is finished:
CPY OBJ( '/home/MyHomeDir/myfile.ebcdic' ) TOOBJ( myfile.txt ) TOCCSID( *PCASCII ) DTAFMT( *TEXT )You can then delete myfile.ebcdic if you wish. The new myfile.txt has been created in the current directory as CCSID 1252, all prepared for Windows or almost anything else. Characters including end-of-line are nice and neatly converted.
Simple basic system configuration allows you to issue commands such as CPY and control the result through its parms.
Tell the system what to do with commands. Have the system do your work for you. That’s what programmers do, isn’t it?
Tom