Page 3 of 3

Re: Rexx to check if jobs have ran.

PostPosted: Fri Apr 26, 2013 8:29 pm
by Aoxx
 /* REXX */                                                                   
/* THIS UTILITY WILL ACCEPT ANY VALID CA7 COMMAND, AND EXECUTE THAT COMMAND */
/* ON THE JES SPECIFIED.  EX.  TSO CA7CMD 1 LRLOG,JOB=CJOB1234 */             
trace e                                                                       
LOGID = USERID()                                                             
PARSE UPPER ARG CHK10.1                                                       
RSLT = CAL2X2WA()                                                             
                                                                             
IF CHK10.1 = ' ' THEN                                                         
   do                                                                         
   "alloc fi(CHK10) da('TS.REXXCHECK.CHK10') shr"  /* allocate file */         
   if rc > 0 then                                                             
     do                                                                       
       say 'Error opening input file, return code = ' rc                     
       exit                                                                   
     end                                                                     
   "EXECIO * DISKR CHK10 (STEM CHK10. FINIS"                                 
   "free fi(CHK10)"                /* free the file */         
   end                                                 
ELSE CHK10.0 = 1                                       
                                                       
                                                       
DO J = 1 TO CHK10.0                                     
   PARSE VALUE CHK10.J WITH CMDNODE CA7CMD             
   IF CMDNODE = 1 THEN CA7_NODE = 'FIRB'               
   ELSE IF CMDNODE = 2 THEN CA7_NODE = 'SECB'           
   ELSE IF CMDNODE = 3 THEN CA7_NODE = 'THRA'           
     CALL RUNCMD                                       
END                                                     
EXIT                                                   
                                                       
                                                       
                                                       
 RUNCMD:                                               
                                                       
SAY 'EXECUTING YOUR CA7 COMMAND..........'             
                                                       
LJOBCMD = '/LOGON '||LOGID||',xxxx;'||CA7CMD||';/LOGOFF'
ADDRESS CA7 LJOBCMD                                     
                 
DROP LINEIN.     
X = QUEUED()     
 DO A = 1 TO X   
    PULL LINEIN.A
    LINEIN.0 = A
    SAY LINEIN.A
 END             
 RETURN


My next goal with this segment is to figure out how to get it to not have to logoff and back on after each job it checks in order to save some junk space on the display

Re: Rexx to check if jobs have ran.

PostPosted: Mon Apr 29, 2013 8:52 pm
by Ed Goodman
Next step...run this automatically every morning and have it email you the results!

Re: Rexx to check if jobs have ran.

PostPosted: Sun Dec 06, 2015 8:13 pm
by prabu_jP
Hi, Can you please share us the method to access CA7 from dev ?

Re: Rexx to check if jobs have ran.

PostPosted: Sun Dec 06, 2015 8:56 pm
by Robert Sample
Contact your site support group. They know your environment and whether or not what you want to do is possible. For example, if dev is in a different LPAR from the one CA-7 is running in, you're not going to be connecting to CA-7 from dev. For another example, your support group will know what security has been installed on CA-7 and whether or not a dev REXX program will be allowed to execute against the CA-7 database.