Coding a CA7 REXX EXEC
search cancel

Coding a CA7 REXX EXEC

book

Article ID: 214962

calendar_today

Updated On:

Products

CA 7 Workload Automation

Issue/Introduction

I need to code a CA 7 REXX EXEC to issue CA-7 commands from the REXX EXEC rather than logging directly to a vtam terminal.  Is there  any way to pass the USERID/PASSWORD information?  How is the script coded?

Environment

WA CA 7 Edition

Resolution

The below SAMPLE CA 7 REXX EXEC is in the CA 7 CAL2CLS0(CA7REXX).

The CAL2LOAD is required to be accessible within your TSO LOGON PROC or within your CLIST library with the insertion of:  TASKLIB DATASET('your.ca7.CAL2LOAD'). 

This sample REXX requires a TSO execution and not batch.

The CA 7 REXX EXEC is coded as follows:

/* REXX */                                                         
/*-----------------------------------------------------------------------------------------*/ 
/*                                                                                                           */ 
/* Sample CA 7 REXX to invoke CA 7 CCI REXX Interface to             */ 
/* pass commands to CA 7 and receive back the output from those    */ 
/* commands.                                                                                        */ 
/*                                                                                                           */ 
/* Syntax :  CA7REXX cmda...;cmdb...;cmdc                                       */ 
/*                                                                                                           */ 
/* Environment Variables :                                                                    */ 
/*                                                                                                           */ 
/* ca7_node = CCI Node where CA 7 resides (default= local node)    */ 
/* ca7_ssct = identifies instance of CA 7 to communicate with.           */ 
/*            This is the suffix of the CCI receiver name of                        */ 
/*            the CA 7 instance.                                                                 */ 
/*                                                                                                          */ 
/*            The default is the CA 7 instance name (CA71-CA78).          */ 
/*            However, this value can be overridden using                        */ 
/*            either of the following keywords on the SVCNO                    */ 
/*            statement in the CA 7 init file:                                                */
/*                                                                                                           */
/*            XTMNAME=                                                                           */
/*            RNAME=                                                                                */
/*                                                                                                           */
/*            The CCI receiver name is announced at CA 7                       */
/*            startup with the following message:                                        */
/*                                                                                                            */
/*   CA-7.XTM0 - CCI RECEIVER IS: #NNNNNNNN CA-7 XTM xxxx  */
/*                                                                                                            */
/*            Use the receiver name suffix (xxxx) of the                              */
/*            desired instance as the value of this variable.                        */
/*                                                                                                            */
/* ca7_debug= 4 character string to pass to CA 7 CCI Interface:          */
/*            char 1 : Y = debug trace  (default=N)                                      */
/*            char 2 : command separator character (default=;)                  */
/*            char 3 : --- reserved for future use ---                                      */
/*            char 4 : --- reserved for future use ---                                      */
/*                                                                                                            */
/* NOTE: If you execute this REXX exec in a TSO/ISPF                       */
/*       environment, the default character separator (;) may                  */
/*       conflict with the TSO/ISPF command separator. If so,                 */
/*       override the default in the ca7_debug variable to a                     */
/*       different character, such as a pound sign (#).                              */
/*------------------------------------------------------------------------------------------*/
parse UPPER arg command                                           
rslt = cal2x2wa()                                                 
                                                                  
/* ca7_node = 'xxxxxxxx'    */                                       
/* ca7_ssct = 'CA71'           */                                       
/* ca7_debug = 'N;  '          */                                       

command='/LOGON MASTER;/DISPLAY,ST=CA7'            
/*command='/LOGON userid,passwd;/DISPLAY,ST=CA7' */                                                               
address CA7 command                                               
say 'rc =' rc                                                     
x = queued()                                                      
say 'queued() =' x                                                
do i = 1 to x                                                     
/*  Note that the parse function allows for mixed case                           */     
  parse pull line                                                 
  line2 = substr(line,2)    /* strip carriage control char                             */     
  say line2 
end         
            
return