SAV (Save)

 

+
Search Tips   |   Advanced Search

 

SAV Command syntax diagram

 

Purpose

The Save (SAV) command saves a copy of one or more objects that can be used in the integrated file system.

 

Restrictions:

  1. Specifying USEOPTBLK(*YES) may result in a tape that can be duplicated only to a device that supports the same block size.
  2. You can use SAV to save objects in libraries or to save document library objects.

 

Required Parameter

DEV
Specifies the path name of the device to which the objects are saved.
'save-file-path-name' Path name of the save file used to save the objects.
'diskette-device-path-name' Path name of the diskette device used to save the objects.
'optical-device-path-name' Path name of the optical device used to save the objects.
'tape-media-library-device-path-name' Path name of the tape media library device used to save the objects.
'tape-device-path-name' Path name of the tape device used to save the objects. A maximum of four tape devices can be specified.

 

Optional Parameters

OBJ
Specifies the path name of the object to save. You can specify a pattern for this path name. A maximum of 300 path names can be specified.

Additional information about name patterns is in the Integrated file system topic in the File systems and management category of the Information Center.

Element 1: Object Name

'*': The objects in the current directory are saved.

'object-path-name' Specify an object path name or a pattern that can match many names.

Element 2: Include or Omit

The second element specifies whether names that match the pattern should be included or omitted from the operation. Note that in determining whether a name matches a pattern, relative name patterns are always treated as relative to the current working directory.

The SUBTREE parameter specifies whether the subtrees are included or omitted.

*INCLUDE: The objects that match the object name pattern are saved, unless overridden by an *OMIT specification.

*OMIT: The objects that match the object name pattern are not saved. This overrides an *INCLUDE specification and is intended to be used to omit a subset of a previously selected pattern.

SUBTREE
Specifies whether the directory subtrees are included in the save operation.

*ALL: The entire subtree of each directory that matches the object name pattern is included. The subtree includes all subdirectories and the objects within those subdirectories.

*DIR: The objects in the first level of each directory that matches the object name pattern are included. The subdirectories of each matching directory are included, but the objects in the subdirectories are not included.

*NONE: No subtrees are included in the save operation. If a directory matches the object name pattern specified, the objects in the directory are included. If the directory has subdirectories, neither the subdirectories nor the objects in the subdirectories are included.

*OBJ: Only the objects that exactly match the object name pattern are included. If the object name pattern specifies a directory, objects in the directory are not included.

*STG: The objects that match the object name pattern are processed along with the storage for related objects. Objects that are saved using this value can only be restored using SUBTREE(*STG). >

SYSTEM
Specifies whether to process objects that exist on the local system or remote systems.

*LCL: Only local objects are processed.

*RMT: Only remote objects are processed.

*ALL: Both local and remote objects are processed.

CHGPERIOD
Specifies a date and time range. Objects that changed within this range are saved.

Element 1: Starting Date

*ALL: No starting date is specified. All objects changed prior to the ending date are saved.

*LASTSAVE: The objects that have changed since the last time they were saved with UPDHST(*YES) specified are saved.

 

Notes:

  1. If this value is specified, the value *ALL must be specified on all other elements of this parameter.
  2. For local file systems, the iSeries 400 archive flag is used. For remote file systems, the PC archive flag is used.

start-date Date after which objects that have changed are saved. The date must be specified in the job date format.

Element 2: Starting Time

*ALL: All times of day are included in the range.

start-time Time on the start date after which objects that have changed are saved. The time is specified in 24-hour format with or without a time separator as follows:

  • With a time separator, specify a string of 5 or 8 digits, where the time separator for the job separates the hours, minutes, and seconds. If you issue this command from the command line, the string must be enclosed in apostrophes. If a time separator other than the separator specified for your job is used, this command fails.
  • Without a time separator, specify a string of 4 or 6 digits (hhmm or hhmmss) where hh = hours, mm = minutes, and ss = seconds. Valid values for hh range from 00 through 23. Valid values for mm and ss range from 00 through 59.

>Specifying an explicit time is valid only if the starting date is an explicit date.

Element 3: Ending Date

*ALL: No ending date is specified. All objects changed since the starting date are saved.

