IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Depending on the input file abend the JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Superior Member


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

PostPosted: Mon May 06, 2013 4:33 pm
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: 2455
Location: Hampshire, UK

PostPosted: Mon May 06, 2013 4:36 pm
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

Superior Member


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

PostPosted: Mon May 06, 2013 4:49 pm
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
Reply with quote

It is working Fine.

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

Superior Member


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

PostPosted: Mon May 06, 2013 6:15 pm
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: 2455
Location: Hampshire, UK

PostPosted: Tue May 07, 2013 1:55 am
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

Superior Member


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

PostPosted: Tue May 07, 2013 4:28 pm
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: 2455
Location: Hampshire, UK

PostPosted: Tue May 07, 2013 5:30 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top