Using Save Files - IBM-ILE

A save file is a file allocated in auxiliary storage that can be used to store saved data on disk (without requiring diskettes or tapes), or to receive objects sent through the network. The object type is *FILE. The Backup and Recovery manual contains information on save files.

I/O Considerations for Save Files

An ILE C/C++ program can only process save files sequentially. All records that are read or are written must be 528 characters in length. Any records that are written to another save file cannot be changed by the ILE C/C++ program.

Opening Save Files as Binary Stream Files

To open an iSeries save file as a binary stream file for record-at-a-time processing, use the fopen() function with one of the following modes:

•rb •wb •rb

Note: The only way to create a save file is to use the CRTSAVF command. If you use the fopen() function with a mode of wb or ab and the save file does not exist, a physical database file is created.

The valid keyword parameters are:

•lrecl •type

I/O Considerations for Binary Stream Save Files

There are no special considerations for binary stream save files.

Binary Stream Functions for Save Files

Use the following binary stream functions to process save files:

  • fclose()
  • fopen()
  • fread()
  • freopen()
  • fwrite()

Opening Save Files as Record Files

To open an iSeries save file as a record file, use the _Ropen() function with one of the following modes:

•rr •wr •ar

The valid keyword parameters are:

•lrecl •riofb •secure

I/O Considerations for Record Save Files

If a save file is opened for input, the _Rfeod() function returns an end-of-file to your program. If a save file is opened for output, the _Rfeod() function ensures that any data that is written to the file is forced to auxiliary storage. If you want to continue reading from or writing to the save file after calling this function, you must close the file and open it again.

Record Functions for Save Files

The following record functions can be used to process save files:

Record Functions for Save Files


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM-ILE Topics