end-date Date before which objects that have changed are saved. The date must be specified in the job date format.

Element 4: Ending Time

*ALL: All times of day are included in the range.

end-time Specify a time on the end date before which objects that have changed are saved. The time is specified in 24-hour format with or without a time separator as follows:

  • With a time separator, specify a string of 5 or 8 digits, where the time separator for the job separates the hours, minutes, and seconds. If you issue this command from the command line, the string must be enclosed in apostrophes. If a time separator other than the separator specified for your job is used, this command fails.
  • Without a time separator, specify a string of 4 or 6 digits (hhmm or hhmmss) where hh = hours, mm = minutes, and ss = seconds. Valid values for hh range from 00 through 23. Valid values for mm and ss range from 00 through 59.

Specifying an explicit time is valid only if the ending date is an explicit date.

TGTRLS
Specifies the release level of the operating system on which you intend to use the object being saved.

When specifying the target-release value, the format VxRxMx is used to specify the release, where Vx is the version, Rx is the release, and Mx is the modification level.

Valid values depend on the current version, release, and modification level, and they change with each new release. See the Valid Values for TGTRLS Parameter table in the Backup and recovery topic for a complete list of valid values.

*CURRENT: The object is to be restored to, and used on, the release of the operating system currently running on your system. The object can also be restored to a system with any subsequent release of the operating system installed.

*PRV: The object is to be restored to the previous release with modification level 0 of the operating system. The object can also be restored to a system with any subsequent release of the operating system installed.

target-release Release in the format VxRxMx. The object can be restored to a system with the specified release or with any subsequent release of the operating system installed.
PRECHK
Specifies whether the save operation ends if any of the selected objects cannot be saved.

*NO: The save operation does not end. Objects that can be saved are saved.

*YES: The save operation ends. Nothing is saved unless all of the selected objects can be saved.

UPDHST
Specifies whether to update the save history on the objects saved with this save operation. The save history is used when CHGPERIOD(*LASTSAVE) is specified on a later save operation.

*NO: The save history is not updated.

*YES: The save history is updated. For local file systems, the system save history is updated. For remote file systems, the PC save history is updated.

*SYS: The system save history is updated.

*PC: The PC save history is updated.

VOL
Specifies the volume identifiers of the volumes, or the cartridge identifier of a tape in a tape media library device, on which the data is saved. The volumes must be placed in the device in the order specified on this parameter. More information on this parameter is in commonly used parameters.

A maximum of 75 volume identifiers can be specified. After all specified volumes are filled, the save operation continues on whatever volumes are mounted on the device.

*MOUNTED: The volume currently placed in the device is used. For a media library device, the volume to be used is the next cartridge in the category mounted by the Set Tape Category (SETTAPCGY) command.

This value cannot be specified when using an optical media library device.

volume-identifier Identifiers of one or more volumes to be used.
LABEL
Specifies the file identifier of the media to be used for the save operation.

*GEN: The system generates the label name.

  • For objects in libraries, this is the equivalent of LABEL(*LIB) on the Save Object (SAVOBJ) and the Save Library (SAVLIB) commands.
  • For document library objects, this is the equivalent of LABEL(*GEN) on the Save Document Library Object (SAVDLO) command.
  • For objects in other file systems, the label is SAVyyyymmdd for a tape and SAVyyyymmdd.Qnnn for a diskette.

diskette-file-identifier Specify a maximum of 17 characters as the identifier of the diskette file used for the save operation.
tape-file-identifier Specify a maximum of 17 characters as the identifier of the tape file used for the save operation.
SEQNBR
Specifies the tape file sequence number to be used.

*END: The system saves the object starting after the last sequence number on the first tape. If the first tape is full, an error message is issued and the operation ends.

sequence-number Sequence number of the file. Valid values range from 1 through 16777215. Any existing files on the tape at or beyond this sequence number are overwritten.
EXPDATE
Specifies the expiration date. The files cannot be overwritten until the expiration date. The expiration date must be later than or equal to the current date.

*PERM: The file is protected permanently.

