1

I have a text file of source code that I have downloaded saved in the IFS. If anyone cares, it is Scott Klement's IFSIO_H file, a header file that contains RPG prototypes for using the Integrated File System. I would like to store this code in the library file system with my other source code, so I can use it as a /copy member from my RPG programs.

I expected to perform this copy with the CPYFRMSTMF command:

CPYFRMSTMF FROMSTMF('/QOpenSys/xxxxxxxx/ifsio_h.rpgle.txt') TOMBR('/QSYS.LIB/QGPL.LIB/QRPGLESRC.FILE/IFSIO_H.MBR')

This fails with the messages 'Database file CCSID is 65535.' and 'Stream file not copied.'. It is true that the destination file uses the default CCSID, as all my source code files do, but nothing I try to put in for conversion information in other parameters makes any difference.

Optional parameters for CPYFRMSTMF

Message Information

Is there a way to perform the copy that I want using this command? Is there a different command I should be using instead?

Based on the error message, one might expect that any copying to a file with a CCSID of 65535 is not allowed, but I know that not to be true. I often upload printer file overlays using this command like:

CPYFRMSTMF FROMSTMF('/QOpenSys/xxxxxxxx/xxxxxx.plt')
TOMBR('/QSYS.LIB/QGPL.LIB/AFPIMAGES.FILE/xxxxxx.MBR')
MBROPT(*REPLACE) CVTDTA(*NONE) ENDLINFMT(*FIXED) TABEXPN(*NO)

This successfully copies an overlay plot file that I make in AutoCAD using a AFP print driver to the QGPL/AFPIMAGES file, after which I can run the CRTOVL command to create a printer overlay. I just checked and QGPL/AFPIMAGES is at the default 65535 CCSID same as the QGPL/QRPGLESRC file. This means that this command can write to a file member some of the time, but I either have my parameters wrong, or there is something else about the QRPGLESRC source code file causing this problem.

Mike
  • 1,274
  • 10
  • 24

3 Answers3

3

Honestly, your source files (and DB tables and system value QCCSID) should be something besides CCSID 65535.

65535 means binary data, don't translate.

I believe Printer Overlays actually are binary data, and you're using CVTDTA(*NONE) there so that's why it works.

I don't think CVTDTA(*NONE) will help here, since the IFS text is likely ASCII.

What you'd need to do to use CVTDTA(*NONE) for source would be to create the IFS file with CCSID 37 (assuming english) then FTP the source into it.

delete the IFS file, and use EDTF '/QOpenSys/xxxxxxxx/ifsio_h.rpgle.txt' to create the file. Check the CCSID with DSPLNK, if neccessary, use the 13-Change Attributes to change the CCSID to 37. Now when you FTP the source in, the system will translate it there and you can use CVTDTA(*NONE) on the CPYFRMSTMF.

Much easier just to have the correct CCSID in the first place ;)

Way back when, in the Setting up your new AS/400 docs, one of the first steps was to set the QCCSID system value from it's shipped default of 65535. Too many people never bothered. IBM now ships new system with an appropriate QCCSID for the installed language.

Charles
  • 21,637
  • 1
  • 20
  • 44
2

Just to let you know that you could just /copy the IFS file directly.

Barbara Morris
  • 3,195
  • 8
  • 10
0

Assuming your IFS file is actually the same CCSID of your source file, try CPYFRMSTFM CVTDTA(*NONE).

jtaylor___
  • 609
  • 1
  • 6
  • 14