We force the abend to stop running the job immediately. This flags that 
something is wrong and needs to be looked at.

In the original post, Mark wanted to "ABEND or GOTO EOJ or somehow end 
this thing"

If you don't want to abend the job but just conditionally run one or more 
steps, then I use IF-THEN-ENDIF with no else. I have written programs that 
set the return code to 1, 2, or 3 to indicate to the JCL future steps to 
run. Then anything 4+ will raise an error.

IBM Mainframe Discussion List <[email protected]> wrote on 01/19/2011 
12:07:36 PM:

> From: Paul Gilmartin <[email protected]>
> To: [email protected]
> Date: 01/19/2011 12:08 PM
> Subject: Re: If Else JCL question
> Sent by: IBM Mainframe Discussion List <[email protected]>
> 
> On Wed, 19 Jan 2011 09:50:56 -0600, Jonathan Goossen wrote:
> 
> >We force an ABEND by calling a program that always ABENDs
> >
> >//STEP1 ...
> >//IF (STEP1.RC EQ 0) then
> >//STEP2 ...
> >//ELSE
> >//S0000A    EXEC  PGM=BLOWUP
> >//ENDIF
> >
> Do you really _want_ the ABEND?  If not, why not move the
> ELSE and ENDIF to the end of the JCL?
> 
> BTW, What's an easy way to force an ABEND (without a program
> specifically for the purpose)?  The most concise way that
> comes to mind is:
> 
>     //STEP     EXEC  PGM=IEBGENER
>     //SYSUT1    DD   PATH='/',RECFM=FB,LRECL=80
>         ...
> ... gives a nice IEC143I 213-F8.  But it requires three
> additional DD statements.  Is there a shorter way?
> 
> I know I can use a trivial IDCAMS step to set RC.
> 
> -- 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


This e-mail message and all attachments transmitted with it may
contain legally privileged and/or confidential information intended
solely for the use of the addressee(s). If the reader of this
message is not the intended recipient, you are hereby notified that
any reading, dissemination, distribution, copying, forwarding or
other use of this message or its attachments is strictly
prohibited. If you have received this message in error, please
notify the sender immediately and delete this message and all
copies and backups thereof. Thank you.

----------------------------------------------------------------------
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