![]() |
![]() |
|
|
Getting Unsolicited Messages
To get unsolicited messages, you must call the TPGETUNSOL(3cbl) routine. This routine can be called, however, only from an unsolicited message handler. Use the following signature to call the TPGETUNSOL routine.
01 TPTYPE-REC.
COPY TPTYPE.
01 DATA-REC.
COPY User data.
01 TPSTATUS-REC.
COPY TPSTATUS.
CALL "TPGETUNSOL" USING TPTYPE-REC DATA-REC TPSTATUS-REC.
Refer to Defining a Service for a description of the TPTYPE-REC record.
The following example shows how to get an unsolicited message.
Getting an Unsolicited Message
IDENTIFICATION DIVISION.
PROGRAM-ID. TMDISPATCH9.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. USL-486.
OBJECT-COMPUTER. USL-486.
*
DATA DIVISION.
WORKING-STORAGE SECTION.
*
01 TPTYPE-REC.
COPY TPTYPE.
*
01 TPSTATUS-REC.
COPY TPSTATUS.
*
01 DATA-REC PIC X(1000).
*
PROCEDURE DIVISION.
*
A-000.
*
MOVE "CARRAY" TO REC-TYPE.
MOVE 1000 TO LEN.
CALL "TPGETUNSOL" USING TPTYPE-REC
DATA-REC
TPSTATUS-REC.
IF NOT TPOK
error processing
*
Process message
DISPLAY "TPGETUNSOL IS TPOK".
DISPLAY "MESSAGE IS" DATA-REC.
DISPLAY "LENGTH IS" LEN.
EXIT PROGRAM.
*
![]() |
![]() |
![]() |
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|