Using Keys with List Spooled Files API—ILE COBOL Example
Refer to “Using Keys with List Spooled Files API—Example” on page 3-24 for the
original example. The following program also works for OPM COBOL.
IDENTIFICATION DIVISION.
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
ᑍ
ᑍ Program: List Spooled Files for Current User
ᑍ
ᑍ Language: ILE COBOL
ᑍ
ᑍ Description: This example shows the steps necessary to
ᑍ process keyed output from an API.
ᑍ
ᑍ APIs Used: QUSLSPL - List Spooled Files
ᑍ QUSCRTUS - Create User Space
ᑍ QUSPTRUS - Retrieve Pointer to User Space
ᑍ
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
ᑍ
PROGRAM-ID. LSTSPL.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-AS4.
OBJECT-COMPUTER. IBM-AS4.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT LISTING ASSIGN TO PRINTER-QPRINT
ORGANIZATION IS SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD LISTING RECORD CONTAINS 132 CHARACTERS
LABEL RECORDS ARE STANDARD
DATA RECORD IS LIST-LINE.
1 LIST-LINE PIC X(132).
ᑍ
WORKING-STORAGE SECTION.
ᑍ
ᑍ Error Code parameter include. As this sample program
ᑍ uses COPY to include the error code structure, only the first
ᑍ 16 bytes of the error code structure are available. If the
ᑍ application program needs to access the variable length
ᑍ exception data for the error, the developer should physically
ᑍ copy the QSYSINC include and modify the copied include to
ᑍ define additional storage for the exception data.
ᑍ
COPY QUSEC OF QSYSINC-QLBLSRC.
ᑍ
ᑍ Listing text
ᑍ
1 PRTLIN.
5 PRTFIL PIC X(1).
5 FILLER PIC X(5).
5 PAGES PIC S9(9).
5 FILLER PIC X(5).
B-38 System API Programming V4R1