C PARM 'SPLF2'FORMAT 8 4
C PARM 'ᑍCURRENT'USRNAM 1
C PARM 'ᑍALL' OUTQ 2
C PARM 'ᑍALL' FRMTYP 1
C PARM 'ᑍALL' USRDTA 1
C PARM QUSBN
C PARM JOBNAM 26
C PARM KEYARA 5
C PARM 3 KEY# 6
Cᑍ
Cᑍ Retrieve information concerning the User Space and its contents
Cᑍ
C CALL 'QUSRTVUS' 9
C PARM SPCNAM
C PARM 1 START Start Rtv at 1
C PARM 192 LENDTA for length =192
C PARM QUSBP 1
C PARM QUSBN
Cᑍ
Cᑍ Check User Space status for good information
Cᑍ
C QUSBPD IFEQ '1' 12 Header Fmt
C QUSBPJ IFEQ 'C' 14 Complete
C QUSBPJ OREQ 'P' or Partial
Cᑍ
Cᑍ Check to see if any entries were put into User Space
Cᑍ
C QUSBPS IFGT 16
Cᑍ
Cᑍ Keep count of how many list entries we have processed
Cᑍ
C Z-ADD COUNT 9 17
Cᑍ
Cᑍ Adjust Offset value to Position value
Cᑍ
C QUSBPQ ADD 1 START 18
Cᑍ
Cᑍ Retrieve the lesser of allocated storage or available data
Cᑍ
C QUSBPT IFLT 1 19
C Z-ADDQUSBPT LENDTA
C ELSE
C Z-ADD1 LENDTA
C ENDIF
Cᑍ
Cᑍ Process all entries returned
Cᑍ
C COUNT DOWLTQUSBPS 2
Cᑍ
Cᑍ Retrieve spooled file information
Cᑍ
C CALL 'QUSRTVUS' 21
C PARM SPCNAM
C PARM START
C PARM LENDTA
C PARM RECVR
C PARM QUSBN
Cᑍ
Cᑍ Loop through returned fields
Cᑍ
C 4 SUBSTRECVR QUSFV 22
C Z-ADD5 X 4
C DO QUSFVB 23
Cᑍ
Cᑍ Get header information
Cᑍ
C 16 SUBSTRECVR:X QUSKR 24
Cᑍ
Cᑍ Set Y to location of actual data associated with key
Cᑍ
C X ADD 16 Y 4
Cᑍ
3-26 System API Programming V4R1