JCL IF to override //STEPLIB in a Proc



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

JCL IF to override //STEPLIB in a Proc

Postby 20sam13 » Sat Mar 02, 2013 1:28 am

I am trying to modify my JCL driver member to use one or the other //STEPLIB concatenations for a called Proc member. The JCL JOBCARD looks like:

//I5701A3Z JOB ('RP','00','MM'),'INST RPS PP TC01',
//             MSGCLASS=X,
//             MSGLEVEL=(1,1),
//             CLASS=2,
//**!          TYPRUN=SCAN,
//             NOTIFY=&SYSUID
//*
//          SET TEST=1     //1=SIT, 0=PROD


I then use this symbolic down below in the JCL, following the Proc member EXEC statement to switch between the //STEPLIB override concatenation.

Sadly... when I EJCK the JCL, I get the message (CAY6339E STATEMENT MISPLACED WITHIN AN IF-THEN-ELSE CLAUSE) on each of the DD statements for the procstep override statement.... My goal is to not have to //*comment each line and then uncomment each line depending on which platform of the COBOL module I am testing.

//IFPROD  IF (&TEST = 1) THEN
//STPR0040.STEPLIB DD DSN=PROD.OMP.BATCH.LOADLIB,DISP=SHR
//       DD  DSN=PROD.OM.BATCH.LOADLIB,DISP=SHR
//       DD  DSN=DB2.ALIAS.PROD.DSNLOAD,DISP=SHR
//      INCLUDE MEMBER=RPSLIBS
//IFPROD  ELSE
//*
//**** SIT STEPLIB
//*
//STPR0040.STEPLIB DD DSN=ISEN.S.SIT.BATCH.LOADLIB,DISP=SHR
//     DD DSN=ISEN.P.PROD.BATCH.LOADLIB,DISP=SHR
//     DD DSN=PROD.OMP.BATCH.LOADLIB,DISP=SHR
//     DD DSN=ISEN.S.SIT.OMP.BATCH.LOADLIB,DISP=SHR
//     DD DSN=ISEN.U.UAT.OMP.BATCH.LOADLIB,DISP=SHR
//     DD DSN=PROD.OMP.CICS.LOADLIB,DISP=SHR
//     DD DSN=TDB2D2DS.DB2.SDSNEXIT,DISP=SHR
//     DD DSN=TDB2D2DS.DB2.SDSNLOAD,DISP=SHR
//    INCLUDE MEMBER=RPSLIBS
//ENDPROD  ENDIF


Thanks everyone!
-Scott
20sam13
 
Posts: 17
Joined: Fri Feb 15, 2013 8:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL IF to override //STEPLIB in a Proc

Postby enrico-sorichetti » Sat Mar 02, 2013 1:53 am

review the jcl guide and the jcl reference manuals
for the format of the IF statement
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: JCL IF to override //STEPLIB in a Proc

Postby 20sam13 » Sat Mar 02, 2013 2:02 am

Enrico,

Could you please be a little more helpful than just pointing me to a manual?

I looked at the manual, ran thru the exampled (none of which meet my criteria), plus I tried to google for the error code EJCK is returning and nothing can be found.

Additional assistance would be much appreciated for an experienced MF developer/coder who was outsourced over 6 years ago and just now returned to being a QA/Tester and has honestly forgotten more than I ever used.
20sam13
 
Posts: 17
Joined: Fri Feb 15, 2013 8:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL IF to override //STEPLIB in a Proc

Postby Robert Sample » Sat Mar 02, 2013 2:06 am

JCL does not have control structures like normal programming languages. In particular, as Enrico alluded, you have attempted to use a keyword on the IF statement that is not supported. What you have coded will not work as it is not valid JCL -- period. From the manual:
17.1.4.5 Relational-Expression Keywords


The following keywords are the only keywords supported by IBM and recommended for use in relational-expressions. Any other keywords, even if accepted by the system, are not intended or supported keywords.


Keyword Use

RC
indicates a return code
ABEND
indicates an abend condition occurred
¬ABEND
indicates no abend condition occurred
ABENDCC
indicates a system or user completion code
RUN
indicates that the specified step started execution
¬RUN
indicates that the specified step did not start execution
Since &TEST is not RC nor ABEND nor any of the other 4 supported keywords, your IF statement is not considered valid JCL.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: JCL IF to override //STEPLIB in a Proc

