View previous topic :: View next topic
|
Author |
Message |
cravisankar
New User
Joined: 12 Feb 2024 Posts: 14 Location: India
|
|
|
|
Hi All,
In my i/p d/s I have a word 'EXIST' at column 12.
My requirement is : I need a JCL that should read my i/p d/s and if it finds the word EXIST at column 12 then it should abend with maxcc=8 and execute next step of JCL. Else the job should end with maxcc=0. The next step of JCL contains a code which triggers INC to my queue.
Below is the sample i/p d/s:
Code: |
=COLS> ----+----1----+----2----+----3----+----4-
****** ***************************** Top of Data
000001 ABCDEF ALIAS DOES NOT EXIST
000002 GHIJKL EXIST GHIJKL
000003 MNOPQRS EXIST MNOPQRS
000004 TUVWSY ALIAS DOES NOT EXIST
000005 Z12345 ALIAS DOES NOT EXIST |
With the help of SORT control card, I know how to read the word EXIST at column 12. But after reading it I don't know how to code the JCL so that it abends and proceed to next step.
Please look at my requirement and educate me. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1319 Location: Bamberg, Germany
|
|
|
|
Fact: You cannot do this with JCL.
ToDo: Post at the right place of the Forum (DFSORT/SYNCSORT)
Show: Any of your attempts |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2126 Location: USA
|
|
|
|
cravisankar wrote: |
it should abend with maxcc=8 and execute next step of JCL. Else the job should end with maxcc=0. |
Initial educational steps:
1) ABEND is used in 99.99999999% of cases to terminate the job immediately.
2) After ABEND it is not possible to terminate the job with RC=0
3) No MAXCC is used in JCL, ever. |
|
Back to top |
|
|
cravisankar
New User
Joined: 12 Feb 2024 Posts: 14 Location: India
|
|
|
|
Hi,
I might have used a wrong word 'educate'. In fact I don't mean that. Basically, I want to know which parameter do I need to use for my requirement.
As I need to post it in DFSORT/SYNCSORT forum, is it possible to transfer this query or do I need to raise a fresh query in that forum? |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1319 Location: Bamberg, Germany
|
|
|
|
To achieve the result, you can use ICETOOLs COUNT operator with NOTEMPTY and RC8 parameters. It basically is a No-brainer. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2126 Location: USA
|
|
|
|
cravisankar wrote: |
My requirement is : I need a JCL that should read my i/p d/s and if it finds the word EXIST at column 12 then it should abend with maxcc=8 and execute next step of JCL.
I might have used a wrong word 'educate'. In fact I don't mean that. Basically, I want to know which parameter do I need to use for my requirement. |
This is not possible in JCL language, due to many issues in those "requirements".
The manager who has given you such "requirement" needs more education himself. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1319 Location: Bamberg, Germany
|
|
|
|
To give a working sample, this will do the job.
Code: |
//ICETOOL EXEC PGM=ICETOOL
//IN DD *
ABCDEF ALIAS DOES NOT EXIST
GHIJKL EXIST GHIJKL
MNOPQRS EXIST MNOPQRS
TUVWSY ALIAS DOES NOT EXIST
Z12345 ALIAS DOES NOT EXIST
/*
//INCLCNTL DD *
INCLUDE COND=(12,5,CH,EQ,C'EXIST')
/*
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//TOOLIN DD *
COUNT FROM(IN) USING(INCL) NOTEMPTY RC8
/* |
Remember the hints given as well. |
|
Back to top |
|
|
cravisankar
New User
Joined: 12 Feb 2024 Posts: 14 Location: India
|
|
|
|
Sure, will try these options and thank you for the inputs |
|
Back to top |
|
|
|