expiration-date Date when protection for the file ends.
ENDOPT
Specifies the operation that is automatically performed on the tape or optical volume after the save operation ends. If more than one volume is used, this parameter applies only to the last volume used; all other volumes are unloaded when the end of the volume is reached.

This parameter is valid only if a tape or optical device name is specified on the DEV parameter. For optical devices, *UNLOAD is the only special value supported, *REWIND and *LEAVE will be ignored.

*REWIND: The tape is automatically rewound, but not unloaded, after the operation has ended.

*LEAVE: The tape does not rewind or unload after the operation ends. It remains at the current position on the tape drive.

*UNLOAD: The tape is automatically rewound and unloaded after the operation ends. Some optical devices will eject the volume after the operation ends.

CLEAR
Specifies whether active data on the media is automatically cleared or replaced. Active data is any file on the media that has not expired. Clearing active data removes all files from the volume, starting at the specified sequence number for tape. Replacing active data on optical media replaces only the optical files created by this operation.

Notes:

  1. Clearing a tape does not initialize it. You should initialize tapes to a standard label format before the save command is issued by using the Initialize Tape (INZTAP) command and specifying a value on the NEWVOL parameter.
  2. Clearing an optical volume does initialize it.
  3. Clearing a diskette does not initialize it. You should initialize diskettes to a save and restore format before the save command is issued by using the Initialize Diskette (INZDKT) command and specifying FMT(*SAVRST).
  4. If a volume that is not initialized is encountered during the save operation, an inquiry message is sent and an operator can initialize the volume.

*NONE: None of the media is automatically cleared. If the save operation encounters active data on a tape, diskette, or save file, an inquiry message is sent, allowing the operator to either end the save operation or clear the media. If the save operation encounters the specified optical file, an inquiry message is sent, allowing the operator to either end the save operation or replace the file.

*ALL: All of the media is automatically cleared.

If tapes are used and a sequence number is specified on the SEQNBR parameter, the first tape is cleared beginning at that sequence number. All tapes following that first tape are completely cleared. To clear the entire first tape, SEQNBR(1) must be specified.

*AFTER: All media after the first volume is automatically cleared. If the save operation encounters active data on the first tape or diskette, an inquiry message is sent, allowing the operator to either end the save operation or clear the media. If the save operation encounters the specified optical file on the first volume, an inquiry message is sent, allowing the operator to either end the save operation or replace the file.

The *AFTER value is not valid for save files.

*REPLACE: Active data on the media is automatically replaced. Optical volumes are not initialized. Tapes, diskettes, and save files are automatically cleared in the same way as the *ALL value.

DTACPR
Specifies whether data compression is performed.

*DEV: If the tape device has the hardware compression feature installed, processing proceeds as if DTACPR(*YES) is specified. If the compression feature is not installed or if save data is written to a diskette or save file, processing proceeds as if DTACPR(*NO) is specified.

If *DEV is specified on both the DTACPR parameter and the COMPACT parameter, only device data compaction is performed if compaction is supported on the device. Otherwise, data compression is performed if supported on the device.

If *YES is specified on the DTACPR parameter and *DEV is specified on the COMPACT parameter, both device data compaction and device data compression are performed if supported on the device.

*NO: No data compression is performed.

*YES: If the save operation is to tape and the target device has the hardware compression feature, hardware compression is done. If the feature is not present, or if the save data is written to optical, diskette, or save file, software data compression is done. If the save operation is being done while other jobs on the system are active and software data compression is used, the overall system performance may be affected.

COMPACT
Specifies whether device data compaction is performed.

*DEV: Device data compaction is performed if the data is saved to tape and all tape devices specified on the DEV parameter support the compaction feature.

If *DEV is specified on both the DTACPR parameter and the COMPACT parameter, only device data compaction is performed if compaction is supported on the device. Otherwise, data compression is performed if supported on the device.

If *YES is specified on the DTACPR parameter and *DEV is specified on the COMPACT parameter, both device data compaction and device data compression are performed if supported on the device.

*NO: Device data compaction is not performed.

OPTFILE
Specifies the path name of the optical file that is used for the save operation, beginning with the root directory of the volume. For more information on specifying path names, refer to path names.

'*': The system generates an optical file name in the root directory of the optical volume.

