Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Restore System/36 File (RSTS36F) command restores to the system a single file or a group of files from a save all set. A single file can be restored from a database physical file, a diskette file or a tape file. A group of files can be restored from a save all set on diskette or tape.
The restore operation reads the description of the file from the database physical file, diskette, or tape, creates a database physical or logical file and copies any data from the database physical file, diskette file or tape file into the new database file. The database physical file must have been created with the Save System/36 File (SAVS36F) command. The diskette or tape file may have been created on a System/36 using the SAVE system operator control language (OCL) procedure (or the equivalent OCL use of the $COPY SSP utility), or by using the Save System/36 File (SAVS36F) command. The Restore System/36 File (RSTS36F) command accepts diskette or tape files created on a System/34 or System/32 using the $COPY utility.
The RSTS36F command accepts a diskette file created as a compressed file.
If the file being restored does not exist in the library specified on the TOLIB parameter, it is created. A physical file member is added using the name syntax 'Myymmdd', which identifies the original creation date of the file. This naming convention is needed by the System/36 environment in order to support date-differentiated files.
If a file name is specified for the TOFILE parameter, the name must meet the AS/400 system naming standards. For more information about AS/400 system naming conventions, see Chapter 2, "Control Language Syntax", in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
If TOFILE(*SET) is specified, the files that are restored may have names that contain characters not allowed in an AS/400 simple object name. In this case, the file name is changed to an AS/400 system extended name and the file is restored.
If the name contains a blank, a single quotation mark, a double quotation mark, an asterisk, a question mark, or a device control character (hexadecimal 00 through 3F or hexadecimal FF), the invalid characters are replaced with underlines. The file is then restored using the resulting simple or extended name; for example, A_? would become "A_"). If a file already exists with this new name, it is handled like any other name (see the MBROPT parameter).
If a file name is changed because of invalid characters, an informational message (CPF 2C1F) is sent to the recursion level above the program that is running this command. If the name is changed from a simple name to an extended name, no message is sent.
If the restore function creates the file and the file was not previously secured, the new file is owned by the user issuing the RSTS36F command and the file is created with a default authority of *ALL (that is the same as AUT(*ALL)).
If the file was saved from the S/36 where the attributes were an extend value of zero or no value specified, then a default value of 32 767 divided by the record length is assigned. If an extend value of zero is required, use the change physical file (CHGPF) command (after the restore is completed) to set SIZE(*EXTEND) to zero. If the file was saved from the AS/400 system, the file is restored and the extend value does not change.
Note: This function is intended only for exchanging files with a System/36.
Restrictions:
Because all members of a physical file share the same file attributes (for example, record length and key information), date-differentiated files with the same name that are restored to the same library are required to have the same file attributes. If an attribute mismatch is present, the files are not restored.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
TOFILE | To file | Name, *SET | Required, Positional 1 |
TOLIB | To library | Name | Required, Positional 2 |
DEV | Device | Single values: *PHYFILE Other values (up to 4 repetitions): Name |
Required, Positional 3 |
SET | Set identifier | Character value, #SAVE | Optional |
IGCDTA | User specified DBCS data | *NO, *YES | Optional |
FROMLABEL | File label | Character value | Optional |
CRTDATE | Creation date | Date, *NONE | Optional |
SEQNBR | Sequence number | 1-9999, *SEARCH | Optional |
VOL | Volume identifier | Values (up to 50 repetitions): Character value, *MOUNTED | Optional |
ENDOPT | End of tape option | *REWIND, *LEAVE, *UNLOAD | Optional |
PHYFILE | Physical file | Qualified object name | Optional |
Qualifier 1: Physical file | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
MBROPT | Data base member option | *NOREPLACE, *REPLACE | Optional |
DATDIFF | Date differentiated file | *NO, *YES | Optional |
Top |
Specifies the name given to a single file when it is restored to the system or to a group of files from a save all set that are restored to the system. If a single file is restored, this parameter allows the file to be renamed at the time it is restored to the system.
This is a required parameter.
Top |
Specifies which library should contain the file being restored.
This is a required parameter.
Top |
Specifies the name of a diskette unit, the names of one or more tape devices, or an indication that the file to be restored is in a database physical file. A maximum of four tape device names can be specified. If more than one tape device is used, enter the names of the devices in the order in which they are used. Each device name must be already known on the system by a device description.
Top |
Specifies the name used to identify the save all set files saved on the diskette or tape by the SAVE procedure or the $COPY utility on the System/36, System/34, or System/32.
Top |
Specifies whether the file contains double-byte character set (DBCS) data.
Note: If a file already exists by the name specified on the To file prompt (TOFILE parameter), the double-byte character set (DBCS) capability of the existing file is not changed by the restore operation.
Top |
For a single file restore operation, this parameter can be used to specify the label of the diskette or tape file that contains the file that is to be restored to the system. If no value is specified, the file name specified for the To file prompt (TOFILE parameter) is used as the diskette or tape file label.
For a group restore operation, this parameter can be used to specify the diskette or tape file label within a save all set where the restore operation is to begin. If no value is specified, the restore operation begins with the first file in the set.
If a label is specified, it must be a maximum of eight characters long.
Top |
Specifies the creation date of the diskette file or tape file used for the restore operation. The specified date is changed to Julian format (cyyddd) for tape or international format (yymmdd) for diskette.
Top |
Specifies, when tape is used, which sequence number is used for the restore operation.
Top |
Specifies the volume identifiers of the tapes or diskettes used for restoring the file.
Top |
Specifies, only when tape is used, what positioning operation is automatically performed on the tape volume after the restore operation ends. This parameter applies only to the last reel used.
Top |
Specifies the name of the database physical file that is used as the input file for the restore process. If the specified file does not exist, or is not a physical file, or the file contains no members, a message is sent. If the file contains multiple members, the first member of the file is used.
The possible library values are:
Top |
Specifies whether the data of an existing physical file member is replaced.
Top |
Specifies whether the restore operation allows multiple files with the same name but different file creation dates.
If the restore operation is done with *NO specified, and a file already exists in the specified library with the same name, the following actions are taken:
If the restore operation is done with *YES specified, and a file already exists in the specified library with the same name, the following actions are taken:
If a file does not already exist in the specified library with the same name, a new file is created, a member is added to the file and the data from the saved file is copied into the new member.
Top |
Example 1: Restoring From Diskette
RSTS36F TOFILE(ACCTRCV) TOLIB(QS36F) DEV(I1) CRTDATE('01/22/85') VOL(SAVE1)
This command restores the file ACCTRCV into library QS36F. Assuming that I1 is the name of a diskette device description object, the file is restored from the diskette placed in the diskette device. The diskette must have a volume name of SAVE1. The diskette file used for the restore must have a file label of ACCTRCV and a creation date of January 22, 1985 (assuming the job date format is *MDY and the date separator is a '/').
Example 2: Restoring From Tape
RSTS36F TOFILE(PAY.VIEW) TOLIB(PAYLIB) DEV(T1) FROMLABEL('P*V') ENDOPT(*LEAVE)
The file P*V is restored from device T1 as a file named PAY.VIEW in library PAYLIB. Assuming T1 is a tape device, the file is copied from one or more tapes that are on device T1. No check is made on the tape volume name. When the restore operation ends, the tape is left positioned at the end of tape file P*V.
Example 3: Restoring from a Physical File
RSTS36F TOFILE(ACCTPAY) TOLIB(QS36F) DEV(*PHYFILE) PHYFILE(NETLIB/SENDFILE)
This command restores the file ACCTPAY in library QS36F from physical file SENDFILE in library NETLIB.
Example 4: Specifying Sequence Numbers
RSTS36F TOFILE(*SET) TOLIB(QS36F) DEV(T1 T2) SET(PAYFILES) FROMLABEL(FILE10) MBROPT(*REPLACE) DATDIFF(*YES) SEQNBR(*SEARCH) VOL(*MOUNTED) ENDOPT(*REWIND)
This command restores a subset of the files in the save all set called PAYFILES to library QS36F from tape. The restore operation begins with a tape file whose label is file 10. If one of the files being restored already exists in library QS36F with the same creation date as the saved file, the file is replaced. If a file already exists in library QS36F with a different creation date, a new date-differentiated number is added to the file. The restore operation uses the tape volumes that are placed in tape drives T1 and T2. After the restore operation is complete, the last tape volume is rewound to the beginning of the tape.
Top |
*ESCAPE Messages
*STATUS Messages
Top |