Rexx to check if jobs have ran.



IBM's Command List programming language & Restructured Extended Executor

Re: Rexx to check if jobs have ran.

Postby Aoxx » Fri Apr 26, 2013 8:29 pm

 /* 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
Aoxx
 
Posts: 10
Joined: Sat Apr 20, 2013 6:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Rexx to check if jobs have ran.

Postby Ed Goodman » Mon Apr 29, 2013 8:52 pm

Next step...run this automatically every morning and have it email you the results!
Ed Goodman
 
Posts: 341
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times

Re: Rexx to check if jobs have ran.

Postby prabu_jP » Sun Dec 06, 2015 8:13 pm

Hi, Can you please share us the method to access CA7 from dev ?
prabu_jP
 
Posts: 1
Joined: Sun Dec 06, 2015 3:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Rexx to check if jobs have ran.

Postby Robert Sample » Sun Dec 06, 2015 8:56 pm

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.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Previous

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post