IBM Version 4 Universal Remote User Manual


 
C PARM RECVR
C PARM QUSBN
ᑍ DISPLAY THE JOB NAME
C DSPLY JNAME >>> When displayed,JNAME
will look something like
'QCPF QS'
ᑍ DELETE THE SPACE THAT HELD THE DATA
C CALL 'QUSDLTUS'
C PARM SPCNAM
C PARM QUSBN
ᑍᑍ
C SETON LR
Defining A Data Structure—Example of Correct Coding
The following program uses a data structure that is supplied from the QSYSINC
library. When you use this data structure, you can prevent errors in data structure
creation from happening. If the data structures change from release to release,
updates to programs do not have to be done. The application program would have
to be updated only if a new field was added to the data structure and you wanted
to use the field. The copying of the QSYSINC data structure is shown at 6 on
page 9-7.
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
ᑍProgram Name: PGM2
ᑍProgram Language: RPG
ᑍDescription: This sample program illustrates the correct
way of defining data structures.
ᑍHeader Files Included: QUSEC - Error Code Parameter
QUSGEN - User Space Format for Generic Header
QUSLJOB - List Job API
ᑍ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.
ᑍ THE FIRST JOB NAME/USER WILL BE DISPLAYED TO THE USER.
I/COPY QSYSINC/QRPGSRC,QUSGEN
I/COPY QSYSINC/QRPGSRC,QUSEC
I/COPY QSYSINC/QRPGSRC,QUSLJOB 6
ᑍᑍ 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
ᑍᑍ JOBL1 FORMAT RETURNED FROM QUSLJOB API
Chapter 9. Common API Programming Errors 9-7