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(*) |
The Retrieve Media Definition (OPM, QSRRTVMD; ILE, QsrRetrieveMediaDefinition) API retrieves 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 Save to multiple devices in the Backup and recovery topic.
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. |
MDFN0100 | Format name that was used to create the media definition |
TAPE0100 | Tape devices and media |
TAPE0200 | Tape devices and media (extended) |
Media 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.
The structure in which to return error information. For the format of the structure, see Error Code Parameter.
For format MDFN0100, the retrieved data consists of the following structure. For detailed descriptions of the fields, see Field Descriptions for Receiver Variable.
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. The following defines the format for the header. For detailed descriptions of the fields, see Field Descriptions for Receiver Variable.
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 |
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 |
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.
Device 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. |
Device definitions. A description of the devices to be used. See Device Definition Format for the format of a device definition.
Format 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.
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.
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:
-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. |
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 |
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 |
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.
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.
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 |
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 |
Length of media file definition. The length of the fixed portion of the media file definition.
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. |
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. |
Top | Backup and Recovery APIs | APIs by category |