In iSeries(AS400) Save files are very handy in saving objects, complete libraries, IFS directories and files and then restoring them back on the same or different machine. You can even save a save file inside another save file.
Commands used to save Objects to save file
- SAVOBJ
Examples:
Saving a few objects from a library to a save file
SAVOBJ OBJ(OBJECT1 OBJTECT2 OBJECT3 ...) LIB(OBJECT_LIBARRY_NAME) DEV(*SAVF) SAVF(SAVE_FILE_LIBRARY/SAVE_FILE_NAME) TGTRLS(*PRV)
Saving the complete library to a save file
SAVOBJ OBJ(*ALL) LIB(OBJECT_LIBRARY_NAME) DEV(*SAVF) SAVF(SAVE_FILE_LIBRARY/SAVE_FILE_NAME) TGTRLS(*PRV)
- SAVLIB
Example:
SAVLIB LIB(LIBRARY_NAME) DEV(*SAVF) SAVF(SAVE_FILE_LIBRARY/SAVE_FILE_NAME)
- SAV
Examples:
Saving a few ifs objects to a save file
SAV DEV('/qsys.lib/') OBJ( ('/directory/file_name1.ext' *INCLUDE) ('/directory/file_name2.ext' *INCLUDE)) TGTRLS(*PRV)
Saving the complete directory to a save file
SAV DEV('/qsys.lib/save_file_library.lib/save_file_name.file') OBJ( ('/directory/*' *INCLUDE)) TGTRLS(*PRV)
Commands used to restore Objects from save file
- RSTOBJ
Examples:
Restoring a few objects from a save file to a library
RSTOBJ OBJ(OBJECT1 OBJTECT2 OBJECT3 ...) SAVLIB(LIBRARY_OF_SAVED_OBJECTS) DEV(*SAVF) SAVF(SAVE_FILE_LIBRARY/SAVE_FILE_NAME) RSTLIB(RESTORE_TO_LIBRARY)
Please note LIBRARY_OF_SAVED_OBJECTS and RESTORE_TO_LIBRARY can be same !
Restoring all objects from a save file to a library
RSTOBJ OBJ(*ALL) SAVLIB(LIBRARY_OF_SAVED_OBJECTS) DEV(*SAVF) SAVF(SAVE_FILE_LIBRARY/SAVE_FILE_NAME) RSTLIB(RESTORE_TO_LIBRARY)
- RSTLIB
Example:
RSTLIB LIB(LIBRARY_NAME) DEV(*SAVF) SAVF(SAVE_FILE_LIBRARY/SAVE_FILE_NAME)
- RST
Examples:
Restoring a few ifs objects from save file
RST DEV('/qsys.lib/save_file_library.lib/save_file_name.file') OBJ( ('/directory/file_name1.ext' *INCLUDE '/new_directory/file_name1.ext') ('/directory/file_name2.ext' *INCLUDE '/new_directory/file_name1.ext')) PATTERN((* *INCLUDE))
Restoring the complete directory from save file
RST DEV('/qsys.lib/save_file_library.lib/save_file_name.file') OBJ(('/directory/*' *INCLUDE '/new_directory/')) PATTERN((* *INCLUDE))
No comments:
Post a Comment
NO JUNK, Please try to keep this clean and related to the topic at hand.
Comments are for users to ask questions, collaborate or improve on existing.