Re: Question if COND code / IF THEN struct

2009-06-30 Thread Paul Ip
It works! Thanks for your example...

It seems to me that "IF (STEP0001.PRCSTEP3.RC = 0) & 
(STEP0002.PRCSTEP3.RC = 0) THEN" before STEP0003 is simply the same 
as "IF STEP0002.PRCSTEP3.RC = 0 THEN"

So in case I need to execute the PROC1 many times, say "STEP EXEC 
PROC1", all I need to do is to use "IF STEP-1.PRCSTEP3.RC = 0 THEN"

Paul

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: Question if COND code / IF THEN struct

2009-06-29 Thread Schwarz, Barry A
For each invocation of PROC1, the following will execute the next step
only if the previous steps are acceptable.

PROC1   PROC
PRCSTEP1EXEC ...
...
IF PRCSTEP1.RC = 0 THEN
PRCSTEP2  EXEC ...
...
IF PRCSTEP2.RC <= 16 THEN
PRSTEP3 EXEC ...
...
ENDIF STEP3
ENDIF STEP2

If you want a subsequent invocation of PROC1 to be dependent on the
processing of previous invocations, then you need something like

STEP0001EXECPROC1,FILE=A1
IF STEP0001.PRCSTEP3.RC = 0 THEN
STEP0002EXEC PROC1,FILE=A2
IF (STEP0001.PRCSTEP3.RC = 0) &
   (STEP0002.PRCSTEP3.RC = 0) THEN
STEP0003EXECPROC1,FILE=A3
...

-Original Message-
From: Paul Ip 
Sent: Saturday, June 27, 2009 11:57 PM
To: IBM-MAIN@bama.ua.edu
Subject: Question if COND code / IF THEN struct

Hi all,

If I have an JCL with an instream PROC:

PROC1  PROC
PRCSTEP1 EXEC PGM=XXX
INPUT   DD DSN=&FILE
PRCSTEP2 EXEC PGM=YYY
INPUT   DD DSN=&FILE
PRCSTEP3 EXEC PGM=ZZZ
INPUT   DD DSN=&FILE
  PEND
STEP0001 EXEC PROC1,FILE=A1
STEP0002 EXEC PROC1,FILE=A2
STEP0003 EXEC PROC1,FILE=A3
...
STEP000N EXEC PROC1,FILE=AN

PRCSTEP1 will have an RC=0
PRCSTEP2 will have an RC=16 (but not a failure case)
PRCSTEP3 will have an RC=0

My question is, how can I code the COND parameter or IF the ELSE on all 
PRCSTEPs so that all the PRCSTEPs can be executed with previous 
PROCSTEPs RC=0 *except* PRCSTEP2 can have a RC=0 to 16.
I have tried using "RC.PRCSTEP2 = 16" for IF then ELSE before PRCSTEP1 
(since STEP0002.PRCSTEP1 will be executed if RC<=16 of 
STEP0001.PRCSTEP2). However it failed with JCL error since invaild
referback.

Please give me a hint, thanks!

Paul

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: Question if COND code / IF THEN struct

2009-06-29 Thread Scott Barry
On Mon, 29 Jun 2009 11:01:58 -0500, Paul Ip  wrote:

>Hi,
>
>Thanks for your information!
>
>I should rephrase my question, I know how to use JCLLIB / INCLUDE statement
>within a JCL but I don't get your idea about "externalize your individual PROC
>rqmt conditions and enclose the IF/THEN/ENDIF statements as needed for the
>first and subsequent PROC executions."
>
>I've tried your sample before, using the "SET RUNCHECK=" symbolic and then
>set the value to 'RUNCHECK' before STEP0002 (and even before STEP0003 to
>STEP000N) to ensure condition is checked correctly before PRCSTEP1 is
>executed. (of course, it failed with JCLERR with invalid reference of .RC as
>you've mentioned)
>
>However, I don't know the concept of your example given can be archived (no
>JCLERR) by using INCLUDE statement... are you talking about I should use
>INCLUDE statement to contain EXEC statement + COND code checking??
>
>Paul


The point about using INCLUDE is to remove as much duplication of JCL
statements as you can, locating them into INCLUDE members.  Then using the
INCLUDE feature, you will need only code your IF/THEN/ENDIF statements to
cover the first and subsequent executions of individual JCL execution steps,
given what's known about the JCL IF/RC/RUN usage deficiency.

