\

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\

PKGPO.

\

\Setup for packing the ABC Product.

\Fill Product Option Information Parameter

MOVE "ðððð" TO OPT OF QSZ-PRD-OPT-INF.

MOVE PROD-ID OF MISC TO PID OF QSZ-PRD-OPT-INF. MOVE RLS-LVL OF MISC TO RLS-LVL OF QSZ-PRD-OPT-INF. MOVE "\ALL" TO LOD-ID OF QSZ-PRD-OPT-INF.

MOVE SPACES TO RESERVED OF QSZ-PRD-OPT-INF.

\Let's package the ABC Product.

\

CALL "QSZPKGPO" USING QSZ-PRD-OPT-INF, REPKG, ALWCHG, QUS-EC.

\

\If an exception occurs, the API returns the exception in t￿he

\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 > ð

MOVE "QSZPKGPO" TO API-NAME, PERFORM ERRCOD.

\

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\

\Subroutine: ERRCOD

\Descriptive Name: Process API errors.

\Description: This subroutine will print a line to a spool￿ed

\

file if any errors are returned in the error code

\

parameter.

\

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\

ERRCOD.

\

\Process errors returned from the API.

\If first error found, then open QPRINT \PRTF

IF FIRST-ERR = "ð"

OPEN OUTPUT LISTING, MOVE "1" TO FIRST-ERR.

\

\Output the error and the API that received the error

MOVE EXCEPTION-ID OF QUS-EC TO EXCEPTION-ID OF BAD-NEWS. WRITE LIST-LINE FROM BAD-NEWS.

Appendix B. Original Examples in Additional BLanguages-143

Page 421
Image 421
IBM Version 4 manual Call Qszpkgpo Using QSZ-PRD-OPT-INF, REPKG, ALWCHG, QUS-EC, Move Qszpkgpo to API-NAME, Perform Errcod