I will attempt to explain my situation and include two sets of JCL one worked and the second failed.
First we are trying to run a batch job that will set variables for the day of the week 01-05 (Mon-Fri). we have tested the JCL by running it through for a single day and have been successful, however when we add for the remaining 4 days the variable being passed to the ACM1 step is incorrect.
DEFINE CLUSTER( -
NAME(SYSGM.TZOSPLX.JRNL.ACAT04) -
CYLINDERS(20 20) -
KEYS(65 0) -
RECORDSIZE(32744 32744) -
SPANNED -
) -
IDCAMS SYSTEM SERVICES TIME: 07:44:14
DATA( -
CONTROLINTERVALSIZE(4096) -
) -
INDEX( -
CONTROLINTERVALSIZE(2048) -
)
IGD01007I GMSTGD05 DATACLAS ALLOCATED DC=NONE
IGD01008I GMSTGS06 STORCLAS ALLOCATED SC=SYSOS
IGD01009I GMSTGM11 MGMTCLAS ALLOCATED MC=SYSTEM
IGD01010I GMSTGG05 STORGRP ALLOCATED SG=SYSOS
IDC0508I DATA ALLOCATION STATUS FOR VOLUME OSTS01 IS 0
IDC0509I INDEX ALLOCATION STATUS FOR VOLUME OSTS01 IS 0
IDC0512I NAME GENERATED-(D) SYSGM.TZOSPLX.JRNL.ACAT04.DATA
IDC0512I NAME GENERATED-(I) SYSGM.TZOSPLX.JRNL.ACAT04.INDEX
IDC0181I STORAGECLASS USED IS SYSOS
IDC0181I MANAGEMENTCLASS USED IS SYSTEM
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 0
CKM01001I IBM Tivoli Advanced Catalog Management for z/OS
Copyright IBM Corp. 1990 - 2018. All Rights Reserved.
Copyright Rocket Software, Inc. 2000 - 2018. All Rights Reserved.
CKM01012I BUILD(0206 REV=21 20140724) OS(z/OS 2.3 PSEQ=01020300)
DEFINE CLUSTER( -
NAME(SYSGM.TZOSPLX.JRNL.ACAT04) -
CYLINDERS(20 20) -
KEYS(65 0) -
RECORDSIZE(32744 32744) -
SPANNED -
) -
IDCAMS SYSTEM SERVICES TIME: 07:46:13
DATA( -
CONTROLINTERVALSIZE(4096) -
) -
INDEX( -
CONTROLINTERVALSIZE(2048) -
)
IGD01007I GMSTGD05 DATACLAS ALLOCATED DC=NONE
IGD01008I GMSTGS06 STORCLAS ALLOCATED SC=SYSOS
IGD01009I GMSTGM11 MGMTCLAS ALLOCATED MC=SYSTEM
IGD01010I GMSTGG05 STORGRP ALLOCATED SG=SYSOS
IDC0508I DATA ALLOCATION STATUS FOR VOLUME OSTS01 IS 0
IDC0509I INDEX ALLOCATION STATUS FOR VOLUME OSTS01 IS 0
IDC0512I NAME GENERATED-(D) SYSGM.TZOSPLX.JRNL.ACAT04.DATA
IDC0512I NAME GENERATED-(I) SYSGM.TZOSPLX.JRNL.ACAT04.INDEX
IDC0181I STORAGECLASS USED IS SYSOS
IDC0181I MANAGEMENTCLASS USED IS SYSTEM
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 0
CKM01001I IBM Tivoli Advanced Catalog Management for z/OS
Copyright IBM Corp. 1990 - 2018. All Rights Reserved.
Copyright Rocket Software, Inc. 2000 - 2018. All Rights Reserved.
CKM01012I BUILD(0206 REV=21 20140724) OS(z/OS 2.3 PSEQ=01020300)
As you can see the IDCAMS processing in the failed run is working, the issue is the correct variable is not being passed to the ACM1 step. When i add code for Day 5 the variable for day (05) is being passed not day (04).
Can someone help with this issue?
Thank you Mark
Coded for you - please do it yourself next time
We are using the set to verify the return code from INPUT01 which will identify the day of the week (01-05). and yes we have confirmed this works. We ran the code for a single day everyday to verify the day indicator is working. it fails when we add code for the next day.... day 04 only works, and when i add code for day 05 if it fails.
We are trying to setup a single job that can be run Mon-Fri and depending on the day of the week (01-05) will insert the correct last 2 digits in the output datasets.
Instead of debugging the whole mess of the statements not directly related to the encountered problem, - run the most simple test: only to verify that your RC is produced correctly, and all JCL IFs do work correctly as well.
So far, remove all real functionality from your JCL, leave only the code under question.
Believe me, it would save you much more time if you had deleted/restored all those functional code, compared to debugging this huge mess at once.
//*
//*=====================================================================
//* DETECT CURRENT DAY-OF-WEEK
//*=====================================================================
//DAYWEEK EXEC PGM=IKJEFT01,PARM='%DAYWEEK'
//*
//SYSEXEC DD DISP=(OLD,PASS),DSN=&&REXXLIB
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//*
//*=====================================================================
//* RUN THIS STEP ALWAYS
//*=====================================================================
// SET X=00
//SAY00 EXEC PGM=IKJEFT01,PARM='%SAYPARM &X'
//*
//SYSEXEC DD DISP=(OLD,PASS),DSN=&&REXXLIB
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//*
//*=====================================================================
//* RUN THIS STEP ON THURSDAYS
//*=====================================================================
// IF DAYWEEK.RC = 4 THEN
// SET X=04
//SAY04 EXEC PGM=IKJEFT01,PARM='%SAYPARM &X'
//*
//SYSEXEC DD DISP=(OLD,PASS),DSN=&&REXXLIB
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//*
// ENDIF DAYWEEK.RC = 4
//*=====================================================================
//* RUN THIS STEP ON FRIDAYS
//*=====================================================================
// IF DAYWEEK.RC = 5 THEN
// SET X=05
//SAY05 EXEC PGM=IKJEFT01,PARM='%SAYPARM &X'
//*
//SYSEXEC DD DISP=(OLD,PASS),DSN=&&REXXLIB
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//*
// ENDIF DAYWEEK.RC = 5
//*=====================================================================
//* RUN THIS STEP ALWAYS
//*=====================================================================
// SET X=99
//SAY99 EXEC PGM=IKJEFT01,PARM='%SAYPARM &X'
//*
//SYSEXEC DD DISP=(OLD,PASS),DSN=&&REXXLIB
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//*
//*=====================================================================
The result of this test looks as follows
Code:
SYSIN NEW MASTER
./ ADD NAME=DAYWEEK
/* REXX */
SAY "DAYWEEK STARTED"
TRACE I
DAY = DATE(B) // 7 +1
TRACE O
SAY "DAYWEEK ENDED"
EXIT DAY
IEB817I MEMBER NAME (DAYWEEK ) NOT FOUND IN NM DIRECTORY. STOWED WITH TTR.
SYSIN NEW MASTER
./ ADD NAME=SAYPARM
/* REXX */
ARG PARM
SAY "SAYPARM: PARM='"PARM"'"
EXIT 0
IEB817I MEMBER NAME (SAYPARM ) NOT FOUND IN NM DIRECTORY. STOWED WITH TTR.
IEB818I HIGHEST CONDITION CODE WAS 00000000
IEB819I END OF JOB IEBUPDTE.
ACF0C038 ACF2 LOGONID ATTRIBUTES HAVE REPLACED DEFAULT USER ATTRIBUTES
DAYWEEK STARTED
4 *-* DAY = DATE(B) // 7 +1
>L> "B"
>F> "737250"
>L> "7"
>O> "3"
>L> "1"
>O> "4"
5 *-* TRACE O
DAYWEEK ENDED
READY
END
ACF0C038 ACF2 LOGONID ATTRIBUTES HAVE REPLACED DEFAULT USER ATTRIBUTES
SAYPARM: PARM='00'
READY
END
ACF0C038 ACF2 LOGONID ATTRIBUTES HAVE REPLACED DEFAULT USER ATTRIBUTES
SAYPARM: PARM='04'
READY
END
ACF0C038 ACF2 LOGONID ATTRIBUTES HAVE REPLACED DEFAULT USER ATTRIBUTES
SAYPARM: PARM='99'
READY
END
Now you can run your own similar simplified test with EXPORT/SYMBOLS involved.
BTW, parameter SYMBOLS has the second operand, to specify a DD-name to trace JCL parameters substitution; sometimes it may help in debugging.
Note that the SET statement taken is the one immediately before the next step, or end of job.
I really suggest that you find another approach, my immediate choicce would be using ISPF skeleton services to build the input data.
I really suggest that you find another approach, my immediate choicce would be using ISPF skeleton services to build the input data.
This is the case for more than 50% of questions in this forum: the approach itself is initially wrong/messy/ineffective, or just stupid. Very tricky workarounds are needed to fix such problems.
In all those cases the logical approach needs to be changed from the very beginning, but any attempt to suggest the change hits the unbreakable brick wall:
"This is the requirement(??!!), and it cannot be changed".
Very often even moderators do support similar statements...
True, but sometime you do find yourself locked in to a less than optimal solution. I don't have a problem trying to help the OP by answering the stated question, while also taking the opertunity to point at other, in my mind better, solutions. As long as it helps the OP achieve his/hers objectives ...
nuf said.