One Save File from More than One Library
March 26, 2008 Hey, Ted
I would like to place objects from several libraries in a save file. When I run a Save Library (SAVLIB) or Save Object (SAVOBJ) command that specifies more than one library, I receive message CPF3789: Only one library allowed with specified parameters. I really don’t want a bunch of save files. Is there another way?
A save file can contain other save files, so here’s a method you can try. To keep it simple, let’s say you want to save the contents of two libraries–MYLIB1 and MYLIB2–to one save file–SOMELIB/SOMESAVF.
1. Create a save file for each library.
CRTSAVF FILE(SOMELIB/MYLIB1) CRTSAVF FILE(SOMELIB/MYLIB2)
2. Use the appropriate SAVxxx command to load the save files.
SAVLIB LIB(MYLIB1) DEV(*SAVF) SAVF(SOMELIB/MYLIB1) SAVLIB LIB(MYLIB2) DEV(*SAVF) SAVF(SOMELIB/MYLIB2)
3. Save the save files to the single save file.
SAVOBJ OBJ(MYLIB*) LIB(SOMELIB) DEV(*SAVF) + SAVF(SOMELIB/SOMESAVF)
Let’s say you want to restore program object DOIT to some system. Here’s what you’d have to do.
1. Create the individual save file if necessary.
2. Restore the objects from the single save file to the individual save file.
RSTOBJ OBJ(*ALL) SAVLIB(SOMELIB) DEV(*SAVF) + SAVF(SOMELIB/SOMESAVF)
3. Use the appropriate restore command to restore objects from the individual save file.
RSTOBJ OBJ(DOITC) SAVLIB(MYLIB1) DEV(*SAVF) OBJTYPE(*PGM) SAVF(SOMELIB/MYLIB1) RSTLIB(QTEMP)