ᑍ DISPLAY THE INFORMATION RETURNED
C MOVELQUSDD RECVR 52
C DSPLY RECVR
C ADD 52 START 1
C ADD 1 X
C END
ᑍ
ᑍ DELETE THE SPACE THAT HELD THE DATA
C CALL 'QUSDLTUS'
C PARM SPCNAM
C PARM QUSBN
ᑍ
C SETON LR
Defining List Entry Format Lengths—Example of Correct Coding
The following program correctly uses the list entry length that is defined in the
space header for the QUSRTVUS API to advance from one entry to the next. This
is shown at 11 on page 9-17. If you use this value in your program, you will
always have the correct list entry length regardless of the version or release level of
the API.
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
ᑍ
ᑍProgram Name: PGM2
ᑍ
ᑍProgram Language: RPG
ᑍ
ᑍDescription: This sample program illustrates the correct
ᑍ way of using list entry length formats.
ᑍ
ᑍHeader Files Included: QUSEC - Error Code Parameter
ᑍ QUSLJOB - List Job API
ᑍ QUSGEN - User Space Format for Generic Header
ᑍ
ᑍAPIs Used: QUSCRTUS - Create User Space
ᑍ QUSLJOB - List Job
ᑍ QUSRTVUS - Retrieve User Space
ᑍ QUSDLTUS - Delete User Space
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
ᑍ
ᑍ THIS PROGRAM WILL CREATE THE NECESSARY SPACE AND THEN CALL
ᑍ THE QUSLJOB API TO GET A LIST OF ALL ACTIVE JOBS ON THE SYSTEM.
ᑍ
I/COPY QSYSINC/QRPGSRC,QUSGEN
I/COPY QSYSINC/QRPGSRC,QUSLJOB
I/COPY QSYSINC/QRPGSRC,QUSEC
ᑍ
ᑍᑍ JOB NAME STRUCTURE FOR CALLING QUSLJOB
IJOBNAM DS
I I 'ᑍALL ' 1 1 JOB
I I 'ᑍALL ' 11 2 USER
I I 'ᑍALL' 21 26 JOBNUM
ᑍ
ᑍᑍ DATA STRUCTURE TO HOLD SPACE NAME
ISPCNAM DS
I I 'SPCNAME ' 1 1 SPC
I I 'QTEMP ' 11 2 LIB
ᑍᑍ OTHER ASSORTED VARIABLES
I DS
I I 2 B 1 4SIZ
I B 5 8START
I B 9 12LENDTA
I I X'' 13 13 INTVAL
ᑍ
9-16 System API Programming V4R1