Postby 20sam13 » Sat Mar 02, 2013 2:16 am

Thanks Robert,

I read thru that, but I could swear when I worked for the Marine Corps., I was able to code "conditional IFs" that used &symbolics to skip some steps and not others. It required some "work" to find the right pattern for the condition; but it would only work when comparing to a numeric, no alphas (i.e. &TEST="PROD"). Certainly, it would not have been a different JCL version I was using? Although, the same system also provided the Roscoe Editor w/ISPF and RPF (its version of a Rexx Exec/Clist) language.

Oh well... any other suggestions so I don't have to un/comment the stpr0040.steplib statements depending on what version I want to test?

Thanks Robert!
20sam13
 
Posts: 17
Joined: Fri Feb 15, 2013 8:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL IF to override //STEPLIB in a Proc

Postby Akatsukami » Sat Mar 02, 2013 2:35 am

20sam13 wrote:Certainly, it would not have been a different JCL version I was using?

Might could be. Or not. I don't know of anyone who has modified the base JCL interpreter, but someone might have; the JES2 JECL interpreter has been modified (Mellon Bank modifications). To the left, note this sentence that Mr. Sample quoted:
Any other keywords, even if accepted by the system, are not intended or supported keywords

IOW, you might find an interpreter that will do what you want, but there is no guarantee that it will continue to do so, and complaints to IBM will meet with the response, "Too bad, so sad".
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: JCL IF to override //STEPLIB in a Proc

Postby Robert Sample » Sat Mar 02, 2013 2:56 am

You may have been dealing with something from a job scheduler. CA-7, for example, has SCC (step condition code) processing as well as CA-DRIVR statements for conditionally including JCL statements from a library; neither of these will work outside a CA-7 scheduling environment.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: JCL IF to override //STEPLIB in a Proc

Postby 20sam13 » Sat Mar 02, 2013 2:59 am

Oh well... can't fault a person for trying...

So, here is another approach, will it work?

Top of JCL, like this one: SET PROD=//*
SET TEST=

Under the EXEC PROCNAME & all of its &Symbolics, can a person code:

&PROD..//STPR0040.STEPLIB DD DSN=PRODLIB,DISP=SHR
&PROD..// DD DSN=PRODLIB2,DISP=SHR
&PROD..// DD DSN=PRODLIB3,DISP=SHR

Submit JCL and end up having the override look like the following in the PROC MEMBER @ //STPR0040:

//*//STPR0040.STEPLIB DSN=PRODLIB,DISP=SHR
//*// DD DSN=PRODLIB2,DISP=SHR
//*// DD DSN=PRODLIB3,DISP=SHR

In essence, commenting out the STEPLIB for that PROCSTEP and allowing the other JCLLIB MEMBER //STPR0040.STEPLIB override into the step and use its concatenation?
20sam13
 
Posts: 17
Joined: Fri Feb 15, 2013 8:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL IF to override //STEPLIB in a Proc

Postby 20sam13 » Sat Mar 02, 2013 3:03 am

Hmmm... if I was using the CA7 scheduler abilities / functionality, I did not recognize it. As I was just coding these &Symbolics in the JCLLIB and not submitting using the CA7 scheduler...

*POOF* now I also recall another BIG piece of the puzzle from the Marine Corps., my proc was enclosed within the JCLLIB using the //PROC and //PEND. Which I may have coded the IF-THEN-ELSE-ENDIF directly down at the step I wanted to flip-flop between a test load concat and a prod load concat.

1 fewer brain cells left.... hope I remember where I parked my car today.
20sam13
 
Posts: 17
Joined: Fri Feb 15, 2013 8:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL IF to override //STEPLIB in a Proc

Postby enrico-sorichetti » Sat Mar 02, 2013 3:20 am

Could you please be a little more helpful than just pointing me to a manual?

pretty stupid remark :geek:

anyway here is a hint
obviously s1 and s2 are proclib members containing the proper steplib concatenation
output statements 6 an 10 show that the steplib was changed according to the include directive

