Sample ESP program to simulate job fail, job abend, and job run duration
search cancel

Sample ESP program to simulate job fail, job abend, and job run duration

book

Article ID: 402990

calendar_today

Updated On: 07-02-2025

Products

ESP Workload Automation

Issue/Introduction

You need to test different criteria on ESP test system, and hope to have a program to fail and run as requested in ESP.

Environment

Component: ESP Workload Automation
Release: ALL

Resolution

The JCL for sample program CYBCCPGM is provided in ESP prefix.CD7YJCL library:
//CYBCCPGM JOB 1,'Wait, return cc or abend',CLASS=A,MSGCLASS=A   
//*                                                              
//* REF: Sample CYBCCPGM                                         
//* DOC: Testing utility to wait and/or return cc or abend.      
//*                                                              
///*                                                              
//* Note: 1. Change the job statement as required.               
//*       2. Change <ESP> to the prefix of your ESP load library.
//*       3. Change PARM with the following parameters:          
//*          T=nnnn    number of seconds to wait before ending   
//*                    default = 0                               
//*          C=nnnn    completion code to terminate with         
//*                    default = 0     range = 0 - 4095          
//*          A=nnnn    user abend code to terminate with         
//*                    default = N/A   range = 0 - 4095          
//*          A=Snnn    system abend code to terminate with       
//*                    default = N/A   range = S000 - SFFF       
//*                                                              
//CYBCCPGM EXEC PGM=CYBCCPGM,PARM='T=5,C=16'                     
//STEPLIB  DD  DISP=SHR,DSN=<ESP>.CD7YLOAD                       
//SYSPRINT DD  SYSOUT=*                                          

Note:
- The JOB card should be adjusted;
- The JCL name may use %ESPAPJOB instead, which can be replaced with any name from ESP proc;
- The STEPLIB DSN should provide the proper ESP load library name;
- The parm may be changed to below:
//CYBCCPGM EXEC PGM=CYBCCPGM,PARM='T=%T,C=%C'    

And the variable values can be set in ESP Proc, like below:
JOB TESTA
  MEMBER   CYBCCPGM
  T=10 /* run 10 seconds*/
  C=8  /*return code 8*/
  RUN TODAY
ENDJOB
 
- May just add the following to existing test JCLs:
//CYBCCPGM EXEC PGM=CYBCCPGM,PARM='T=%T,C=%C'                     
//STEPLIB  DD  DISP=SHR,DSN=<ESP>.CD7YLOAD                       
//SYSPRINT DD  SYSOUT=*