Scott Barry
SBBWorks, Inc.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: Question if COND code / IF THEN struct

2009-06-29 Thread Paul Ip
Hi,

Thanks for your information! 

I should rephrase my question, I know how to use JCLLIB / INCLUDE statement 
within a JCL but I don't get your idea about "externalize your individual PROC 
rqmt conditions and enclose the IF/THEN/ENDIF statements as needed for the 
first and subsequent PROC executions."

I've tried your sample before, using the "SET RUNCHECK=" symbolic and then 
set the value to 'RUNCHECK' before STEP0002 (and even before STEP0003 to 
STEP000N) to ensure condition is checked correctly before PRCSTEP1 is 
executed. (of course, it failed with JCLERR with invalid reference of .RC as 
you've mentioned)

However, I don't know the concept of your example given can be archived (no 
JCLERR) by using INCLUDE statement... are you talking about I should use 
INCLUDE statement to contain EXEC statement + COND code checking??

Paul

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: Question if COND code / IF THEN struct

2009-06-29 Thread Barkow, Eileen
try this:

//PROC1  PROC
//PRCSTEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD  DUMMY
//*
//PRCSTEP2 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD  DUMMY
//*
//PRCSTEP3 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD  DUMMY
//*
// PEND
//STEP0001 EXEC PROC1
//PRCSTEP1.SYSIN DD *
 SET MAXCC=0
