View previous topic :: View next topic
|
Author |
Message |
deepu2pani
New User
Joined: 30 Jan 2007 Posts: 2 Location: bangalore
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Most of the IT is getting paid because they code to avoid abends , 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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
deepu2pani
New User
Joined: 30 Jan 2007 Posts: 2 Location: bangalore
|
|
|
|
It is working Fine.
Thank you very Much |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Glad, you got it working! |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Less competent programmer like me look up to you, Nic - please dont' make me ....
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". |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
|