Create Media Definition (QSRCRTMD, QsrCreateMediaDefinition) API

  Required Parameter Group:


  Service Program: QSRLIB01

  Default Public Authority: *USE

  Threadsafe: No

The Create Media Definition (OPM, QSRCRTMD; ILE, QsrCreateMediaDefinition) API creates a media definition specified by the user. A media definition defines the devices, media, and data format to be used in parallel by a save or restore operation. For more information about using a media definition, see Saving to multiple devices to reduce your save window in the Backing up your system topic collection.


Authorities and Locks

Media Definition Authority
*OBJMGMT, *OBJEXIST, and *READ. These authorities are required only if an existing media definition is to be replaced.
Library Authority
*EXECUTE, *ADD and *READ
Media Definition Lock
*EXCL
Library Lock
*SHRUPD

Required Parameter Group

Qualified media definition name
INPUT; CHAR(20)

The media definition to be created. The first 10 characters contain the media definition name. The second 10 characters contain the name of the library in which the media definition is located.

You can use the following special value for the library name. It should be noted, however, that the library name that is actually used is not passed back to the user. Care should be taken when using this special value to avoid unexpected results.


Input data
INPUT; CHAR(*)

The variable that is to hold all the information defining the use of multiple tape files for a save or restore operation. See Input Data Format for the format of the input data.

Length of data
INPUT; BINARY(4)

The length of the data in the input data parameter. The length of data parameter may be specified up to the size of the input data variable specified in the user program. If the length of data parameter specified is larger than the allocated size of the input data variable specified in the user program, the results are not predictable. The minimum length is 72 bytes for format TAPE0100 and 92 bytes for format TAPE0200.

Format name
INPUT; CHAR(8)

The name of the format for input data. The valid values are:


Public authority
INPUT; CHAR(10)

The authority you give to users who do not have specific private or group authority to the media definition. Once the media definition has been created, its public authority stays the same when it is moved to another library or restored from backup media.

If the replace parameter is used and an existing media definition is replaced, this parameter is ignored. All authorities are transferred from the replaced media definition to the new one. The valid values for this parameter are:


Text description
INPUT; CHAR(50)

A brief description of the media definition.

Replace
INPUT; CHAR(1)

Whether you want to replace an existing media definition. The valid values are:


Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


Input Data Format

The input data consists of a header and a set of device definitions and media file definitions. The following defines the format for the header. For detailed descriptions of the fields, see Field Descriptions for Input Data.

Format TAPE0100

Format TAPE0200



Field Descriptions for Input Data

Device allocation. When to allocate the tape devices. This field is ignored for save operations that specify a target release earlier than V5R4M0. The default value is 0. The possible values are:

Device definitions. A description of the devices to be used. See Device Definition Format for the format of a device definition.

Length of header. The length of the fixed portion of the header information. The value must be 36.

Maximum parallel device resources. The maximum number of device resources to use in parallel. The possible values are 0 through 32. If 0 is specified, the value assumed is the total number of media file definitions specified in all of the device definitions.

Minimum parallel device resources. The minimum number of device resources to use in parallel. A save or restore operation will end if fewer resources are available. A restore operation will also end if any of the devices specified have no resources available. The possible values are 0 through 32. If 0 is specified, the value assumed is the number of device definitions specified.

Number of device definitions. The number of device definitions for the media definition. The possible values are 1 through 32.

Offset to first device definition. The offset from the beginning of the input data to the first device definition for the media definition. This value must be a multiple of 4.

Reserved. The value must be hexadecimal zeros.

Save format. Whether to save data in serial format or parallel format. This field is ignored for restore operations. The default value is -2. The possible values are:


Device Definition Format

Format TAPE0100

Format TAPE0200



Field Descriptions for Device Definition

Device name. The name of a tape device description or tape media library device description.

Length of device definition. The length of the fixed portion of the device definition. The value must be 28.

Media file definitions. A description of the media files to be used on this device. See Media File Definition Format for the format of a media file definition.

Number of media file definitions. The number of media file definitions for the device. The possible values are 1 through 32.

Offset to first media file definition. The offset from the beginning of the input data to the first media file definition for the device. This value must be a multiple of 4.

Offset to next device definition. The offset from the beginning of the input data to the next device definition for the media definition. This value must be a multiple of 4.

Reserved. The value must be hexadecimal zeros.


Media File Definition Format

Format TAPE0100

Format TAPE0200



Field Descriptions for Media File Definition

Length of media file definition. The length of the fixed portion of the media file definition. The value must be 28 or 60.

Length of volume identifier. The number of bytes in each volume identifier. The possible values are 0 through 6. If 0 is specified, the number of volume identifiers specified must be 0.

Number of volume identifiers. The number of volume identifiers used for the tape file. The possible values are 0 through 75. If 0 is specified, the volume currently placed in the device is used. If 0 is specified for a tape media library device, volume identifiers must be supplied by using the Tape Management exit program during the save or restore operation.

Offset to next media file definition. The offset from the beginning of the input data to the next media file definition for the device. This value must be a multiple of 4.

Offset to volume identifier array. The offset from the beginning of the input data to the first volume identifier for the tape file. This value must be a multiple of 4.

Sequence number. The tape file sequence number for the media file.

The possible values are:

Starting position in file. The position in the tape file at which to start searching for the data to restore. Specifying a value may improve the performance of the restore operation if you only want to restore data that is far from the beginning of the tape file. The starting position of each object was returned in the output of the save operation. This field must contain 32 hexadecimal characters (0-9 and A-F). The default value is a string of character zeros, which starts searching for the data to restore at the beginning of the tape file.

Starting volume array element. The element in the volume identifier array containing the volume on which the save or restore operation should begin. The possible values are 0 through the number of volume identifiers specified. If the number of volume identifiers is 0, this value must be 0. If the number of volume identifiers is greater than 0, this value must be greater than 0.

Volume identifier array. An array of volume identifiers. The save or restore operation will use the volumes in the order specified, beginning with the starting volume array element. If additional volumes are needed after the last array element is used, the save or restore operation will call the Tape Management exit program or prompt the user to provide each additional volume. The possible value for a volume identifier is:



Error Messages



API introduced: V4R4

[ Back to top | Backup and Recovery APIs | APIs by category ]