\

\Send information to the data queue.

CALL "QSNDDTAQ" USING NAME-OF-QUEUE, NAME-OF-LIBRARY,

SIZE-OF-MSG, MSG.

\

\Retrieve information from the data queue.

CALL "QRCVDTAQ" USING NAME-OF-QUEUE, NAME-OF-LIBRARY,

SIZE-OF-MSG, MSG-BACK, WAIT-TIME.

\

\Display the returned message

DISPLAY MSG-BACK.

\Delete the data queue

\

CALL QCAPCMD USING DLTDQ, COMMAND-LENGTH, QCA-PCMD-CPOPð1ðð,

OPTIONS-SIZE, FORMAT-NAME, RECEIVER, RECEIVER-LENGTH, RECEIVER-LENGTH, 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 > ð PERFORM ERROR-FOUND.

\

\Delete the library

CALL QCAPCMD USING DLTLIB, COMMAND-LENGTH, QCA-PCMD-CPOPð1￿ðð,

OPTIONS-SIZE, FORMAT-NAME, RECEIVER, RECEIVER-LENGTH, RECEIVER-LENGTH, 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 > ð PERFORM ERROR-FOUND.

\

STOP RUN.

\

\End of MAINLINE

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

ERROR-FOUND.

\Process errors returned from the API.

\

\If first error found, then open QPRINT \PRTF

IF FIRST-ERROR = "ð" OPEN OUTPUT LISTING,

MOVE "1" TO FIRST-ERROR.

\

B-168System API Programming V4R1

Page 446
Image 446
IBM Version 4 manual Display MSG-BACK, Error-Found, Move 1 to FIRST-ERROR