Previous Topic: Issue a Command and Process the Command Response

Next Topic: ADDRESS OPER Security With Audit Ability

Usage of ADDRESS OPER

These examples show specific usage of the ADDRESS OPER for each type of command response.

OPSLOG Browse OPS11Q - CA11 --- OPSVIEW --- 07:17:12 OPSF CnslName ----+----1----+----2----+----3----+----4- 8000 OPS11X01 D NET,ID=A11IOPS,E 2408 OPS11X01 IST075I NAME = A11IOPS, TYPE = APPL SEGMENT 2408 OPS11X01 IST486I STATUS= ACTIV, DESIRED STATE= ACTIV 2408 OPS11X01 IST360I APPLICATIONS: 2408 OPS11X01 IST080I A11IOPSA CONCT A11IOPSB CONCT 2408 OPS11X01 IST080I A11IOPSD CONCT A11IOPSE CONCT 2408 OPS11X01 IST080I A11IOPSG CONCT A11IOPSH CONCT 2408 OPS11X01 IST080I A11IOPSJ CONCT A11IOPSK CONCT 2408 OPS11X01 IST080I A11IOPSM CONCT A11IOPSN ACT/S 2408 OPS11X01 IST080I A11IOPSP ACT/S A11IOPSQ ACT/S 2408 OPS11X01 IST080I A11IOPSS CONCT A11IOPST ACT/S 2408 OPS11X01 IST080I A11IOPSW ACT/S A11IOPSX CONCT 2408 OPS11X01 IST080I A11IOPSZ CONCT A11IOPSV ACT/S 2608 OPS11X01 IST314I END

Using this VTAM display command as an example, the following code illustrates issuing a command and collecting output that is returned as a SINGLE MLWTO (Primary line, followed by data lines, with one end line for end of response) back to the issuing CA OPS/MVS console.

/*--------------------------------------------------------*/
/* Start out with a clean EDQ before issuing the command. */
/*--------------------------------------------------------*/
clearedq = OPSCLEDQ()
/*--------------------------------------------------------*/
/* Issue the VTAM display command using the necessary     */
/* command response trapping keywords.
/*--------------------------------------------------------*/
ADDRESS OPER
"Command(D NET,ID=A11IOPS,E) Cmdwait(30) Interval(0)"
/*--------------------------------------------------------*/
/*Simply display back the captured command responses. The */
/*collected command responses are destined for the        */
/*External Data queue of the program and can be extracted */
/*via the PULL instruction.                               */
/*--------------------------------------------------------*/
cmdoutlines = QUEUED()
do cmdoutlines
 pull cmdoutput
 say '**>OUTPUT='cmdoutput 
end

The following keywords are used within the above sample:

Command(D NET,ID=A11OPS,E)

Specifies the text of the command to be issued (VTAM Display command in this case).

CMDWAIT(30)

Sets a CONDITIONAL wait time of 30 seconds. Meaning the total wait time for collecting output will be up to 30 seconds or until some stop trapping condition occurs. The stop trapping condition in the case of the single line MLWTO response will be the collection of the end-line of the command response.

Interval(0) keyword

Disables the stop trapping mechanism that measures the delivery time of each collected command output line.

