SAVS36LIBM (Save System/36 Library Members)
SAVS36LIBM Command syntax diagram
Purpose
The Save System/36 Library Members (SAVS36LIBM) command creates a copy of source file members in a file on diskette or tape that can be restored on a System/36, or into a database physical file on the iSeries 400 that can be sent to a System/36.
The saved member file is formatted like a record-mode LIBRFILE created on a System/36 using the System/36 FROMLIBR system OCL procedure (or the equivalent OCL call of the $MAINT SSP utility). On a System/36, the diskette, tape, or database physical file can be restored using the TOLIBR system OCL procedure (or the equivalent OCL call of the $MAINT SSP utility).
If saving to a database physical file but the specified file (PHYFILE parameter) does not exist, it is created.
This command is intended only for exchanging source and procedure data with a System/36. It provides a simplified command interface for an iSeries 400 customer who migrated from a System/36, but is not well-suited for backing up of iSeries 400 source files. Use the iSeries 400 CL commands (SAVOBJ or SAVCHGOBJ) for creating a backup copy of an iSeries 400 source file or individual source file members.
Restrictions
- The following authorities are required when running on a system using resource security:
- *USE authority for this command
- *USE authority for the library specified in the FROMLIB parameter
- *USE authority for file QS36SRC in the specified library if saving source library members
- *USE authority for file QS36PRC in the specified library if saving procedure library members
- *USE authority for the library specified in the PHYFILE parameter if saving to a physical file
- *CHANGE authority for the library specified in the PHYFILE parameter if saving to a physical file and the file does not exist
- *CHANGE and *OBJMGMT authority for that file if saving to a physical file with MBROPT(*ADD)
- *ALL authority for the file if saving to a physical file with MBROPT(*REPLACE)
- *USE authority for the diskette device description object, *USE authority for device file QSYSDKT in library QSYS if saving to diskette
- *USE authority for the tape device description object and *USE authority for device file QSYSTAP in library QSYS if saving to tape
- All diskettes that are used to save the members should be initialized using the INZDKT CL command or the equivalent System/36 environment function (INIT OCL procedure or $INIT SSP utility). For a two-sided diskette, use a sector size of 256 or 1024. For a one-sided diskette, use a sector size of 128 or 512. If tape is used, each tape volume used should first be initialized with standard labels using the INZTAP CL command or the equivalent System/36 environment function (TAPEINIT OCL procedure or $TINIT SSP utility). Use a density of 1600 bits per inch when initializing the tape.
Note: If the tape or diskette has not been initialized as stated above, the System/36 will not be able to process the media. If a tape or diskette is used that has not been properly initialized, a message is sent to the system operator that allows the operator to cancel the save or initialize the volume and continue.
- Object-level functions, other than read operations, should not be used for files QS36SRC and QS36PRC while members are being saved by SAVS36LIBM. If the necessary files cannot be allocated, no members are saved.
Record-level functions, other than read operations, should not be used for members being saved. Concurrent activity against a member (for example, adding or removing records) can cause the member to be omitted from the save operation.
- If saving a file to diskette, the diskettes used cannot contain an active file with the same name as the TOLABEL parameter value, because the iSeries 400 does not allow duplicate diskette file labels.
- Only members from source files QS36SRC (for *SRC members) and QS36PRC (for *PRC members) in the specified library can be saved using the SAVS36LIBM command. Only the member data is saved from the source file member (that is, the source sequence number and change date fields are not saved).
- The specified member name or generic member name (FROMMBR parameter) must meet iSeries 400 naming standards. When saving a member that has an extended name, the quotation mark characters are not stored as part of the member name in the output file. For example, member "A+B" would be saved as A+B.
Required Parameters
- FROMMBR
- Specifies the names of the members being saved. Specify a single member name or a single generic member name or *ALL for the members to be saved.
*ALL: All members are saved of the member type specified on the SRCMBRS parameter.
member-name: Specify the names of the members being saved.
generic*-member-name: Specify the generic name of the member. A generic name is a character string of one or more characters followed by an asterisk (*); for example, ABC*. The asterisk substitutes for any valid characters. A generic name specifies all objects with names that begin with the generic prefix for which the user has authority. If an asterisk is not included with the generic (prefix) name, the system assumes it to be the complete object name. For more information on the use of generic names, refer to generic names.
- FROMLIB
- Specifies which library contains the members being saved.
- DEV
- Specifies the names of the devices used for the save operation. Each device name must already be known on the system by a device description.
*PHYFILE: The output file is the database physical file specified by the PHYFILE parameter.
device-name: Specify the name of the diskette device, the media library device, or the names of tape devices that are used for the operation. If more than one tape device is used, specify the names of the devices in the order in which they are used. When more than one tape volume is used, using more than one tape device permits one tape volume to be rewound or unloaded while another tape device processes the next tape volume. More information on device names is in the APPC, APPN, and HPR topic in the Information Center.
Optional Parameters
- SRCMBRS
- Specifies which member types (source and procedure members on System/36) are saved.
*ALL: Save System/36 source and procedure members (from QS36SRC and QS36PRC) which match the member name specified (FROMMBR parameter). For example, if FROMMBR(PAY*) and SRCMBRS(*ALL) is specified, all members from both source files that begin with the letters 'PAY' are saved.
*SRC: Only System/36 source members (from file QS36SRC), which match the member name specified (FROMMBR parameter), are saved.
*PRC: Only System/36 OCL procedure members (from file QS36PRC), which match the member name specified (FROMMBR parameter), are saved.
- RCDLEN
- Specifies the file record length (in bytes) used when copying the members. This parameter is ignored when saving members to an existing database physical file.
120: This is the maximum record length allowed for System/36 source and procedure library members. Using this length ensures that no data is truncated when copying the records to the output file.
record-length: Specify the logical record length of the statements in the member. Valid values range from 40 through 120 and must be less than or equal to the record length of the file.
- TOLABEL
- Specifies the label of the diskette or tape file that receives the copied source file member data. Up to 8 characters can be used for the label value for the diskette or tape file. If the DEV parameter is not *PHYFILE, a TOLABEL value must be specified.
- SEQNBR
- Specifies, only when tape is used, which sequence number is used for the save operation.
*END: The system saves the specified members 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. If the sequence number to be assigned to the specified file is greater than 9999, an error message is issued and the operation ends.
file-sequence-number: Specify the sequence number of the file that is used. Valid values range from 1 through 9999.
If this sequence number already exists on the tape volume, the tape label at that sequence number must match the TOLABEL parameter value. The existing data file at that sequence number is overwritten, and all subsequent files on the volume are not accessible after the save operation.
If a new tape file is added to the tape, the sequence number must be one greater than the sequence number of the last tape file on that volume. No gaps are allowed in the series of sequence numbers.
- 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.
*MOUNTED: The members saved are copied on the volume that is in the device. For diskettes, use the volume that is in the diskette drive. If the diskette loaded in the diskette drive is full of active files, the save operation ends.
volume-identifier: Specify the volume identifiers of the tapes or diskettes used for saving the members. For each tape or diskette volume name, up to 6 characters can be specified using any combination of letters and numbers. The user should ensure that the volume name meets the System/36 volume identifier requirements. Up to 50 volume identifiers can be specified.
- RETAIN
- Specifies the retention period for the newly created tape or diskette file. The file is protected and cannot be written over until the day after the retention period ends.
1: A retention period of one day is used.
retention-period: Specify the number of days the tape or diskette file should be kept. Valid values range from 0 through 999. If a retention period of 999 is specified, the tape or diskette file becomes a permanent file.
- EXCHTYPE
- Specifies the exchange type for the newly created diskette file.
*E: The default is to create an E-exchange diskette file. An E-exchange file is a system save file that can be restored either on a System/36 (using the TOLIBR procedure) or on an iSeries 400 (using the RSTS36LIBM command).
*BASIC: The output diskette file is to be in basic exchange format. A basic exchange format file can be restored or copied to a System/34 or System/32 or any other system that supports the basic exchange diskette format.
- ENDOPT
- Specifies the operation that is automatically performed on the tape volume after the operation ends. If more than one volume is included, this parameter applies only to the last tape volume used; all other tape volumes are rewound and unloaded when the end of the tape is reached.
Note: This parameter is ignored if a diskette device is specified in the DEV parameter. *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.
- PHYFILE
- Specifies the qualified name of the file that receives the copied source file member data. This parameter is required if DEV(*PHYFILE) is specified.
If a file by this name does not exist, it is created in the current library if a library name was not specified, as a non-keyed, program-described physical file with the specified record length (RCDLEN parameter). If a file already exists by this name, it is used as long as it is a non-keyed physical file with a record length from 40 to 120.
The copied records are put in the first member of the physical file. If the file has no members, a member is created using the name syntax 'Myymmdd' and the system date (for example, if the SAVS36LIBM was run on June 28, 1987, the member name would be M870628).
The name of the physical file can be qualified by one of the following library values:
*LIBL: All libraries in the job's library list are searched until the first match is found.
*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
library-name: Specify the name of the library to be searched.
file-name: Specify the name of the file that receives the copied source file member data.
- MBROPT
- Specifies whether the new records replace or are added to the existing records.
*REPLACE: The system clears the existing member and adds the new records.
*ADD: The system adds the new records to the end of the existing records.
Examples for SAVS36LIBM
Example 1: Saving Single Procedure Member
SAVS36LIBM FROMMBR(XYZ1) FROMLIB(JOHNSON) DEV(I1) SRCMBRS(*PRC) TOLABEL(XYZ1)The single OCL procedure member XYZ1 (in source file QS36PRC) in library JOHNSON is saved. Assuming I1 is a diskette device, the member is saved to diskette file XYZ1. The file length is 120 and the retention period is one day.
Example 2: Saving All Source and Procedure Members
SAVS36LIBM FROMMBR(X*) FROMLIB(ORDER) DEV(*PHYFILE) PHYFILE(NETLIB/S36SRC) MBROPT(*ADD)All source and procedure members (members in QS36SRC and QS36PRC) with names starting with the character 'X' in library ORDER are saved into database physical file S36SRC in library NETLIB. The copied records are added after any records already in the file.
Error messages for SAVS36LIBM
*ESCAPE Messages
- CPF2C4A
- Device &1 not correct for command.
- CPF2C4B
- Duplicate device &1 specified in device name list.
- CPF2C4C
- Diskette device &1 included in multiple device specification.
- CPF2C43
- Saved &2 members from library &1, &3 members not saved.
- CPF2C44
- No members saved from library &1.
- CPF2C48
- Input file &1 in &2 not correct for command.
- CPF2C49
- Output file &1 in &2 not correct for command.
- CPF2C5E
- Input file &1 in &2 not correct for command.
- CPF2C5F
- Tape file sequence numbers beyond 9999 not allowed.
- CPF2C50
- File description for file &1 is not available.
- CPF2C51
- Member information for file &1 in library &2 is not available.
- CPF2C52
- Error occurred during attempt to create file &1 in library &2.
- CPF2C55
- TOLABEL parameter value &1 contains embedded blank(s).
- CPF2C58
- Diskette format not acceptable for System/36.
- CPF9807
- One or more libraries in library list deleted.
- CPF9808
- Cannot allocate one or more libraries on library list.
- CPF9810
- Library &1 not found.
- CPF9812
- File &1 in library &2 not found.
- CPF9814
- Device &1 not found.
- CPF9820
- Not authorized to use library &1.
- CPF9822
- Not authorized to file &1 in library &2.
- CPF9825
- Not authorized to device &1.
- CPF9826
- Cannot allocate file &2.
- CPF9830
- Cannot assign library &1.
- CPF9845
- Error occurred while opening file &1.
- CPF9847
- Error occurred while closing file &1 in library &2.
- CPF9849
- Error while processing file &1 in library &2 member &3.
*STATUS Messages
- CPI2C13
- Copying records from file &1 in library &2 member &3.