Need to prevent 2 jobs in one application from running when another application is running.
search cancel

Need to prevent 2 jobs in one application from running when another application is running.

book

Article ID: 220902

calendar_today

Updated On:

Products

ESP Workload Automation

Issue/Introduction

I have two applications. One application will run every 30 mins from 9am until 1600 hrs. When another daily application starts it should complete before 2 jobs in the cyclical application should run again. Need to stop the 2 jobs and start them again after daily application completes.

Environment

Release : 12.0

Component : CA ESP WORKLOAD AUTOMATION

Cause

Jobs cannot run during the execution of a daily batch process.

Resolution

First I created a Global Variable Table called TESTGVT

vtlist testgvt                                           
Global Variable Table TESTGVT                            
 Created at 10.52.07 on TUESDAY MAY 1ST, 2012 by BABRIA2 
  Last update at 14.46.49 on MONDAY AUGUST 2ND, 2021     
  Currently 1 variable, 0 triggers                       
  Table size 520, 152 bytes imbedded free space          
STATUS='AVAIL'                                           


Next in my application I get the variable during PROCESS phase of the application
and rtigger the application.

IF ESP_APPL_PROC=1 THEN         
VGET (STATUS) TABLE(TESTGVT)    
                                
JOB RCBJOBE.%ESPATIME           
 IF %STATUS = 'UNAVAIL' THEN DO 
 NORUN DAILY                    
  ELSE DO                       
 RUN DAILY                      
 ENDDO                          
   RELEASE RCBJOBA              
 SE '%STATUS' U(BABRI02)        
ENDJOB                          
                                
JOB RCBJOBA                     
 RUN DAILY                      
   RELEASE RCBJOBB              
ENDJOB                          
                                
JOB RCBJOBB                     
 RUN DAILY                      
   RELEASE RCBJOBC              
ENDJOB                          
                                
JOB RCBJOBC                     
 RUN DAILY                      
ENDJOB     

I also created an application with the TASK processes that will set the variable unavail and avail.
While job RCBJOBH is running the variable status is set to UNAVAIL.

APPL TESTRUNF HOLD                            
JCLLIB 'BABRI02.ESP.JCLLIB'                   
COPYJCL 'BABRI02.ESP.COPYJCL'                 
TEMPLIB 'BABRI02.ESP.TEMPLIB'                 
OPTIONS RESTARTSTEP                           
                                              
                                              
JOB SETVAR.UNAVAIL SELFCOMPLETING TASK PROCESS
 RUN DAILY                                    
 VGET (STATUS) TABLE(TESTGVT) CLANG           
 VSET STATUS UNAVAIL TABLE(TESTGVT)           
 RELEASE RCBJOBB                              
ENDJOB                                        
                                              
JOB RCBJOBH                                   
 RUN DAILY                                    
 RELEASE SETVAR.AVAIL                         
ENDJOB                                        
                                              
JOB SETVAR.AVAIL SELFCOMPLETING TASK PROCESS  
 RUN DAILY                                    
 VGET (STATUS) TABLE(TESTGVT) CLANG           
 VSET STATUS AVAIL TABLE(TESTGVT)             
ENDJOB   

Additional Information

Using Global Variable Table

https://techdocs.broadcom.com/us/en/ca-mainframe-software/automation/ca-workload-automation-esp-edition/12-0/using/use-global-variable-tables.html