Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Depending on the input file abend the JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
deepu2pani

New User


Joined: 30 Jan 2007
Posts: 2
Location: bangalore

PostPosted: Mon May 06, 2013 4:22 pm    Post subject: Depending on the input file abend the JCL
Reply with quote

Hi!

I have a JCL with 10 steps and in the first step, I have a file with only one record and the record length is one bite. I need to read the file and if the Value in the file is 'Y' then continue JCL, else abend the JCL in the first Step.

Is this possible with the Sort. can some one please help me.
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon May 06, 2013 4:33 pm    Post subject:
Reply with quote

Most of the IT is getting paid because they code to avoid abends icon_smile.gif , however, for a Monday - try this:

Input is "N" - so the job abends:

Code:
//STEP010  EXEC PGM=SORT,PARM='RC16=ABE'
//SYSOUT   DD SYSOUT=*                   
//SORTIN   DD *                         
N                                       
//SORTOUT  DD DUMMY                     
//SYSIN    DD *                         
  OPTION NULLOUT=RC16                   
  SORT FIELDS=COPY                       
  INCLUDE COND=(1,1,CH,EQ,C'Y')         
//*                                     
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1713
Location: UK

PostPosted: Mon May 06, 2013 4:36 pm    Post subject:
Reply with quote

Note that the job does NOT abend but gives a return code of 16 so that, by coding an IF condition, the rest of the job cab be by-passed.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon May 06, 2013 4:49 pm    Post subject:
Reply with quote

Nic - when you pass PARM='RC16=ABE' -- it'll make the step to abend with U0016 (USER 16 ABEND ) for SyncSort for Z/OS 1.3.2.2R. Though the release of SyncSort is not that relevant here, however, I've tested the code with that release of it.

This is from the JES2 JOB LOG of a Job, having the only step shown in the previous post of mine:

Quote:
J E S 2 J O B L O G -- S Y S T E M A N U J -- N O

07.01.23 JOB19117 ---- MONDAY, 06 MAY 2013 ----
07.01.23 JOB19117 $HASP373 ANUJT STARTED - INIT 21 - CLASS 0 - SYS D10A
07.01.23 JOB19117 ACF9CCCD USERID ANUJ IS ASSIGNED TO THIS JOB - ANUJT
07.01.23 JOB19117 IEF403I ANUJT - STARTED - TIME=07.01.23
07.01.23 JOB19117 IEF450I ANUJT STEP010 - ABEND=S000 U0016 REASON=00000000 732 TIME=07.01.23
07.01.23 JOB19117 U11-646 U11TRT JOB ANUJT IS BEING TRACKED VIA DBAS SUBSYST
07.01.23 JOB19117 IEF404I ANUJT - ENDED - TIME=07.01.23
07.01.23 JOB19117 U11-613 JOBNAME=ANUJT,TRACKING WITHOUT RUN HANDLER
07.01.23 JOB19117 U11-607 JOBNAME=ANUJT,PRODJOB#=0164,TERMINATED UNSUCCESSFULLY
07.01.23 JOB19117 $HASP395 ANUJT ENDED
------ JES2 JOB STATISTICS ------
06 MAY 2013 JOB EXECUTION DATE
13 CARDS READ
104 SYSOUT PRINT RECORDS
0 SYSOUT PUNCH RECORDS
Back to top
View user's profile Send private message
deepu2pani

New User


Joined: 30 Jan 2007
Posts: 2
Location: bangalore

PostPosted: Mon May 06, 2013 6:11 pm    Post subject:
Reply with quote

It is working Fine.

Thank you very Much
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon May 06, 2013 6:15 pm    Post subject:
Reply with quote

Glad, you got it working!
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1713
Location: UK

PostPosted: Tue May 07, 2013 1:55 am    Post subject:
Reply with quote

Just shows how much I know! Still, depending on the circumstances I woud prefer not to have an avoidable failure in my production stats
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue May 07, 2013 4:28 pm    Post subject:
Reply with quote

Less competent programmer like me look up to you, Nic - please dont' make me ...icon_redface.gif.

OTOH, yes - that's correct, I'd also prefer not to have an avoidable failure in production -- that's why I said -- "Most of the IT is getting paid because they code to avoid abends". icon_smile.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1713
Location: UK

PostPosted: Tue May 07, 2013 5:30 pm    Post subject:
Reply with quote

Quote:
Less competent programmer like me look up to you, Nic

Competent? Moi? You should have seen my struggles with the IF statement in COBOL this morning! How I long for good old PL/1!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us