'optical-directory-path-name/*' The system generates an optical file name in the specified directory of the optical volume.
'optical-file-path-name' Path name of the optical file.
SAVACT
Specifies whether an object can be updated while it is being saved.

If your system is in a restricted state, this parameter is ignored and the save operation is performed as if SAVACT(*NO) was specified.

*NO: The objects that are in use are not saved. Objects cannot be updated while they are being saved.

*YES: Objects can be saved and used at the same time. The object checkpoints can occur at different times.

*SYNC: Objects can be saved and used at the same time. All of the object checkpoints occur at the same time.

SAVACTOPT
Specifies options to be used with the save while active parameter.

*NONE: No special save while active options will be used.

*ALWCKPWRT: When *YES or *SYNC is specified for the SAVACT parameter, objects with the QP0L_ATTR_ALWCKPWRT system attribute set will be locked with O_SHRRDWR by the save and can be updated before the save while active checkpoint is reached.

If this option is not specified, normal save while active processing will take place. Objects with the QP0L_ATTR_ALWCKPWRT system attribute set will be locked with O_SHRRD and cannot be updated before the save while active checkpoint is reached.

Note: When *NONE is specified for the SAVACT parameter, *ALWCKPWRT will be ignored.

SAVACTMSGQ
Specifies the path name of the message queue that the save operation uses to notify the user that the checkpoint processing is complete.

*NONE: No notification message is sent.

*WRKSTN: The notification message is sent to the work station message queue.

'message-queue-path-name' Path name of the message queue.
OUTPUT
Specifies whether a list of information about the saved objects is created. The information can be directed to a spooled file, a stream file, or a user space.

A stream file or user space is specified as a path name. path names.

*NONE: No output is created.

*PRINT: The output is printed with the job's spooled output.

'stream-file-path-name' Path name of the existing stream file to which the output of the command is directed.
'user-space-path-name' Path name of the existing user space to which the output of the command is directed.
INFTYPE
Specifies the type of information that is directed to the spooled file, stream file, or user space.

*ALL: The file contains information about the command, an entry for each directory, an entry for each object that was successfully saved, and an entry for each object that was not successfully saved.

*ERR: The file contains information about the command, an entry for each directory, and an entry for each object that was not successfully saved.

*SUMMARY: The file contains information about the command, and an entry for each directory.

USEOPTBLK
Specifies whether or not the optimum block size is used for the save operation.

*YES: The optimum block size supported by the device is used for Save commands. If the block size that is used is larger than a block size that is supported by all device types then:

  • Performance may improve.
  • The tape file that is created is only compatible with a device that supports the block size used. Commands such as Duplicate Tape (DUPTAP) do not duplicate files unless the files are being duplicated to a device which supports the same block size that was used.
  • The value for the DTACPR parameter is ignored.

If the target release value that is specified is earlier than V3R7M0 then the block size supported by all device types is used.

*NO: The optimum block size supported by the device is not used. Save commands use the default block size supported by all device types. The tape volume can be duplicated to any media format using the Duplicate Tape (DUPTAP) command.

ASPDEV
Specifies the name of the auxiliary storage pool (ASP) device to be included in the save operation.

*DFT: The operation uses the ASPDEV value appropriate for the file system from which objects are being saved. For Integrated File System objects, *ALLAVL is used. For objects from the QSYS file system, the corresponding save command ASPDEV default is used.

*ALLAVL: The operation includes the system ASP (ASP number 1), all basic user ASPs (ASP numbers 2-32), and all available independent ASPs.

*: The operation includes the system ASP, all basic user ASPs, and, if the current thread has an ASP group, all independent ASPs in the ASP group.

*SYSBAS: The system ASP and all basic user ASPs are included in the save operation.

*CURASPGRP: If the current thread has an ASP group, all independent ASPs in the ASP group are included in the save operation.

auxiliary-storage-pool-device-name Name of the independent ASP device to be included in the save operation. End of change


 

Examples for SAV

 

Example 1: Saving All Data Not in Libraries and Not Document Library Objects

SAV   DEV('/QSYS.LIB/TAP01.DEVD')
  OBJ(('/*') ('/QSYS.LIB' *OMIT) ('/QDLS' *OMIT))