the job
 ****** ***************************** Top of Data ******************************
 000001 //ENRICO1  JOB (ACCT#),'ZZ1',NOTIFY=ENRICO,
 000002 //             CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1)
 000003 //* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 000004 // JCLLIB      ORDER=(ENRICO.TEST.PROCLIB)
 000005 //* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 000006 //*
 000007 // SET ZSTEP=S1
 000008 //GO      EXEC PGM=S1X14
 000009 // INCLUDE MEMBER=&ZSTEP
 000010 // SET ZSTEP=S2
 000011 //GO      EXEC PGM=S2X14
 000012 // INCLUDE MEMBER=&ZSTEP
 ****** **************************** Bottom of Data ****************************


the result

1                         J E S 2  J O B  L O G  --  S Y S T E M  S Y S 1  --  N O D E  N 1             
0
 23.46.56 JOB01761 ---- FRIDAY,    01 MAR 2013 ----
 23.46.56 JOB01761  IRR010I  USERID ENRICO   IS ASSIGNED TO THIS JOB.
 23.46.56 JOB01761  ICH70001I ENRICO   LAST ACCESS AT 23:37:59 ON FRIDAY, MARCH 1, 2013
 23.46.56 JOB01761  $HASP373 ENRICO1  STARTED - INIT 1    - CLASS A - SYS SYS1
 23.46.56 JOB01761  IEF403I ENRICO1 - STARTED - TIME=23.46.56
 23.46.56 JOB01761  HTRT01I                                         CPU (Total)  Elapsed      CPU (TCB)    CPU (SRB)     Service
 23.46.56 JOB01761  HTRT02I Jobname  Stepname ProcStep    RC    I/O hh:mm:ss.th  hh:mm:ss.th  hh:mm:ss.th  hh:mm:ss.th     Units
 23.46.56 JOB01761  HTRT03I ENRICO1  GO                   00     11       00.01        00.08        00.01        00.00       477
 23.46.57 JOB01761  HTRT03I ENRICO1  GO                   00     11       00.02        00.10        00.02        00.00       844
 23.46.57 JOB01761  IEF404I ENRICO1 - ENDED - TIME=23.46.57
 23.46.57 JOB01761  HTRT06I
 23.46.57 JOB01761  HTRT04I ENRICO1  Job Service Totals          22       00.03        00.21        00.03        00.00      1321
 23.46.57 JOB01761  $HASP395 ENRICO1  ENDED
