How to clean up aged incomplete Applications on CA WA ESP Edition?
search cancel

How to clean up aged incomplete Applications on CA WA ESP Edition?

book

Article ID: 213007

calendar_today

Updated On:

Products

ESP Workload Automation

Issue/Introduction

On our ESP test system, there are many aged incomplete applications. Is there a way to automatically clean them?

Environment

Release : 11.4 & 12.0

Component : CA ESP WORKLOAD AUTOMATION

Resolution

And here is the rexx code, you can put it in a library member, and define a scheduled event which will INVOKE it:
Note: please do your own test first, and it's only an example, we officially don't support it.
"ESP LAP -" will show all incomplete applications, with generations in descending order. When you test it, you can use "ESP LAP applname" for one APPL applname.
- "GENTIME X TODAY LESS 3 WORKDAYS"  means it will check for 3 workdays before, you can change it;
- The command to complete the applications will be written to ESP auditlog, like:
ESP6620I APPLMGR: APPL TES5.49 ALL COMPLETED BY LUCY
---------------------
REXXON                                                               
X=TRAPOUT('LAP.')                                                    
"ESP LAP -"                                                          
X=TRAPOUT('OFF')                                                     
"GENTIME X TODAY LESS 3 WORKDAYS"                                    
DATE1 = CLANGVAR("%XYEAR%XMM%XDD")                                   
DO I = 1 TO LAP.0                                                    
  IF LAP.I = "" THEN                                                 
    ITERATE                                                          
  PARSE UPPER VAR LAP.I VERB THEREST                                 
  SELECT                                                             
    WHEN VERB = "APPL" THEN                                          
      CALL DOAPPL                                                    
    WHEN VERB = "CREATED" THEN                                       
      CALL DOCREATED                                                 
      OTHERWISE NOP                                                  
  END                                                                
END                                                                  
                                                                     
DOAPPL:                                                              
PARSE VAR THEREST APPL . APPLGEN .                                   
APPLICATION = STRIP(APPL)                                            
APPLGEN = STRIP(APPLGEN)                                             
RETURN                                                               
                                                                     
DOCREATED:                                                           
PARSE VAR THEREST . CREATE                                           
                                                                     
"GENTIME Z" CREATE                                                   
DATE2 = CLANGVAR("%ZYEAR%ZMM%ZDD")                                   
IF DATE2 > DATE1 THEN RETURN                                         
                                                                     
"ESP AJ ALL TERMINATE APPL(" || APPLICATION || "." || APPLGEN || ")",
      "REASON('FORCED BY USER')"