This command saves all objects that are not in libraries and are not document library objects.

 

Example 2: Saving Changes Since the Last Time the Objects Were Saved

SAV   DEV('/QSYS.LIB/TAP01.DEVD')
  OBJ(('/*') ('/QSYS.LIB' *OMIT) ('/QDLS' *OMIT))
  CHGPERIOD(*LASTSAVE)

This command saves all objects that are not in libraries, that are not document library objects, and that have changed since the last time they were saved with UPDHST(*YES) specified.

 

Example 3: Saving Data That Has Not Changed Since 1990

SAV   DEV('/QSYS.LIB/TAP01.DEVD')
  OBJ(('/*') ('/QSYS.LIB' *OMIT) ('/QDLS' *OMIT))
  CHGPERIOD((*ALL *ALL '12/31/90'))

This command saves all objects that are not in libraries, that are not document library objects, and that have not changed since December 31, 1990.

 

Example 4: Saving the Home Directory and Everything Underneath

SAV   DEV('/QSYS.LIB/TAP01.DEVD')  OBJ('~')

This command saves the user's home directory and everything underneath the home directory to a tape device named TAP01.

 

Example 5: Saving All Objects in the Current Directory

SAV   DEV('/QSYS.LIB/TAP01.DEVD')

This command uses the default value '*' on the OBJ parameter to save all objects in the current directory and its subdirectories. This example is not valid if the current directory is the root directory or if the current directory is in the QDLS file system.

SAV   DEV('/QSYS.LIB/TAP01.DEVD')  OBJ('*')
  SUBTREE(*NONE)

This command saves all objects in the current directory but not in the subdirectories.

 

Example 6: Omitting Objects During a Save Operation

SAV   DEV('/QSYS.LIB/TAP01.DEVD')
  OBJ(('*') ('**.BACKUP' *OMIT) ('**.TEMP' *OMIT))

This command saves all objects in the current directory except those with extensions of .BACKUP and .TEMP (the entire subtrees of directories with these extensions are omitted).

SAV   DEV('/QSYS.LIB/TAP01.DEVD')  OBJ(('/A')
  ('/A/B/C' *OMIT))

This command saves all objects in directory /A and its subdirectories, except those in directory /A/B/C.

 

Example 7: Saving a Library

SAV DEV('/QSYS.LIB/TAP01.DEVD') OBJ('/QSYS.LIB/A.LIB')

This command saves library A on the tape device named TAP01.

 

Example 8: Saving Two Libraries

SAV   DEV('/QSYS.LIB/TAP01.DEVD')
  OBJ('/QSYS.LIB/A.LIB')
SAV   DEV('/QSYS.LIB/TAP01.DEVD')
  OBJ('/QSYS.LIB/B.LIB')

These two commands save two libraries. The first command saves library A and the second command saves library B.

 

Example 9: Saving All Files in a Library

SAV   DEV('/QSYS.LIB/TAP01.DEVD')
  OBJ('/QSYS.LIB/MYLIB.LIB/*.FILE')

This command saves all files in the library MYLIB on the tape device named TAP01.

 

Example 10: Saving Two Objects in a Library

SAV   DEV('/QSYS.LIB/TAP01.DEVD')
  OBJ('/QSYS.LIB/MYLIB.LIB/MYPGM.PGM')
SAV   DEV('/QSYS.LIB/TAP01.DEVD')
  OBJ('/QSYS.LIB/MYLIB.LIB/MYFILE.FILE')

These two commands save two objects in the same library. This first command saves the program MYPGM from library MYLIB. The second command saves the file MYFILE from library MYLIB.

 

Example 11: Saving a Stream File, a Database File, and a Document

SAV   DEV('/QSYS.LIB/TAP01.DEVD')
  OBJ('/MyDir/MyFile')
SAV   DEV('/QSYS.LIB/TAP01.DEVD')
  OBJ('/QSYS.LIB/MYLIB.LIB/MYFILE.FILE')
SAV   DEV('/QSYS.LIB/TAP01.DEVD')
  OBJ('/QDLS/MYFLR/MYDOC')  SUBTREE(*OBJ)
  UPDHST(*YES)

