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

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


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 2146
Location: At my coffee table

PostPosted: Thu Apr 17, 2008 8:01 pm
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 Developer


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

PostPosted: Fri Apr 18, 2008 12:22 am
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: 2146
Location: At my coffee table

PostPosted: Fri Apr 18, 2008 12:37 am
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
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
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
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

Moderator Emeritus


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

PostPosted: Mon Apr 21, 2008 11:20 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
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
Search our Forums:

Back to Top