OPSLOG Browse OPS11Q - CA11 --- OPSVIEW --- 09:50:25 05JUN2009 COLS 001 05 OPSF CnslName WTO ID ----+----1----+----2----+----3----+----4----+----5---- 8000 OPS11X01 00000000 $DF 3008 OPS11X01 1B0724D2 $HASP621 OUT R=LOCAL 3408 OPS11X01 1B0724D2 $HASP621 OUT R=LOCAL F=DPLX C=**** T=* 3608 OPS11X01 1B0724D2 $HASP621 PRMODE=LINE CLASS A=24 3008 OPS11X01 1B0724D3 $HASP621 OUT R=LOCAL 3408 OPS11X01 1B0724D3 $HASP621 OUT R=LOCAL F=GARY C=**** T=* 3608 OPS11X01 1B0724D3 $HASP621 PRMODE=LINE CLASS A=1 3008 OPS11X01 1B0724D4 $HASP621 OUT R=LOCAL 3408 OPS11X01 1B0724D4 $HASP621 OUT R=LOCAL F=OBER C=**** T=* 3608 OPS11X01 1B0724D4 $HASP621 PRMODE=LINE CLASS B=12 M=5 3008 OPS11X01 1B0724D5 $HASP621 OUT R=LOCAL 3408 OPS11X01 1B0724D5 $HASP621 OUT R=LOCAL F=STD C=**** T=* 3408 OPS11X01 1B0724D5 $HASP621 PRMODE=LINE CLASS A=1578 B=14 G=1 3608 OPS11X01 1B0724D5 $HASP621 CLASS P=95 R=95 S=3 T=5 X=21 3008 OPS11X01 1B0724D6 $HASP621 OUT R=LOCAL 3408 OPS11X01 1B0724D6 $HASP621 OUT R=LOCAL F=STD C=**** T=* 3608 OPS11X01 1B0724D6 $HASP621 PRMODE=LINE CLASS X=1

Using this JES2 $DF display command as an example, the following code illustrates issuing a command and collecting output that is returned as a multiple MLWTO (Primary line, followed by data lines, an end-line, then another sequence of primary line, data line, end-line etc. Notice the WTOID OPSLOG display in the $DF output that changes with each MLWTO occurrence.)

/*--------------------------------------------------------*/
/* Start out with a clean EDQ before issuing the command. */
/*--------------------------------------------------------*/
clearedq = OPSCLEDQ()                                       
/*--------------------------------------------------------*/
/* Issue the JES2 $DF command using the necessary command */
/* response trapping keywords.                            */
/*--------------------------------------------------------*/
address Oper                                                
"Command($DF) CMDWAIT(30) INTERVAL(300) STOPEND(NO)"        
/*--------------------------------------------------------*/
/* Simply display back the captured command responses. The*/
/* collected command responses are destined for the       */
/* external data queue of the program and can be          */
/* extracted and processed via the PULL instruction.      */
/*--------------------------------------------------------*/
cmdoutlines = QUEUED()                                      
do cmdoutlines 
 pull cmdoutput 
 say '**>Output='cmdoutput 
end 

The above sample uses the following keywords:

Command($DF)

Specifies the text of the command to be issued (JES2 $DF Display command in this case).

CMDWAIT(30)

Sets a CONDITIONAL wait time of 30 seconds. Meaning the total wait time for collecting output will be up to 30 seconds or until some stop trapping condition occurs. The stop trapping condition in the case of this JES2 $DF command response will be the INTERVAL condition as noted below.

Interval(300) keyword

Sets the stop trapping mechanism that measures the delivery time between each collected command output line to be that of 300 centiseconds. Therefore, when the delivery time of 300 centiseconds occurs, the response trapping will terminate.

The STOPRESP(message ID) keyword could optionally be utilized if the specified message ID indicates that all the desired output has been issued. Specific use of the STOPRESP keyword can be found in the example titled Using the STOPRESP and STOPMSG keywords to terminate response processing.

OPSLOG Browse OPS11Q - CA11 --- OPSVIEW --- 09:50:25 05JUN2009 COLS 001 05 OPSF CnslName WTO ID ----+----1----+----2----+----3----+----4----+----5---- 0000 OPS11X01 00000000 E PCPDA115,SRVCLASS=BATSTWLM 8008 OPS11X01 1B0724D2 IEE304I PCPDA115 JOB RESET

Using this z/OS Reset command as an example, the following code illustrates issuing a command and collecting output that is returned in the form of single line WTOs.

/*--------------------------------------------------------*/
/* Accept name of batch job from invoking MSG rule        */
/*--------------------------------------------------------*/
arg jobname
/*--------------------------------------------------------*/
/* Start out with a clean EDQ before issuing the command. */
/*--------------------------------------------------------*/
clearedq = OPSCLEDQ()
/*--------------------------------------------------------*/
/* Issue the OS/390 reset command using the necessary     */
/* command response trapping keywords.                    */
/*--------------------------------------------------------*/
address Oper
"Command(E "jobname",SRVCLASS=BATSTWLM)",   
   "CMDWAIT(30) INTERVAL(0) STOPRESP(IEE304I)"