Three commands are used in this example to save three objects. The first command saves the stream file MyFile in the directory MyDir on the tape device named TAP01. The second command saves the database file MYFILE in the library named MYLIB on the tape device named TAP01. The third command saves the document MYDOC in a folder named MYFLR on the tape device named TAP01.

 

Example 12: Saving to a Save File

SAV   DEV('/QSYS.LIB/MYLIB.LIB/MYSAVF.FILE')
  OBJ(MYDIR)

This command saves the directory MYDIR to a save file named MYSAVF.

 

Example 13: Using Symbolic Links for the Save Operation

SAV   DEV('DevLink')
  OBJ(('DirLink') ('FileLink') ('DirLink/*'))
  SAVACT(*YES)  SAVACTMSGQ('MsgqLink')

This command assumes that the current directory contains the following symbolic links:

DevLink = /QSYS.LIB/TAP01.DEVD
DirLink = /SomeDirectory
FileLink = /SomeDirectory/SomeFile
MsgqLink = /QSYS.LIB/LIB1.LIB/MSGQ1.MSGQ

This command saves the names associated with DirLink and FileLink, and the objects in SomeDirectory, to device TAP01. A message is sent when the save-while-active checkpoint is complete.

Symbolic links can be used to specify a device, a save-while-active message queue, and an output file. When symbolic links are specified to be saved, only the names of the associated objects are saved, not the content of the associated objects. A symbolic link to a directory can be used to save objects in the directory. Additional information about symbolic links is in the Integrated file system topic in the File systems and management category of the Information Center.

 

Error messages for SAV

*ESCAPE Messages

CPFA0DB
Object name not a QSYS object.
CPFA0DC
Object name not a QDLS object.
CPFB8ED
Device description &1 not correct for operation.
CPF3708
Save file &1 in &2 too small.
CPF3727
Duplicate device &1 specified on device name list.
CPF3735
Storage limit exceeded for user profile &1.
CPF3738
Device &1 used for save or restore is damaged.
CPF3768
Device &1 not valid for command.
CPF377D
Save ended because of read error on internal system resource.
CPF377E
Not enough storage for save-while-active request.
CPF378A
Message queue not available.
CPF378C
SAVACTMSGQ(*WRKSTN) not valid for batch job.
CPF3782
File &1 in &2 not a save file.
CPF3794
Save or restore operation ended unsuccessfully.
CPF380D
Save or restore of entire system completed unsuccessfully.
CPF3808
Save file &2 in &3 not complete.
CPF381D
Values on CHGPERIOD parameter not valid.
CPF3812
Save file &1 in &2 in use.
CPF382B
Parameters not valid with multiple file systems.
CPF382C
OBJ parameter value not valid for QSYS file system.
CPF382E
Specified parameter not valid for QDLS file system.
CPF382F
OBJ parameter value not valid for QDLS file system.
CPF3823
No objects saved or restored.
CPF3826
*INCLUDE object required on OBJ parameter.
CPF3828
Error occurred while attempting to use &1.
CPF3829
Specified parameter not valid for QSYS file system.
CPF383A
Save or restore ended unsuccessfully.
CPF383B
End of file &1.
CPF383D
Cannot use &1.
CPF3833
Specified value on DEV parameter not valid.
CPF3834
Too many values specified on the DEV parameter.
CPF3835
Tape devices do not support same densities.
CPF3837
&1 objects saved. &2 not saved.
CPF3838
&1 objects saved. &2 objects not saved.
CPF384A
Volume identifier &1 not valid.
CPF384B
Optical file specified not valid.
CPF384C
Error occurred during CCSID conversion.
CPF384E
USEOPTBLK(*YES) not valid for CD-ROM premastering.
CPF386B
Not able to save &1.
CPF386C
Not able to save &1.
CPF3894
Cancel reply received for message &1.
CPF5729
Not able to allocate object &1.
CPF9802
Not authorized to object &2 in &3.
CPF9814
Device &1 not found.
CPF9833
*CURASPGRP or *ASPGRPPRI specified and thread has no ASP group.
CPF9825
Not authorized to device &1.