REXX QUEUE PULL and VPUT VGET usage


Two sample EXECs, MUT002X and MUT003X, are distributed to show the use of REXX QUEUE/PULL and IMFEXEC's VPUT/VGET instructions.

As with all REXX EXECs, the PARSE and ADDRESS commands are used. After these commands, MUT002X calls MUT003X to issue the MVS commands, D R,L. When entered, MUT003X establishes the IMFEXEC as the external environment with the ADDRESS instruction.

The following command displays the outstanding replies:

Related topic

'IMFEXEC CMD 'D R,L' RESPONSE(IEE112I) WAIT(20)'

Upon return, the response lines are in the local pool. The variable IMFNOL contains the number of lines returned. The variable NUMLINES is ASSIGNED the values of IMFNOL and VPUT to the local pool.

MUT003X places information into the BMC AMI Ops Automation local pool and the REXX EXTENDED DATA QUEUE with the following set of instructions:

 DO N=1 TO IMFNOL BY 1 UNTIL N>IMFNOL
     'IMFEXEC VDCL REXXL'N' LIST(TEXT B C D E F)'
     'IMFEXEC VGET LINE'N' INTO(REXXL'N') LOCAL'
     'IMFEXEC VPUT LINE.'N' FROM(REXXL'N') LOCAL'
     QUEUE 'LINE.'N TEXT B C D E F
 END

Although 'LINE'.N looks like a REXX STEM, a specific queued line cannot be referenced by the PULL command; therefore the pseudo stem, 'LINE.'N, becomes a part of the data that queued.

The QUEUE command builds the extended data queue. After the loop is completed, MUT003X issues the RETURN command and processing is continued in MUT002X.

Upon return from MUT003X, MUT002X uses the REXX built-in function QUEUED to establish the number of lines queued and displays this information before setting up the loop to PULL from the extended data queue. The following sequence of instructions is executed:

 CNT=QUEUED()
 IMFEXEC MSG '.MUT002X: THE NUMBER OF QUEUED LINES IS:'CNT
 DO N=1 TO CNT BY 1 UNTIL N>CNT
     PULL LINE TEXT B C D E F
     IMFEXEC MSG '.MUT002X: PULL VARIABLES ARE:' LINE TEXT B C D E F
 END

Notice that LINE is considered a part of the data that is queued and not a REXX STEM. REXX discards the data once it has been pulled from the extended data queue. If you want to erase the data queue, build a PULL loop without specifying an argument template. The PULL instruction also can be specified as PARSE PULL.

MUT002X continues execution by getting NUMLINES from the LOCAL POOL and setting up a similar loop to issue VDCL and VGET instructions to derive the values that were stored in the LOCAL POOL by MUT003X.

EXECs for REXX QUEUE/PULL and VPUT/VGET usage

EXEC name

Description

MUT002X

invokes MUT003X to gather data then VGET the data from the LOCAL POOL and PULL the data from the REX DATA QUEUE

MUT003X

issues the MVS command D R,L and places the data from the response in the LOCAL POOL and the REXX DATA QUEUE

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*