/*--------------------------------------------------------*/
/* Simply display back the captured command responses. The*/
/* collected command responses are destined for the       */
/* external data queue of the program and can be          */
/* extracted and processed via the PULL instruction.      */
/*--------------------------------------------------------*/
cmdoutlines = QUEUED()
do cmdoutlines
 pull cmdoutput
 say '**>Output='cmdoutput
end

The following keywords are used within the above sample:

Command(E "jobname",SRVCLASS=BATSTWLM)

Specifies the text of the command to be issued with variable substitution. In this case, the z/OS Reset command.

CMDWAIT(30)

Sets a CONDITIONAL wait time of 30 seconds. Meaning the total wait time for collecting output will be up to 30 seconds or until some stop trapping condition occurs. The stop trapping condition in the case of this z/OS reset command response will be the STOPRESP condition as noted below.

Interval(0) keyword

Disables the stop trapping mechanism that measures the delivery time between each collected command output line. This mechanism is being disabled since the command response in the case of the z/OS Reset command generates a specific message ID that can be used within the STOPRESP() keyword.

STOPRESP(IEE304I) keyword

Sets the stop trapping mechanism to be that of the command response message IEE304I. Meaning with CMDWAIT(30), the total time of command response collection will be up to 30 seconds or until the message IEE304I is collected as set using this STOPRESP keyword.

OPSLOG Browse OPS11Q - CA11 -- OPSVIEW -- 09:50:25 05JUN2006 COLS 001 05 CnslName Message ID ----+----1----+----2----+----3----+----4----+----5---- OPS11X01 MODIFY F PTX0099,DISPLAY NONE PXM0105 PXM0105 CA/XMANAGER MODIFY IN PROGRESS XMID=1154 NONE PXM0107 PXM0107 MODIFY TEXT = DISPLAY NONE PXM0111 PXM0111 XMANAGER DISPLAY WORKLOAD IN PROGRESS NONE PXM0112 PXM0112 XMANAGER CURRENTLY HAS NO WORKLOAD NONE PXM0109 PXM0109 XMANAGER MODIFY PROCESSING COMPLETE

Using this CA XMANAGER Display command as an example, note the CONSNAME field of the OPSLOG for the command responses not being sent back to console that issued the DISPLAY command. The following code illustrates issuing a command and collecting output not routed back to the issuing console using this CA XMANAGER command as an example.

/*--------------------------------------------------------*/  
/* Start out with a clean EDQ before issuing the command. */  
/*--------------------------------------------------------*/  
clearedq = OPSCLEDQ()                                         
/*--------------------------------------------------------*/  
/* Issue the XMANAGER command using the necessary         */  
/* command response trapping keywords.                    */  
/*--------------------------------------------------------*/  
address Oper
"Command(F PTX0099,DISPLAY) Cmdwait(30)",   
   "Capture(PXM) Interval(0) Stopmsg(PXM0109)"

/*--------------------------------------------------------*/  
/* Simply display back the captured command responses. The*/  
/* collected command responses are destined for the       */  
/* external data queue of the program and can be          */  
/* extracted and processed via the PULL instruction.      */  
/*--------------------------------------------------------*/  
cmdoutlines = QUEUED()
do cmdoutlines
 pull cmdoutput
 say '**>Output='cmdoutput
end

The following keywords are used within the above sample:

Command(F PTX0099,DISPLAY)

Specifies the text of the command to be issued.

Cmdwait(30)

Sets a CONDITIONAL wait time of 30 seconds. This sets the total wait time for collecting output to up to 30 seconds or until some stop trapping condition occurs. The stop trapping condition in the case of this XMANAGER command response will be the STOPMSG condition as noted below.

Capture(PXM)

By default, only console directed command responses are collected. This keyword causes the code to collect or capture these all nonconsole directed PXM messages.

Interval(0) keyword

