ᑍ 5 RESERVED PIC X(1).
ᑍ
ᑍ Varying length
1 QUS-SPLF2.
5 NUM-FIELDS-RETD PIC S9(9) BINARY.
5 KEY-INFO.
9 LEN-FIELD-INFO-RETD PIC S9(9) BINARY.
9 KEY-FIELD-FOR-FIELD-RETD PIC S9(9) BINARY.
9 TYPE-OF-DATA PIC X(1).
9 RESERV3 PIC X(3).
9 DATA-LENGTH PIC S9(9) BINARY.
9 DATA-FIELD PIC X(1).
9 RESERVED PIC X(1).
ᑍ
ᑍ Varying length
ᑍ
ᑍ
ᑍ Beginning of mainline
ᑍ
PROCEDURE DIVISION.
MAIN-LINE.
ᑍ
ᑍ Open LISTING file
ᑍ
OPEN OUTPUT LISTING.
ᑍ
ᑍ Set Error Code structure to use exceptions
ᑍ
MOVE TO BYTES-PROVIDED OF QUS-EC. 1
ᑍ
ᑍ Create a User Space for the List generated by QUSLSPL
ᑍ
CALL "QUSCRTUS" USING SPC-NAME, EXT-ATTR, SPC-SIZE, 2
SPC-INIT, SPC-AUT, SPC-TEXT,
SPC-REPLAC, QUS-EC, SPC-DOMAIN
ᑍ
ᑍ Call QUSLSPL to get all spooled files for ᑍCURRENT user
ᑍ
CALL "QUSLSPL" USING SPC-NAME, LST-FORMAT-NAME, USR-PRF, 34
OUTQ, FORMTYP, USRDTA, QUS-EC,
JOBNAM, KEYS, NUMBER-OF-KEYS. 56
ᑍ
ᑍ Get a resolved pointer to the User Space for performance
ᑍ
CALL "QUSPTRUS" USING SPC-NAME, SPCPTR, QUS-EC. 9
ᑍ
ᑍ If valid information was returned
ᑍ
SET ADDRESS OF QUS-GENERIC-HEADER-1 TO SPCPTR.
IF STRUCTURE-RELEASE-LEVEL OF QUS-GENERIC-HEADER-1 12
NOT EQUAL "1" WRITE LIST-LINE FROM HDRERR, 13
STOP RUN.
IF (INFORMATION-STATUS OF QUS-GENERIC-HEADER-1 = "C" 14
OR INFORMATION-STATUS OF QUS-GENERIC-HEADER-1 = "P")
AND NUMBER-LIST-ENTRIES OF QUS-GENERIC-HEADER-1 > 16
ᑍ
B-40 System API Programming V4R1