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

Need help on JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
cravisankar

New User


Joined: 12 Feb 2024
Posts: 14
Location: India

PostPosted: Wed Apr 03, 2024 12:50 pm
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1329
Location: Bamberg, Germany

PostPosted: Wed Apr 03, 2024 1:41 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2127
Location: USA

PostPosted: Wed Apr 03, 2024 6:30 pm
Reply with quote

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
View user's profile Send private message
cravisankar

New User


Joined: 12 Feb 2024
Posts: 14
Location: India

PostPosted: Wed Apr 03, 2024 6:39 pm
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1329
Location: Bamberg, Germany

PostPosted: Wed Apr 03, 2024 6:44 pm
Reply with quote

To achieve the result, you can use ICETOOLs COUNT operator with NOTEMPTY and RC8 parameters. It basically is a No-brainer.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2127
Location: USA

PostPosted: Wed Apr 03, 2024 6:47 pm
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1329
Location: Bamberg, Germany

PostPosted: Wed Apr 03, 2024 7:35 pm
Reply with quote

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
View user's profile Send private message
cravisankar

New User


Joined: 12 Feb 2024
Posts: 14
Location: India

PostPosted: Wed Apr 03, 2024 11:21 pm
Reply with quote

Sure, will try these options and thank you for the inputs
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

 


Search our Forums:

Back to Top