/*
// IF (STEP0001.PRCSTEP1.RC EQ 0) THEN
//STEP0002 EXEC PROC1
//PRCSTEP2.SYSIN DD *
 SET MAXCC=16
/*
// ENDIF
// IF (STEP0001.PRCSTEP1.RC EQ  0 AND STEP0002.PRCSTEP2.RC EQ 0)
// OR (STEP0001.PRCSTEP1.RC EQ 0 AND STEP0002.PRCSTEP2.RC EQ 16)
//   THEN
//STEP0003 EXEC PROC1,COND=(0,NE,STEP0002.PRCSTEP2)
// ENDIF
//
with step0002 cc = 16
09.51.29 JOB07838  -
--TIMINGS (MI
09.51.29 JOB07838  -STEPNAME PROCSTEPRC   EXCP   CONNTCBSRB
CLOCK
09.51.29 JOB07838  -STEP0001 PRCSTEP100 15  2.00.00
.0
09.51.29 JOB07838  -STEP0001 PRCSTEP200 13  2.00.00
.0
09.51.29 JOB07838  -STEP0001 PRCSTEP300 13  2.00.00
.0
09.51.29 JOB07838  -STEP0002 PRCSTEP100 13  2.00.00
.0
09.51.29 JOB07838  -STEP0002 PRCSTEP216 16  3.00.00
.0
09.51.29 JOB07838  -STEP0002 PRCSTEP300 16  2.00.00
.0
09.51.29 JOB07838  -STEP0003 PRCSTEP1 FLUSH  0  0.00.00
.0
09.51.29 JOB07838  -STEP0003 PRCSTEP2 FLUSH  0  0.00.00
.0

with step0002 cc =0
 -STEPNAME PROCSTEPRC   EXCP   CONNTCBSRB  CLOCK
 -STEP0001 PRCSTEP100 15  2.00.00 .0
 -STEP0001 PRCSTEP200 13  2.00.00 .0
 -STEP0001 PRCSTEP300 13  2.00.00 .0
 -STEP0002 PRCSTEP100 13  2.00.00 .0
 -STEP0002 PRCSTEP200 15  2.00.00 .0
 -STEP0002 PRCSTEP300 16  2.00.00 .0
 -STEP0003 PRCSTEP100 13  2.00.00 .0
 -STEP0003 PRCSTEP200 13  2.00.00 .0

-Original Message-
From: IBM Mainframe Discussion List [mailto:ibm-m...@bama.ua.edu] On
Behalf Of Scott Barry
Sent: Sunday, June 28, 2009 11:44 AM
To: IBM-MAIN@bama.ua.edu
Subject: Re: Question if COND code / IF THEN struct

On Sun, 28 Jun 2009 01:56:59 -0500, Paul Ip  wrote:

>Hi all,
>
>If I have an JCL with an instream PROC:
>
>PROC1  PROC
>PRCSTEP1 EXEC PGM=XXX
>INPUT   DD DSN=&FILE
>PRCSTEP2 EXEC PGM=YYY
>INPUT   DD DSN=&FILE
>PRCSTEP3 EXEC PGM=ZZZ
>INPUT   DD DSN=&FILE
>  PEND
>STEP0001 EXEC PROC1,FILE=A1
>STEP0002 EXEC PROC1,FILE=A2
>STEP0003 EXEC PROC1,FILE=A3
>...
>STEP000N EXEC PROC1,FILE=AN
>
>PRCSTEP1 will have an RC=0
>PRCSTEP2 will have an RC=16 (but not a failure case)
>PRCSTEP3 will have an RC=0
>
>My question is, how can I code the COND parameter or IF the ELSE on all
>PRCSTEPs so that all the PRCSTEPs can be executed with previous
>PROCSTEPs RC=0 *except* PRCSTEP2 can have a RC=0 to 16.
>I have tried using "RC.PRCSTEP2 = 16" for IF then ELSE before PRCSTEP1
>(since STEP0002.PRCSTEP1 will be executed if RC<=16 of
>STEP0001.PRCSTEP2). However it failed with JCL error since invaild
referback.
>
>Please give me a hint, thanks!
>
>Paul


A slight syntax correction with your post for IF/THEN/ENDIF - when
specifying stepname/procstepname, the ".RC" follows.

More to the point, yes, it would be useful to have the "RUN" condition
not
be so tight that it permits a "not yet declared" stepname/procstepname
exactly for this purpose.

As a circumventive measure, one, less desirable choice, is to resort to
either coding multiple PROC instances with specific check conditions or
use
JCL INCLUDE statements to externalize your individual PROC rqmt
conditions
and enclose the IF/THEN/ENDIF statements as needed for the first and
subsequent PROC executions.

The interpreter is so tight that I was unable to use JCL SET symbolics
with
IF/THEN/ENDIF statements, attempting to set a "blank" SET symbol for the
first execution of the PROC and follow that with another SET overriding
the
initial value to add the additional test after the first execution --
such as:

// SET RUNCHECK= 
//PROC1PROC  
//   IFRC = 0 &RUNCHECK THEN 
//PRCSTEP1 EXEC PGM=IKJEFT01,PARM=TIME   
//SYSTSPRT DD   SYSOUT=* 
//SYSTSIN  DD   DUMMY
//   ENDIF   
//   IFRC = 0 &RUNCHECK THEN 
//PRCSTEP2 EXEC PGM=IKJEFT01,PARM=BOGUS  
//SYSTSPRT DD   SYSOUT=* 
//SYSTSIN  DD   DUMMY   

Re: Question if COND code / IF THEN struct

2009-06-29 Thread Scott Barry
On Mon, 29 Jun 2009 01:13:50 -0500, Paul Ip  wrote:

>---snip---
>As a circumventive measure, one, less desirable choice, is to resort to
>either coding multiple PROC instances with specific check conditions or use
>JCL INCLUDE statements to externalize your individual PROC rqmt conditions
>and enclose the IF/THEN/ENDIF statements as needed for the first and
>subsequent PROC executions.
>---snip---
>
>Thanks for your detail explainlation!
>
>However, I don't understand how to use JCL INCLUDE statements to code the
>PROC requirement conditions AND being enclosed within the IF/THEN/ENDIF
>statements, can you kindly give me an example?
>
>by the way, it seems no easy to do so
>
>Paul


You have a JCLLIB statement and INCLUDE statement to work in JCL, related to
this topic.  A recent IBM DOC reference is z/OS V1R9.0 MVS JCL Reference,
SA22-7597-11.

Here is a Google search argument that yields discussion:

jcl jcllib include member example


One of several matches - link pasted below:

http://www.ibmmainframes.com/about62.html


Scott Barry
SBBWorks, Inc.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: Question if COND code / IF THEN struct

2009-06-28 Thread Paul Ip
---snip---
As a circumventive measure, one, less desirable choice, is to resort to
either coding multiple PROC instances with specific check conditions or use
JCL INCLUDE statements to externalize your individual PROC rqmt conditions
and enclose the IF/THEN/ENDIF statements as needed for the first and
subsequent PROC executions.
---snip---

Thanks for your detail explainlation!

However, I don't understand how to use JCL INCLUDE statements to code the 
PROC requirement conditions AND being enclosed within the IF/THEN/ENDIF 
statements, can you kindly give me an example?

by the way, it seems no easy to do so

Paul

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: Question if COND code / IF THEN struct

2009-06-28 Thread Paul Gilmartin
On Sun, 28 Jun 2009 10:43:42 -0500, Scott Barry wrote:
>
>Oh well - another strike against JCL coding optimization attempts, while
>having somewhat similar angst with "nested PROCs" to some degree, mostly
>with restart/recovery attempts.
>
Have you ever suspected that IBM accepted a Requirement for
nested PROCs in which the submitter had neglected to specify that
all facilities available in first-level PROCs such as referbacks,
overrides, and, yes, restart/recovery should equally be available
in PROCs nested more deeply, perhaps assuming it was implicit?

And IBM, seeing that it wasn't explicit, felt no responsibility
to Do It Right and took all the shortcuts?  Shame on IBM.

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: Question if COND code / IF THEN struct

2009-06-28 Thread Scott Barry
On Sun, 28 Jun 2009 01:56:59 -0500, Paul Ip  wrote:

>Hi all,
>
>If I have an JCL with an instream PROC:
>
>PROC1  PROC
>PRCSTEP1 EXEC PGM=XXX
>INPUT   DD DSN=&FILE
>PRCSTEP2 EXEC PGM=YYY
>INPUT   DD DSN=&FILE
>PRCSTEP3 EXEC PGM=ZZZ
>INPUT   DD DSN=&FILE
>  PEND
>STEP0001 EXEC PROC1,FILE=A1
>STEP0002 EXEC PROC1,FILE=A2
>STEP0003 EXEC PROC1,FILE=A3
>...
>STEP000N EXEC PROC1,FILE=AN
>
>PRCSTEP1 will have an RC=0
>PRCSTEP2 will have an RC=16 (but not a failure case)
>PRCSTEP3 will have an RC=0
>
>My question is, how can I code the COND parameter or IF the ELSE on all
>PRCSTEPs so that all the PRCSTEPs can be executed with previous
>PROCSTEPs RC=0 *except* PRCSTEP2 can have a RC=0 to 16.
>I have tried using "RC.PRCSTEP2 = 16" for IF then ELSE before PRCSTEP1
>(since STEP0002.PRCSTEP1 will be executed if RC<=16 of
>STEP0001.PRCSTEP2). However it failed with JCL error since invaild referback.
>
>Please give me a hint, thanks!
>
>Paul


A slight syntax correction with your post for IF/THEN/ENDIF - when
specifying stepname/procstepname, the ".RC" follows.

More to the point, yes, it would be useful to have the "RUN" condition not
be so tight that it permits a "not yet declared" stepname/procstepname
exactly for this purpose.

As a circumventive measure, one, less desirable choice, is to resort to
either coding multiple PROC instances with specific check conditions or use
JCL INCLUDE statements to externalize your individual PROC rqmt conditions
and enclose the IF/THEN/ENDIF statements as needed for the first and
subsequent PROC executions.

The interpreter is so tight that I was unable to use JCL SET symbolics with
IF/THEN/ENDIF statements, attempting to set a "blank" SET symbol for the
first execution of the PROC and follow that with another SET overriding the
initial value to add the additional test after the first execution -- such as:

// SET RUNCHECK= 
//PROC1PROC  
//   IFRC = 0 &RUNCHECK THEN 
//PRCSTEP1 EXEC PGM=IKJEFT01,PARM=TIME   
//SYSTSPRT DD   SYSOUT=* 
//SYSTSIN  DD   DUMMY
//   ENDIF   
//   IFRC = 0 &RUNCHECK THEN 
//PRCSTEP2 EXEC PGM=IKJEFT01,PARM=BOGUS  
//SYSTSPRT DD   SYSOUT=* 
//SYSTSIN  DD   DUMMY
//   ENDIF   
//   IFRC = 0 &RUNCHECK THEN 
//PRCSTEP3 EXEC PGM=IKJEFT01,PARM=TIME   
//SYSTSPRT DD   SYSOUT=* 
//SYSTSIN  DD   DUMMY
//   ENDIF   
//  PEND 
//STEP0001 EXEC PROC1
// SET  RUNCHECK='OR (PRCSTEP2.RUN AND PRCSTEP2.RC LT 16)'   
//STEP0002 EXEC PROC1
//STEP0003 EXEC PROC1


Oh well - another strike against JCL coding optimization attempts, while
having somewhat similar angst with "nested PROCs" to some degree, mostly
with restart/recovery attempts.


Scott Barry
SBBWorks, Inc.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html