BY CONTENT LENGTH OF EXIT-PGM-DATA OF MISC,
VARREC, QUS-EC.
ᑍ
ᑍ If an exception occurs, the API returns the exception in the
ᑍ error code parameter. The bytes available field is set to
ᑍ zero if no exception occurs and greater than zero if an
ᑍ exception does occur.
ᑍ
IF BYTES-AVAILABLE OF QUS-EC >
OPEN OUTPUT LISTING,
MOVE EXCEPTION-ID OF QUS-EC
TO EXCEPTION-ID OF BAD-ADD,
WRITE LIST-LINE FROM BAD-ADD,
STOP RUN.
ᑍ
STOP RUN.
ᑍ
ᑍ End of MAINLINE
ᑍ
ᑍ
ᑍ Calculate 4-byte aligned offset for next variable length record
ᑍ
CALCULATE-NEXT-OFFSET.
COMPUTE BINARY-NUMBER = LENGTH-DATA OF QUS-VLEN-REC-4 + 12.
DIVIDE BINARY-NUMBER BY 4 GIVING BINARY-NUMBER REMAINDER X.
IF X = COMPUTE LENGTH-VLEN-RECORD OF QUS-VLEN-REC-4 =
LENGTH-DATA OF QUS-VLEN-REC-4 + 12
ELSE COMPUTE LENGTH-VLEN-RECORD OF QUS-VLEN-REC-4 =
LENGTH-DATA OF QUS-VLEN-REC-4 + 12 +
( 4 - X ).
MOVE QUS-VLEN-REC-4 TO VAR-RECORDS(VAR-OFFSET:12).
COMPUTE VAR-OFFSET = VAR-OFFSET + LENGTH-VLEN-RECORD OF
QUS-VLEN-REC-4.
Register Exit Point and Add Exit Program—OPM RPG Example
Refer to “Register Exit Point and Add Exit Program—ILE C Example” on page 4-9
for the original example.
Fᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
Fᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
Fᑍ
Fᑍ Program: Register an Exit Point
Fᑍ Add an Exit Program
Fᑍ
Fᑍ Language: OPM RPG
Fᑍ
Fᑍ Description: This program registers an exit point with the
Fᑍ registration facility. After the successful
Fᑍ completion of the registration of the exit point,
Fᑍ an exit program is added to the exit point.
Fᑍ
Fᑍ APIs Used: QUSRGPT - Register Exit Point
Fᑍ QUSADDEP - Add Exit Program
Fᑍ
Fᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
Fᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
Fᑍ
B-54 System API Programming V4R1