Troubleshooting
Problem
If a dataset defined an ETT DATASET TRIGGER is allocated DISP=(NEW,CATLG,DELETE), and the jobstep creating the dataset fails, the TWSz application should not be added into the CURRENT PLAN. (CONDITIONAL DEPENDENCIES)
Resolving The Problem
TWSz dataset triggering is based on monitoring the SMF14/15 records for DATASET CLOSE. These records are created immediately when the dataset closes, independently of STEP END when the third (abnormal termination) keyword of the DISP= parameter is processed.
Although there is no way to prevent DATASET TRIGGERING from adding the application into the Current Plan when the trigger dataset is deleted at STEP END of the creating jobstep, the following technique will avoid incorrect processing. This is done using JOBSTEP CONDITIONAL DEPENDENCES, and all processing is within TWSz. No modification is required of any processes outside of TWSZ -- including the job or started task which creates the triggering dataset.
To accomplish this, define the ETT-added application as follows:
1. The first operation is a BATCH TSO job to check whether the dataset exists:
//FILETEST JOB (),'OPCTEST',CLASS=A,MSGCLASS=X,
// MSGLEVEL=(1,1),NOTIFY=ATKNSN2
//*
//*%OPC SCAN
//FILECHEK EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
ALLOCATE FI(EXISTS) +
DSNAME('&OETEVNM',+
) SHR
FREE FI(EXISTS)
/*
Note1 - you can check for multiple datasets in the same job if you want to
Note2 - The TWSz JCL VARIABLE OETEVNM is the name of the ETT triggering event and is available to ALL operations in an ETT-added application.
2. Set up the application using conditional dependencies to complete the entire occurrence automatically if the test job gets an RC12, or to proceed to process the data if the test job gets an RC00. That would look something like this:
Application: DST#CND#DEP#DEMO Conditional dependencies demo
Row Oper Duration Job name Internal preds Morepreds No.of
cmd ws no. HH.MM.SS -IntExt - Conds
'''' CPUA 005 00.00.01 FILETEST 0 0 0
'''' CPUA 010 00.00.01 JOBB 0 0 1
'''' CPUA 015 00.00.01 JOBC 010 0 0 1
'''' CPUA 020 00.00.01 JOBD 015 0 0 1
'''' CPUA 025 00.00.01 JOBE 020 0 0 1
'''' LAST 255 00.00.01 DUMMY 005 010 015 020 025 0 0 0
**************************** Bottom of data **************************
Jobs JOBB through JOBE process the data in the incoming file, and run in sequence after the file is verified by job FILETEST. All operations in an application must be connected by "real" dependencies (conditionals don’t count), and there also must be an available path within the application to follow if the conditional dependencies do not resolve. To satisfy these requirements, we make all operations predecessors of the dummy operation on non-reporting workstation LAST.
Jobs JOBB-JOBE all have identical CONDITIONAL DEPENDENCIES as shown below:
----------------------- CONDITION DEFINITIONS -------- Row 1 to 2 of 2
Application : DST#CND#DEP#DEMO Conditional dependencies demo
Operation : CPUA 010 JOBB Condition : 001
Rule : All condition dependencies in this list must be true
Oper Application Id Jobname StepName ProcStep Co Co St Ret.Code
ws. no. (for ext Ad only) Ty OP Val Val1 Val2
CPUA 005 FILETEST FILECHEK RC NE 0012
CPUA 005 FILETEST ST EQ C
**************************** Bottom of data ***************************
Lastly, set the HIGHRC for the FILETEST job to 0 and create a NOERROR entry to set the job to "C" status if it ends with an RC12.
When this is all in place:
1. If step FILECHEK in JOB FILETEST gets an RC00, both conditions are true, the conditional dependency is resolved, and jobs B, C, D, and E run in sequence.
2. If FILECHEK gets an RC12, it is set to "C" by NOERROR, but the RC12 is captured, making the first condition FALSE, and jobs B, C, D, and E are EXCLUDED… allowing the application to be set to COMPLETE.
3. If FILECHEK gets any RC other than 0 or 12, it is set to ERROR and both conditions remain UNDEFINED (unevaluated). This allows you to correct the problem and rerun FILETEST…. until it gets either an RC00 or an RC12.
Was this topic helpful?
Document Information
Modified date:
13 September 2019
UID
swg21232315