This technical note provides tips for transferring PC files to and from the AS/400 in the SAVE format.
What is the SAVE format?
IP Client defines a special file format for saving and restoring PC files on the AS/400 as physical data files. Using this format, it is possible to upload PC files to the AS/400, and then download them to the another PC without gaining extraneous data (to pad the file to a multiple of AS/400 record length), or losing characteristics of the PC file such as creation date or read-only status. In other words, the PC file uploaded and then downloaded in the SAVE format will exactly match the original PC file in every respect but the user-specified file name.
Creating an AS/400 Field Reference File
Before a PC file can be uploaded to a new AS/400 data file, a "field reference file" must first exist on the AS/400 to define the new file's record layout (the names, types and order of fields in the record). A field reference file is nothing more than an existing AS/400 file that has the same record layout as the new file you are trying to create.
A R SAVREC
A PCSAVF 2048A
Use the CRTPF command, referencing the DDS source member created above, to create a field reference file for use with subsequent uploads in the SAVE format.
Uploading files in the SAVE format
To upload a PC file in the SAVE format, enter "*SAVE" in the "PC File Description File name" edit box. If the transfer request will create a new data file on the AS/400, the aforementioned field reference file name must be entered in the "AS/400 field reference file" edit box.
Downloading files in the SAVE format
To download a file previously uploaded in the SAVE format, choose "SAVE" from the "PC file type" drop down list. Besides the PC and AS/400 file names, there is nothing else to enter. The file will be restored on the PC with its data, date and attributes intact.
An easy method for saving & restoring PC files
Instead of creating a field reference file to specify whenever uploading a new PC file to the AS/400, consider creating an AS/400 data file that is capable of containing multiple members. Each PC file uploaded to the AS/400 would then be uploaded as a member in this file rather than occupying a unique AS/400 data file.