Disables the stop trapping mechanism that measures the delivery time between each collected command output line. This mechanism is being disabled since the command response in the case of the XMANAGER Display command generates a specific message ID that can be used within the STOPMSG() keyword.

Stopmsg(PXM0109) keyword

Sets the stop trapping mechanism to be that of the command response message PXM0109. This means that with CMDWAIT(30), the total time of command response collection will be up to 30 seconds or until the message PXM0109 is collected as set through this STOPMSG keyword.

OPSLOG Browse OPS11Q - CA11 --- OPSVIEW --- 10:33:54 12JUN2006 COLS 001 065 OPSF CnslName ----+----1----+----2----+----3----+----4----+----5----+----6--+ 8000 OPS11X01 !PP1ADIS DB(DSNDB01) SPACENAM(DBD01) LIMIT(*) LOCKS 8008 OPS11X01 DSNT360I !PP1A *********************************** 2808 OPS11X01 DSNT361I !PP1A * DISPLAY DATABASE SUMMARY 2E08 OPS11X01 * GLOBAL LOCKS 8008 OPS11X01 DSNT360I !PP1A *********************************** 2808 OPS11X01 DSNT362I !PP1A DATABASE = DSNDB01 STATUS = RW 2E08 OPS11X01 DBD LENGTH = 8000 2808 OPS11X01 DSNT397I !PP1A 2C08 OPS11X01 NAME TYPE PART STATUS CONNID CORRID LOCKI 2C08 OPS11X01 -------- ---- ---- ------------------ -------- ------------ --- 2C08 OPS11X01 DBD01 TS RW H-S,P 2C08 OPS11X01 - MEMBER NAME PP4A 2C08 OPS11X01 DBD01 TS RW H-S,P 2C08 OPS11X01 - MEMBER NAME PP1A 2E08 OPS11X01 ******* DISPLAY OF DATABASE DSNDB01 ENDED ***************** 8008 OPS11X01 DSN9022I !PP1A DSNTDDIS 'DISPLAY DATABASE' NORMAL COMPLETION

Using this DB2 display command as an example, note the multiple MLWTO response and the unique DSN9022I message that indicates the response is complete. The following code illustrates issuing this type of command and collecting the output.

/*--------------------------------------------------------*/
/* Start out with a clean EDQ before issuing the command. */
/*--------------------------------------------------------*/
clearedq = OPSCLEDQ()                                       
/*--------------------------------------------------------*/
/* Issue the DB2 Thread display command                   */
/*--------------------------------------------------------*/
address Oper                                                
"C(!PP1ADIS DB(DSNDB01) SPACENAM(DBD01) LIMIT(*) LOCKS)",   
   "CMDWAIT(30) STOPRESP(DSN9022I) INTERVAL(0) STOPEND(NO)" 
/*--------------------------------------------------------*/
/* Simply display back the captured command responses. The*/
/* collected command responses are destined for the       */
/* external data queue of the program and can be          */
/* extracted and processed via the PULL instruction.      */
/*--------------------------------------------------------*/
cmdoutlines = QUEUED()
do cmdoutlines
 pull cmdoutput 
 say '**>Output='cmdoutput 
end 
Command(!PP1ADIS DB(DSNDB01) SPACENAM(DBD01) LIMIT(*) LOCKS)

Specifies the text of the command to be issued.

Cmdwait(30)

Sets a CONDITIONAL wait time of 30 seconds. Meaning the total wait time for collecting output will be up to 30 seconds or until some stop trapping condition occurs. The stop trapping condition in the case of this DB2 command response will be the STOPRESP condition.

Interval(0) keyword

Disables the stop trapping mechanism that measures the delivery time between each collected command output line. This mechanism is being disabled since the command response in the case of this DB2 Display command generates a specific message ID that can be used within the STOPRESP() keyword.

Stopresp(DSN9022I) keyword

Sets the stop trapping mechanism to be that of the command response message DSN9022I being sent back to the issuing console. This means that with CMDWAIT(30), the total time of command response collection will be up to 30 seconds or until the message DSN9022I is collected as set via this STOPRESP keyword.