On Fri, 13 May 2016 09:39:43 -0700, Charles Mills wrote:

>I know this has been kicked around before but I don't have a good answer off
>the top of my head and I don't know exactly how to Google for the answer.
>
>Does anyone have suggestions for conditioning a jobstep on &symbol1 !=
>&symbol2? I know that COND= and IF are only on return codes and similar
>things, not character strings.
> 
Sigh.  And there are many constructs which documentation calls unsupported
but work intuitively, such as:

    IF ( FALSE ) THEN
        EXEC PGM= ...  (The step is skipped.)
    ENDIF

I consider this specification a grievous misapplication of Postel's principle.

>I could write Rexx that would compare two symbols (or evaluate a complex
>expression) and set a return code -- is that the best approach? Or is there
>something off the shelf that would have the same effect? I have a feeling
>someone here knows a clever hack.
> 
If I were writing Rexx, I'd tailor the entire job, up front.  But I prefer
shell scripts because sh provides instream data.

Or use ISPF file tailoring; not in my skill set.

In simpler cases IDCAMS is the simplest way to set a return code.

>Complicating life is that part of what I need to bypass if &symbol1 ==
>&symbol2 is a DD with DISP=NEW. Can IF bypass an entire step including DDs
>(such that DISP=NEW for an existing dataset will not cause errors)? The
>
Sigh.  This looks like a JES3 constraint.  I've sometimes resorted to (not JES3)

//HANDLE  DD  DISP=(MOD,CATLG),...
//SYSUT2  DD  DISP=OLD,DSN=*.HANDLE,VOL=REF=*.HANDLE

Or, sprinkle in steps with COND=(0,LE) to fool JES3

>examples do not show that. If not, do I solve that by putting the DD (and
>EXEC PGM=) in a PROC and IF/ELSE executing one of two alternative PROCs? Or
>... ?
>
And selecting the PROC by a JCL SET symbol?  I haven't tried it; I hope it 
works.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to