Using the Save (SAV) command

This information explains how to use the SAV command with the OBJ parameter.

The SAV command enables you to save the following data:

  • A specific object
  • A directory or subdirectory
  • An entire file system
  • Objects that meet search value

You can also save the items in this list by using the QsrSave API. For more information, refer to the API finder.

The Objects (OBJ) parameter on the SAV command supports the use of wildcard characters and the directory hierarchy. When you have a specific subset of similar objects within a directory subtree that you want to save, you can use the Name pattern (PATTERN) parameter to further define the objects that are identified in the (OBJ) parameter. For example, you could have a directory '/MyDir' that contains 100 subdirectories, Dir1 through Dir100, that each contain 100 .jpg files, Photo1.jpg through Photo100.jpg, with corresponding backup files, Photo1.bkp through Photo100.bkp. To save all of the .jpg files in '/MyDir', but omit the backup files, you could issue the following command:
SAV OBJ(('/MyDir')) PATTERN(('*.bkp' *OMIT)) 

When you use the SAV command to save the current directory SAV OBJ('*') and the current directory is empty (it has no files or subdirectories), the system does not save anything. The command does not save the one *DIR object that represents the current directory. However, when you explicitly specify the directory by name SAV OBJ('/mydir') you include the *DIR object in your save operation. The same applies to the home directory.

Another feature that the SAV command offers is the Scan objects (SCAN) parameter for purposes such as virus protection. If exit programs are registered with any of the integrated file system scan-related exit points, you can specify whether objects will be scanned while being saved. This parameter also enables you to indicate whether objects that previously failed a scan should be saved.

When you use the SAV command, you can specify OUTPUT(*PRINT) to receive a report of what the system saved. You can also direct the output to a stream file or to a user space. The SAV command does not provide the option to create an output file. The Interpreting output from save (SAV) and restore (RST) topic describes output file format information from the SAV and RST commands.