0------ JES2 JOB STATISTICS ------                                                                                                   
-  01 MAR 2013 JOB EXECUTION DATE                                                                                                   
-           12 CARDS READ                                                                                                           
-          108 SYSOUT PRINT RECORDS                                                                                                 
-            0 SYSOUT PUNCH RECORDS                                                                                                 
-            8 SYSOUT SPOOL KBYTES                                                                                                   
-         0.00 MINUTES EXECUTION TIME                                                                                               
 !! END OF JES SPOOL FILE !!
        1 //ENRICO1  JOB (ACCT#),'ZZ1',NOTIFY=ENRICO,                             JOB01761
          //             CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1)                               
          //* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -         
        2 // JCLLIB      ORDER=(ENRICO.TEST.PROCLIB)                                     
          //* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -         
          //*                                                                             
        3 // SET ZSTEP=S1                                                                 
        4 //GO      EXEC PGM=S1X14                                                       
        5 // INCLUDE MEMBER=&ZSTEP                                                       
          IEFC653I SUBSTITUTION JCL - MEMBER=S1
        6 XXSTEPLIB DD DISP=SHR,DSN=ENRICO.TEST.LOAD                                     
        7 // SET ZSTEP=S2                                                                 
        8 //GO      EXEC PGM=S2X14                                                       
        9 // INCLUDE MEMBER=&ZSTEP                                                       
          IEFC653I SUBSTITUTION JCL - MEMBER=S2
       10 XXSTEPLIB DD DISP=SHR,DSN=ENRICO.TEST.PLILOAD                                   
 !! END OF JES SPOOL FILE !!
  STMT NO. MESSAGE
         5 IEFC002I INCLUDE GROUP S1 WAS EXPANDED USING PRIVATE LIBRARY ENRICO.TEST.PROCLIB
         9 IEFC002I INCLUDE GROUP S2 WAS EXPANDED USING PRIVATE LIBRARY ENRICO.TEST.PROCLIB
 ICH70001I ENRICO   LAST ACCESS AT 23:37:59 ON FRIDAY, MARCH 1, 2013
 IEF236I ALLOC. FOR ENRICO1 GO
 IEF237I 0AB4 ALLOCATED TO STEPLIB
 IEF142I ENRICO1 GO - STEP WAS EXECUTED - COND CODE 0000
 IEF285I   ENRICO.TEST.LOAD                             KEPT         
 IEF285I   VOL SER NOS= STOR04.                           
 HTRT05I ------------------------------------------------------------------------
         - Step Termination Statistics                                          -
         -                                                                      -
         - Program Name       S1X14                             hh:mm:ss.th     -
         - Step Name          GO                Elapsed Time          00.08     -
         - Procedure Step                       TCB CPU Time          00.01     -
         - Return Code              00          SRB CPU Time          00.00     -
         - Total I/O                11          Total CPU Time        00.01     -
         - Service Units           477                                          -
         -                                                                      -
         - Region Size           1024K          Pages Paged               0     -
         - Data/Hiperspace          0M          Pages Swapped             0     -
         - ASID Swaps                0          Pages Stolen              0     -
         -                                      VIO (In and Out)          0     -
         -                                                                      -
         - --------Below 16Meg--------          --------Above 16Meg--------     -
         - Private Area          9192K          Private Area       1801216K     -
         - Max Allocated            8K          Max Allocated            0K     -
         - LSQA And SWA           248K          LSQA And SWA         10716K     -
         -                                                                      -
         - DDName    Unit    Blksize       I/O                                  -
         - STEPLIB   0AB4      27998         1                                  -
         - *System*                         10                                  -
         -                                                                      -
         ------------------------------------------------------------------------
 IEF373I STEP/GO      /START 2013060.2346
 IEF374I STEP/GO      /STOP  2013060.2346 CPU    0MIN 00.01SEC SRB    0MIN 00.00SEC VIRT     8K SYS   248K EXT       0K SYS   10716K
 IEF236I ALLOC. FOR ENRICO1 GO
 IEF237I 0AB4 ALLOCATED TO STEPLIB
 IEF142I ENRICO1 GO - STEP WAS EXECUTED - COND CODE 0000
 IEF285I   ENRICO.TEST.PLILOAD                          KEPT         
 IEF285I   VOL SER NOS= STOR04.                           
 HTRT05I ------------------------------------------------------------------------
         - Step Termination Statistics                                          -
         -                                                                      -
         - Program Name       S2X14                             hh:mm:ss.th     -
         - Step Name          GO                Elapsed Time          00.10     -
         - Procedure Step                       TCB CPU Time          00.02     -
         - Return Code              00          SRB CPU Time          00.00     -
         - Total I/O                11          Total CPU Time        00.02     -
         - Service Units           844                                          -
         -                                                                      -
         - Region Size           1024K          Pages Paged               0     -
         - Data/Hiperspace          0M          Pages Swapped             0     -
         - ASID Swaps                0          Pages Stolen              0     -
         -                                      VIO (In and Out)          0     -
         -                                                                      -
         - --------Below 16Meg--------          --------Above 16Meg--------     -
         - Private Area          9192K          Private Area       1801216K     -
         - Max Allocated            8K          Max Allocated            0K     -
         - LSQA And SWA           248K          LSQA And SWA         10852K     -
         -                                                                      -
         - DDName    Unit    Blksize       I/O                                  -
         - STEPLIB   0AB4      27998         4                                  -
         - *System*                          7                                  -
         -                                                                      -
         ------------------------------------------------------------------------
 IEF373I STEP/GO      /START 2013060.2346
 IEF374I STEP/GO      /STOP  2013060.2346 CPU    0MIN 00.02SEC SRB    0MIN 00.00SEC VIRT     8K SYS   248K EXT       0K SYS   10852K
 IEF375I  JOB/ENRICO1 /START 2013060.2346
 IEF376I  JOB/ENRICO1 /STOP  2013060.2346 CPU    0MIN 00.03SEC SRB    0MIN 00.00SEC
 !! END OF JES SPOOL FILE !!

cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post