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
 

 

Return code of a step based on a field in input file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
vyasricha

New User


Joined: 17 Mar 2008
Posts: 27
Location: banaglore

PostPosted: Thu Apr 17, 2008 7:46 pm    Post subject: Return code of a step based on a field in input file
Reply with quote

I need to set the return code of the step as 4 if I have a field name 'CCCC' in the file in any of the records in the columns 1 to 4.

If this is the input file
AAAABBBB
CCCCDDDD
DLJFDLJFDLJFDLFJDL
NFEOJNFFJDKUOENMNKGNKLJ

as CCCC exists from 1 to 4, return code of the step should be 4.

The input file is of variable length varying from 10 to 80.

Thanks
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Apr 17, 2008 8:01 pm    Post subject:
Reply with quote

Take a look at Set RC=12 or RC=4 if file is empty, has more than n records, etc in Smart DFSORT Tricks...
Basically, do a copy with an include for the 'CCCC' and output to a dummy file. Set the return code to 4 if the output is not zero.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Apr 18, 2008 12:22 am    Post subject:
Reply with quote

Quote:
Basically, do a copy with an include for the 'CCCC' and output to a dummy file. Set the return code to 4 if the output is not zero.


Actually, that Smart DFSORT Trick is for COUNT, not COPY. You don't need to output to a dummy file because COUNT doesn't use an output file.
You just need to have USING(CTL1) with the INCLUDE statement in //CTL1CNTL.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Apr 18, 2008 12:37 am    Post subject:
Reply with quote

Frank Yaeger wrote:
Actually, that Smart DFSORT Trick is for COUNT, not COPY.
My bad, I'll be more careful next time...... icon_cry.gif
Back to top
View user's profile Send private message
vyasricha

New User


Joined: 17 Mar 2008
Posts: 27
Location: banaglore

PostPosted: Mon Apr 21, 2008 10:59 am    Post subject: Reply to: Return code of a step based on a field in input fi
Reply with quote

I have applied the above solution but one more doubt

//STEP100 EXEC PGM=ICETOOL
//TOOLIN DD *
COUNT FROM(IN) NOTEMPTY USING(CNT1) RC4
//CNT1CNTL DD *
INCLUDE COND=(1,4,CH,EQ,C'CCCC')
//*
// IF STEP100.RC = 4 THEN
//STEP200 EXEC PGM=ICETOOL
//IN DD DSN=CG83.NAEC.WRK.EXT830.MACK.MAR15T,DISP=SHR
//TOOLIN DD *
SORT FROM(IN) TO(OUT) USING(CTL1)
...
....
//*
// ENDIF

If the character CCCC are present in the input file return code of s100 is 4, if that is 4 we will execute s200.
But the final return code of the JCL is also 4. but i want it to be zero in any case
How to make the JCL return code as zero.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Apr 21, 2008 11:03 am    Post subject:
Reply with quote

The final return code for the job is the highest return code for any step, that's the way it is just accept it.
Back to top
View user's profile Send private message
vyasricha

New User


Joined: 17 Mar 2008
Posts: 27
Location: banaglore

PostPosted: Mon Apr 21, 2008 11:07 am    Post subject: Reply to: Return code of a step based on a field in input fi
Reply with quote

that is fine,
but how to make the return code as zero now
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Apr 21, 2008 11:20 am    Post subject:
Reply with quote

Hello,

Quote:
that is fine,
but how to make the return code as zero now
It appears that you did not understand the previous reply. . .

When any step in a job sets a non-zero return code, the return code for that step or the entire job can never be reset to zero. Once set, it cannot be "un-set".
Back to top
View user's profile Send private message
vyasricha

New User


Joined: 17 Mar 2008
Posts: 27
Location: banaglore

PostPosted: Mon Apr 21, 2008 11:32 am    Post subject: Reply to: Return code of a step based on a field in input fi
Reply with quote

OK.. Thanks,
I thought there might be some way to reset the return code of a step after that step got executed. So, that we can make the return code of the jcl to 0.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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