Saving IFS Objects: How to Specify a Device or Save File

Steven McIver

Savings objects from the Integrated File System (IFS) is not quite as straightforward as saving them from the QSYS.LIB file system using commands such as SAVOBJ and SAVLIB. For example, a SAVLIB command has a parameter called DEV where you can simply specify the name of the device you want to use for the save. This could be a tape drive like TAP01 or a tape library like TAPMLB01. It could also be a save file, in which you would specify *SAVF and then the name of the save file on the SAVF parameter.

Examples of a SAVLIB command.

The SAV command is used to save IFS objects, as well as QSYS.LIB and DLO objects. In other words, it can be used to save any object on the system regardless of which file system it is in. The key to using it is being able to specify the correct device when saving to a device or a save file.

You first have to understand where your devices and your save files are located on the system. All devices on IBM i have a device description that is located in a library called QSYS. All other libraries on IBM i are nested inside of library QSYS. That’s as far as the nesting goes – you can only nest libraries in QSYS. With that said, here are some examples of devices and save files and their SAV command equivalents:

SAVOBJ Device SAV Device
Tape Drive – TAP01 /qsys.lib/tap01.devd
Tape Library – TAPMLB01 /qsys.lib/tapmlb01.devd
Save File – QGPL/MYSAVF /qsys.lib/qgpl.lib/mysavf.file


As you can see, the device names on the SAV command are a little more cumbersome to type. You see that we have to start by typing /qsys.lib, since that is the beginning of the file path for any object in the QSYS.LIB file system. All device descriptions are located in QSYS, so now we just need to type the name of the device and its .devd file extension. For tape drive TAP01, this would be tap01.devd.

Example of SAV command specifying a tape drive.

Specifying a save file only takes a little more work. So we start with /qsys.lib. Then, if the name of the library the save file is located in is QGPL, we would type /qgpl.lib. Lastly, if the name of the save file was MYSAVF, we would type mysavf.file. Save files have a .file file extension.

Example of SAV command specifying a save file.

Once you’ve got your device specified properly, you can then save any directory on the system using the SAV command. Also note that the device here is not case-sensitive. All directories on IBM i are also not case-sensitive, with the exception of the /QOpenSys directory which is case-sensitive. Keep that in mind when saving objects from that directory.

Tagged with: , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *