BPX1QRC (msgrcv) example

The following code adds a message to the message queue identified by MSG_ID. For the callable service, see msgrcv (BPX1QRC, BPX4QRC) — Receive from a message queue. For the data structure, see BPXYMSG — Map interprocess communication message queues. AMODE 64 callers use BPX4QRC (msgrcv) example.
                                              
         LA    R15,BUFFERA           R15 -> Utility buffer              
         ST    R15,BUFA                                                 
         USING MSGBUF,R15                                               
         MVC   MSG_TYPE(4),=A(0)                                        
         MVC   BUFLENA(4),=A(MSQ#LENGTH)                                
         MVC   FLAGS(4),=A(0)        Wait for message                   
         DROP  R15                                                      
         SPACE ,                                                        
         CALL  BPX1QSN,              Send a message (msgrcv)           +
               (MSG_ID,              Input: MessageQueueID             +
               BUFA,                 Input: ->MSGBUF           BPXYMSG +
               PRIMARYALET,          Input: ALET of message buffer     +
               BUFLENA,              Input: Length MSGBUF              +
               =A(0),                Input: Message Type       BPXYMSG +
               FLAGS,                Input: Flags              BPXYIPC +
               RETVAL,               Return value: 0, -1               +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               VL,MF=(E,PLIST)       ----------------------------------