The data is not EBCDIC. If you view it as ASCII or UTF-8 instead of EBCDIC, you'd be able to see it. Alternately, if you need it in EBCDIC, you can translate it.
In my example, I created the file as CCSID 1208, which is the CCSID number for UTF-8. I don't know if that's what it should be -- but, it's certainly closer than the EBCDIC you seem to be using. Can you please find out what it's supposed to be? I've asked this a couple of times now.
Notice that when I created the IFS file, I specified O_CCSID and 1208 to specify that the file is 1208. However, I did NOT specify O_TEXTDATA or O_TEXT_CREAT, which means that the IFS APIs will not translate it from the program's EBCDIC to the file's UTF-8. I did it that way because the data is already in UTF-8, so translating would cause problems.
Depends on how your printer is set up, et al. One easy way to preserve the values would be to use a *USERASCII spooled file -- then you can just write the data to it without converting it to EBCDIC first. The disadvantage to this approach, however, is that you can't see the contents in the spool.sbehera wrote: ↑Tue Jan 25, 2022 8:55 pm I need to print this zpl data to spool file to send to printer. How to do that? Here what i am doing (after zpl data written to ifs) to achieve what i need:
- Created a physical file DMYPRTFL with as400 default CCSID 65535: CRTPF FILE(TEST1/DMYPRTFL) RCDLEN(132)
You are telling it to convert from the CCSID of the stream file (i.e. 1208, or UTF-8) to the job's CCSID. That means you are converting it to EBCDIC. If that's what you want, why not do it in the RPG program?
Are you on a recent release of RPG? (One where UTF-8 fields are allowed?) Or would you have to use APIs to translate it?