问题
I am trying to copy an IFS stream file to a AS400 data file, but with the default CCSID setting the data copied ended up as some strange characters. Using cat command under QSH can display the content of the stream file correctly so I suspect that this has something to do with the CCSID. My question is how to determine what is the correct CCSID to use in my case?
回答1:
Check the source and destination file CCSID's.
The -S
option to ls from qsh will identify the IFS file CCSID.
DSPFD
will display the library file attributes.
If you can cat
the file the issue is most likely the destination file CCSID. The most common library file CCSID is 37 for EBCDIC.
You can check the system default CCSID with DSPSYSVAL QCCSID
.
The CPYFRMIMPF
command will convert the character data based upon the IFS file CCSID and the library file CCSID. CRTPF
defaults to the job CCSID (inherited from the system CCSID).
来源:https://stackoverflow.com/questions/10982810/how-to-determine-the-ccsid-used-in-cpyfrmimpf-command