Setting up the REXX environment in a CSL

By issuing the ADDRESS command, you can call the program CSLULXSB to set up the REXX environment. This program establishes the REXX subcommand environment for the REXX SPOC API.

Read syntax diagramSkip visual syntax diagramADDRESSLINK 'CSLULXSBSEROPT= ENQSEROPT= NONE'
Note: Other forms of the ADDRESS command might not work in the Tivoli® NetView for z/OS® environment.

Keyword of the LINK statement

The LINK statement supports the following keyword:
SEROPT=ENQ|NONE
Specifies whether a serialization enqueue (ENQ) needs to be obtained to serialize parallel instances of the IMS REXX SPOC command environment that are started under the same address space. If this keyword is specified in the LINK statement, it overrides the default or the system level specification, which is specified in the CSLULXD0 user exit. If this keyword is not specified, the default or system level specification in the CSLULXD0 user exit is used.
Important: Each REXX SPOC instance that is in the same address space must use the same serialization option. When serialization is required,SEROPT=ENQ (either in the LINK CSLULXSB command, or in the CSLULXD0 exit) must be specified by every REXX SPOC instance in the same address space.
You can specify one of the following values for this keyword:
ENQ
SEROPT=ENQ indicates that multiple IMS REXX SPOC instances might be started under the same address space and a serialization ENQ is required to serialize the subcommand environment.
The ENQ option specifies the STEP option so that the scope is limited to the address space. The ENQ resource qname is CSLUSPCA, and the rname is CSLULXTP||jobid. You can use the D GRS,RES=(CSLUSPCA,*) command to display serialization information.
When you set up an IMS REXX subcommand environment, a step level ENQ for resource CSLULXTP||jobid is obtained. This ENQ will not be released until the IMS REXX END subcommand is processed.
Important: Ensure that either the REXX SPOC application always issues an IMS REXX END subcommand to dequeue instances, or that the started task ends in a timely manner, if the IMS REXX subcommand environment is started to prevent subsequent instances in the same address space from waiting on the ENQ.
NONE
SEROPT=NONE indicates that multiple IMS REXX SPOC instances are not started under the same address space and a ENQ serialization is not required.

The following examples show how to enable or disable the serialization by specifying the SEROPT parameter:

Enabling serialization for parallel REXX applications with SEROPT=ENQ

/*----------------------------------------------------------------- 
| When multiple IMS Rexx SPOC instances could be started           |
| under the same address space, then an ENQ is needed to           |
| serialize the subcommand environment.                            |
| The Rexx SPOC program requests this by specifying                |
| SEROPT=ENQ on the Address LINK 'CSLULXSB' statement.             | 
------------------------------------------------------------------*/ 
Address LINK 'CSLULXSB SEROPT=ENQ'
if rc = 0 then
  do
    Address IMSSPOC                                                  

    "IMS  IPLX4"                                                     
    "ROUTE IMS1,IMSB"                                                
                                                                     
    "WAIT  5:00"                                                     
                                                                     
    "CART DISTRAN"                                                   
    "/DIS TRAN PART"                                                 

     spoc_rc = cslulgts('DISINFO.','DISTRAN',"59")                     
     do z1 = 1 to  DISINFO.0                                           
       /* display each line of XML information */                      
       Say disinfo.z1                                                  
     end                                                               
     "END"                                                             
  End

Disabling serialization for parallel REXX applications with SEROPT=NONE

/*----------------------------------------------------------------- 
| When only a single IMS Rexx SPOC instance is started             |
| under an address space, then an ENQ is not needed to             |
| serialize the subcommand environment.                            |
| The Rexx SPOC program requests this by specifying                |
| SEROPT=NONE on the Address LINK 'CSLULXSB' statement.            |
| This is the default (SEROPT can be omitted).                     | 
------------------------------------------------------------------*/ 
Address LINK 'CSLULXSB SEROPT=NONE'
if rc = 0 then
  do
    Address IMSSPOC                                                  

    "IMS  IPLX4"                                                     
    "ROUTE IMS1,IMSB"                                                
                                                                     
    "WAIT  5:00"                                                     
                                                                     
    "CART DISTRAN"                                                   
    "/DIS TRAN PART"                                                 

     spoc_rc = cslulgts('DISINFO.','DISTRAN',"59")                     
     do z1 = 1 to  DISINFO.0                                           
       /* display each line of XML information */                      
       Say disinfo.z1                                                  
     end                                                               
     "END"                                                             
  End