Retrieve Identity of Last Spooled File Created (QSPRILSP) API


  Required Parameter Group:

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

  Default Public Authority: *USE

  Threadsafe: Yes

The Retrieve Identity of Last Spooled File Created (QSPRILSP) API returns the complete spooled file identity of the last spooled file created for the current job or thread.

Authorities and Locks

None

Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

The receiver variable that receives the information requested. You can specify the size of the area to be smaller than the format requested as long as you specify the length parameter correctly. As a result, the API returns only the data that the area can hold.

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 format of the spooled file identity being returned. The valid format is SPRL0100.

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

The following table describes the order and format of the data that is returned in the receiver variable.

SPRL0100 Format


Offset Type Field
Dec Hex
0 0 BINARY(4) Bytes returned
4 4 BINARY(4) Bytes available
8 8 CHAR(10) Spooled file name
18 12 CHAR(10) Job name
28 1C CHAR(10) User name
38 26 CHAR(6) Job number
44 2C BINARY(4) Spooled file number
48 30 CHAR(8) Job system name
56 38 CHAR(7) Spooled file create date
63 3F CHAR(1) Reserved
64 40 CHAR(6) Spooled file create time


Field Descriptions

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

Bytes returned. The number of bytes of data returned.

Job name. The name of the job that owns the spooled file.

Job number. The number of the job that owns the spooled file.

Job system name. The name of the system where the job that created the spooled file ran.

Spooled file create date. The date the spooled file was created on the system. The date is in the CYYMMDD format as follows:

C Century, where 0 indicates years 19xx and 1 indicates years 20xx.
YY Year
MM Month
DD Day

Spooled file create time The time the spooled file was created on the system. The time is in the HHMMSS format where:

HH Hour
MM Minutes
SS Seconds

Spooled file name. The name of the last spooled file created by the current job or thread.

Spooled file number. The number of the last spooled file created by the current job or thread.

User name. The name of the user who owns the last spooled file created by the current job or thread.

Error Messages

Message ID Error Message Text
CPF24B4 E Severe error while addressing parameter list.
CPF3CF1 E Error code parameter not valid.
CPF333A E No spooled file created under the current job or thread.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.


API introduced: V5R2
top | Print APIs | APIs by category