z/OS MVS Programming: Sysplex Services Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Example

z/OS MVS Programming: Sysplex Services Reference
SA38-0658-00

Operation: Receive a message that another member of the XCF group sent. The token and length for the message are accessed from the parameter list at entry to the message user-routine (using the IXCYMEPL mapping macro). Register 4 is the length of the message; the STORAGE macro obtains an area equal to that length. Register 3 contains the address of this area. TOKENMSG contains the token of the message to be received. XCF is to store the return code and reason code into the variables RETURN and REASON. Although not shown here, you must obtain storage for the dynamic area (@DATD). See “Using the Cross-System Coupling Facility” in z/OS MVS Programming: Sysplex Services Guide, for a complete example showing the use of IXCMSGIX in a message user routine.

Note: Since more than one message user routine can be running at a time, message user routines should be reentrant. IBM® recommends that you use the list and execute forms of IXCMSGIX.
          L     R4,MEPLMLEN                  LENGTH OF INCOMING MESSAGE
          STORAGE OBTAIN,LENGTH=(R4),SP=0    GET STORAGE FOR MESSAGE
          LR    R3,R1                        SAVE ADDRESS OF STORAGE
          MVC   TOKENMSG(4),MEPLMTOK         MESSAGE TOKEN TO PASS TO XCF

          IXCMSGIX MSGTOKEN=TOKENMSG,MSGBUF=(R3),RETCODE=RETURN,         X
                RSNCODE=REASON,MF=(E,MSGILSTD)    HAVE XCF PUT          X
                                              MESSAGE IN STORAGE        X
                                              JUST OBTAINED


 * DSECT used to map the dynamic area storage
 @DATD            DSECT
                  DS 0F
 MSGILST2         IXCMSGIX MF=(L,MSGILSTD)    LIST FORM OF IXCMSGIX MACRO
 RETURN           DS 1F                      RETURN CODE
 REASON           DS 1F                      REASON CODE
 TOKENMSG         DS CL4                     MESSAGE TOKEN TO PASS TO XCF

You can obtain the message token from the MEPLMTOK field in the parameter list passed to the message user routine. The message token identifies the message to be received. Do not confuse the message token with the member token. The member token identifies the member that sent the message. You can obtain the member token from the MEPLSRCE field in the parameter list.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014