Retrieve Media Definition (QSRRTVMD, QsrRetrieveMediaDefinition) API

  Required Parameter Group:

1 Qualified media definition name Input Char(20)
2 Receiver variable Output Char(*)
3 Length of receiver variable Input Binary(4)
4 Format name Input Char(8)
5 Error code I/O Char(*)

  Service Program Name: QSRLIB01

  Default Public Authority: *USE

  Threadsafe: No

The Retrieve Media Definition (OPM, QSRRTVMD; ILE, QsrRetrieveMediaDefinition) API retrieves a media definition specified by the user. Start of changeA 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 Save to multiple devices in the Backup and recovery topic.End of change


Authorities and Locks

Media Definition Authority
*USE
Library Authority
*EXECUTE
Media Definition Lock
*SHRNUP

Required Parameter Group

Qualified media definition name
INPUT; CHAR(20)
The media definition to be retrieved. 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 values 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 these special values to avoid unexpected results.

*CURLIB The job's current library is used to locate the media definition. If no library is specified as the current library for the job, the QGPL library is used.
*LIBL The library list is used to locate the media definition.

Receiver variable
OUTPUT; CHAR(*)
The variable that is to hold all the information defining the use of multiple tape files for a save or restore operation. See Format of Receiver Variable for the format of the information.

Length of receiver variable
INPUT; BINARY(4)
The length of the receiver variable provided. The length of receiver variable parameter may be specified up to the size of the receiver variable specified in the user program. If the length of receiver variable parameter specified is larger than the allocated size of the receiver variable specified in the user program, the results are not predictable. The minimum length is 8 bytes.

Format name
INPUT; CHAR(8)
The name of the format for the receiver variable. The valid values are:
Start of changeMDFN0100 Format name that was used to create the media definition End of change
TAPE0100 Tape devices and media
Start of changeTAPE0200 Tape devices and media (extended)End of change

Start of changeMedia definitions created with format TAPE0100 can be retrieved with format TAPE0200. The additional options in format TAPE0200 will be set to their default values.

Media definitions created with format TAPE0200 can be retrieved with format TAPE0100. The additional options in format TAPE0200 will be lost.End of change

Error code
I/O; CHAR(*)

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


Format of Receiver Variable

Start of changeFor format MDFN0100, the retrieved data consists of the following structure. For detailed descriptions of the fields, see Field Descriptions for Receiver Variable.

Format MDFN0100

Offset Type Field
Dec Hex
0 0 BINARY(4) Bytes returned
4 4 BINARY(4) Bytes available
8 8 CHAR(8) Format name

For other formats, the retrieved data consists of a header and a set of device definitions and media file definitions.End of change The following defines the format for the header. For detailed descriptions of the fields, see Field Descriptions for Receiver Variable.

Format TAPE0100

Offset Type Field
Dec Hex
0 0 BINARY(4) Bytes returned
4 4 BINARY(4) Bytes available
8 8 BINARY(4) Maximum parallel device resources
12 C BINARY(4) Minimum parallel device resources
16 10 BINARY(4) Offset to first device definition
20 14 BINARY(4) Number of device definitions
    CHAR(*) Device definitions

Start of changeFormat TAPE0200

Offset Type Field
Dec Hex
0 0   All fixed fields from format TAPE0100
24 18 BINARY(4) Length of header
28 1C BINARY(4) Device allocation
32 20 BINARY(4) Save format
    CHAR(*) Device definitions
End of change

Field Descriptions for Receiver Variable

Bytes available. The number of bytes available to be returned. All available data is returned if enough space is provided.

Bytes returned. The number of bytes of data returned. If this is less than the bytes available, the information returned is not complete.

Start of changeDevice allocation. When to allocate the tape devices. The default value is 0. The possible values are:

0 All tape devices are allocated at the beginning of the operation.
1 One tape device is allocated at the beginning of a save operation. Additional devices are allocated when data is ready to be written, at which time the number of devices specified for the Minimum parallel device resources field is required.
2 The number of devices specified for the Minimum parallel device resources field is allocated at the beginning of a save operation. Additional devices are allocated when data is ready to be written.
End of change

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

Start of changeFormat name. The name of the format that was used to create the media definition.

Length of header. The length of the fixed portion of the header information. End of change

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 receiver variable to the first device definition for the media definition.

Start of changeSave 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:

-2 If one library is saved, it is saved in parallel format. If more than one library is saved, all libraries are saved in serial format.
-1 All data is saved in serial format.
0 All data is saved in parallel format.
End of change

Device Definition Format

Format TAPE0100

Offset Type Field
Dec Hex
0 0 BINARY(4) Offset to next device definition
4 4 CHAR(10) Device name
14 E CHAR(2) Reserved
16 10 BINARY(4) Offset to first media file definition
20 14 BINARY(4) Number of media file definitions
    CHAR(*) Media file definitions

Start of changeFormat TAPE0200

Offset Type Field
Dec Hex
0 0   All fixed fields from format TAPE0100
24 18 BINARY(4) Length of device definition
    CHAR(*) Media file definitions
End of change

Field Descriptions for Device Definition

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

Start of changeLength of device definition. The length of the fixed portion of the device definition. End of change

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.

Offset to first media file definition. The offset from the beginning of the receiver variable to the first media file definition for the device.

Offset to next device definition. The offset from the beginning of the receiver variable to the next device definition for the media definition.

Reserved. An ignored field.


Media File Definition Format

Format TAPE0100

Offset Type Field
Dec Hex
0 0 BINARY(4) Offset to next media file definition
4 4 BINARY(4) Sequence number
8 8 BINARY(4) Offset to volume identifier array
12 C BINARY(4) Number of volume identifiers
16 10 BINARY(4) Length of volume identifier
20 14 BINARY(4) Starting volume array element
    CHAR(*) Volume identifier array

Start of changeFormat TAPE0200

Offset Type Field
Dec Hex
0 0   All fixed fields from format TAPE0100
24 18 BINARY(4) Length of media file definition
    CHAR(*) Volume identifier array
End of change

Field Descriptions for Media File Definition

Start of changeLength of media file definition. The length of the fixed portion of the media file definition. End of change

Length of volume identifier. The number of bytes in each volume identifier.

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 receiver variable to the next media file definition for the device.

Offset to volume identifier array. The offset from the beginning of the receiver variable to the first volume identifier for the media file.

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

The possible values are:

0 A save operation begins after the last sequence number on the starting volume. A restore operation searches the starting volume for a media file containing any of the objects to restore.
1-16777215 The sequence number 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.

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:

Volume identifier The identifier of a volume.


Error Messages

Message ID Error Message Text
CPF24B4 E Severe error while addressing parameter list.
CPF3C19 E Error occurred with receiver variable specified.
CPF3C21 E Format name &1 is not valid.
CPF3C24 E Length of the receiver variable is not valid.
CPF3C3C E Value for parameter &1 not valid.
CPF3C90 E Literal value cannot be changed.
CPF3CF1 E Error code parameter not valid.
CPF9800 E All CPF98xx messages could be signaled. xx is from 01 to FF.
CPF9999 E Function check. &1 unmonitored by &2 at statement &5, instruction &3.


API introduced: V4R4
Top | Backup and Recovery APIs | APIs by category