I realize that this is still conditional code execution, but a very simple Rexx 
exec will work:

SetCC:  (I'll borrow your program name)
interpret 'return' arg(1)

JCL fragment:
// SET TODAY=FRI
//TEST     EXEC PGM=IRXJCL,PARM='SETCC &TODAY=FRI'
//SYSEXEC  DD DISP=SHR,DSN=pds.contains.setcc
//*
// IF (TEST.RC = 1) THEN
//CODE     EXEC PGM=IEFBR14
// ENDIF

Actually, if you're willing to deal with the strangeness, you could use the 
following where the '@' is replaced by one byte of hex '00'.
// SET TODAY=FRI
//TEST     EXEC PGM=IRXJCL,PARM='@ &TODAY=FRI'
//SYSEXEC  DD *
interpret 'return' arg(1)
//*
// IF (TEST.RC = 1) THEN
//CODE     EXEC PGM=IEFBR14
// ENDIF

Of course, you'll get the
-CAUTION- Data contains invalid (non-display) characters. Use command
          ===> FIND P'.' to position cursor to these
message each time you edit the JCL :(

We use a simple exit to change
// SET TODAY=&LWDAY
into
// SET TODAY=FRI

On Thu, 25 Jun 2009 09:40:41 -0400, Barkow, Eileen 
<[email protected]> wrote:

>i wrote a program (aptly named SETCC) that accepts various parms passed
>in the parm field and passes them as condition codes, including an
>option to pass the date and time. The program accepts numbers to be
>passed as well as various keywords that it converts to numbers.
>
>
>-----Original Message-----
>From: IBM Mainframe Discussion List [mailto:[email protected]] On
>Behalf Of Paul Gilmartin
>Sent: Thursday, June 25, 2009 9:36 AM
>To: [email protected]
>Subject: Re: IF-Statement in JCL
>
>On Thu, 25 Jun 2009 14:01:54 +0200, Michael Knigge wrote:
>
>>Roland,
>>
>>> Not with YES/NO but like this
>>> Note: IEFBR14 always set RC0
>>
>>oh my god, that simple......
>>
>>I always thought to myself, I could write a utility that just returns
>>(so do a "B R14") and set a RC that I've specified with a PARM
>>JCL-Statement (EXEC PGM=FOO,PARM='1' or something like that)
>>
>You can use IDCAMS to set RC to a desired value, but it must
>appear in SYSIN, not in PARM.
>
>And you can use JCL symbols in IF statements; something like:
>
>    //  SET YES=0
>            ...
>    //  IF ( IEFBR14.RC = &YES ) ...
>
>-- gil
>
>----------------------------------------------------------------------
>For IBM-MAIN subscribe / signoff / archive access instructions,
>send email to [email protected] 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 [email protected] 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 [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to