Issuing Batch SPOC commands

You can use the Batch SPOC utility to submit IMS operator commands to an IMSplex. The Batch SPOC utility accepts any commands that are supported by the OM API.

The Batch SPOC utility uses:

  • Program parameters to define the IMSplex environment, including IMSplex name, routing and the wait time.
  • The SYSIN file as input for IMS operator commands.
  • The SYSPRINT file to show SPOC-like formatted command response.

You can invoke the Batch SPOC utility using standard JCL statements. The following example shows a simple invocation, but you can call the utility using other valid JCL.

Sample batch job with multiple commands

//SPOCJOB   JOB , 
//   MSGCLASS=H,NOTIFY=&SYSUID,USER=&SYSUID//*
//SPOC      EXEC PGM=CSLUSPOC,
//  PARM=('IMSPLEX=PLEX1,ROUTE=IMS3,WAIT=30,F=WRAP')  
//STEPLIB   DD DISP=SHR,DSN=IMS.SDFSRESL 
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD *
 QRY IMSPLEX SHOW(JOB,TYPE,   +
                  STATUS)

 QRY TRAN NAME(INV1*) SHOW(ALL) /* inventory appl */
/*EOF

The following program parameters define the IMSplex environment:

IMSPLEX
Required parameter that specifies the 1- to 5-character suffix of the IMSplex name.
F
Optional parameter that specifies the print format of the SPOC output. You can specify one of the following values:
WRAP
Wraps to the next line as needed. This is the default.
BYCOL
Lines of data are grouped together by the column.
BYRSC
Lines of data are grouped together by the resource.
ROUTE
Optional parameter that specifies the SYSIDs of IMSplex members that are to execute the command. If ROUTE is not specified, all members of the IMSplex will execute the command. If more than one member is specified, enclose the list in parenthesis and separate the names with commas. For example:
//  PARM=('IMSPLEX=PLEX1,WAIT=30,ROUTE=(IMSZ,IMSA)')

If ROUTE=* is specified, the command is routed to all registered command processing clients in the IMSplex. If ROUTE=% is specified, the command is routed to only one command processing client in the IMSplex that is registered for the command and that has MASTER capability. The Operations Manager chooses the command processing client.

WAIT
Optional parameter that specifies the wait time for individual commands. The wait value is in minutes and seconds (MMM:SS) or just seconds (SSSSS). OM will return a single response as soon as a response is received from all of the members of the IMSplex. If the interval expires, OM will return any responses from IMSplex members, plus an indication that some did not reply. The Batch SPOC utility will wait for each command to complete before issuing the next command. The default wait value is five minutes (5:00). The WAIT time applies to every command in the SYSIN file. The user can specify a wait time of zero seconds; in this case, the batch SPOC issues a command but does not wait for the response.

The SYSIN file is provided by the user and contains the commands that the user wants to execute. The commands are executed serially. When one command completes, the next command is executed until all records from the SYSIN file are processed. Continuation of the SYSIN control statements is specified by a plus sign (+) or a minus sign (-) as the last nonblank character of the line. A plus sign removes the leading spaces from the next line; a minus sign keeps leading spaces. Comments can be included within the SYSIN file and are specified with the following format:

/* this is a comment */

The SYSPRINT file will have the formatted command response. If more than one command is issued, the responses appear in the same order as the commands appear in the SYSIN file. The default record length is 133. The command response is formatted in a style specified by the user. The user may specify DCB information in the JCL or in the data set allocation to allow longer records in the SYSPRINT file.

System Display and Search Facility (SDSF) can be used to view batch job output.

Sample batch job output

The following example shows sample batch job output:

========================================================
Log for. . : QRY IMSPLEX SHOW(JOB,TYPE,STATUS)
               
IMSplex . . . . . : PLEX1
Routing . . . . . :
Start time. . . . : 2005.132 15:36:28.11
Stop time . . . . : 2005.132 15:36:29.17
Return code . . . : 00000000
Reason code . . . : 00000000
Command master. . : SYS3

IMSplex  MbrName    CC Member   JobName  Type  Status      
CSLPLEX1 OM1OM       0 USRT002  USRT002  AOP   ACTIVE      
CSLPLEX1 OM1OM       0 OM1OM    OM1      OM    READY,ACTIVE
CSLPLEX1 OM1OM       0 RM1RM    RM1      RM    READY,ACTIVE
CSLPLEX1 OM1OM       0 SCI1SC   SCI1     SCI   READY,ACTIVE
CSLPLEX1 OM1OM       0 IMS1     IMS1     IMS   READY,ACTIVE
CSLPLEX1 OM1OM       0 SYS1     SYS1     IMS   READY,ACTIVE
=======================================================

Sample batch job output with no response

If no wait time, WAIT=0, is specified, the command response is not available and therefore will not be printed. The SYSPRINT file will only have short summary information for each command:

========================================================
Log for. . : QRY IMSPLEX SHOW(JOB,TYPE,STATUS)
                
IMSplex . . . . . : PLEX1
Routing . . . . . :
Start time. . . . : 2006.075 15:36:28.11
========================================================