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

SET MAXCC IF THEN returns 0 records


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 216
Location: USA

PostPosted: Mon Apr 14, 2008 3:42 pm
Reply with quote

Hi guys,

I got a requirement like I need to check the sysout of a step when it is abended and extract the message then send a mail to user. I am able to do that and its ready now to send an email. But the problem is the mail should be sent only for specific abend which is related to business which we can see in the sysout. But here the step can abend with other than this business reason say for example contention or etc. Then our sysout will not have the error message which will be thrown in business abend condition. But still my sort step will execute to extract the data from the step since it returned maxcc as greater than 0. My sort controlc ard is as follows.

Code:

INCLUDE  COND=(63,20,CH,EQ,                       
               C'XXXXXXXXXXXXX')           
INREC IFOUTLEN=160,                               
IFTHEN=(WHEN=(63,20,CH,EQ,C'XXXXXXXXXXXXX'),
  BUILD=(10:55,45))                               


So I just tried with other than business message in the sysout. Then the above control card written nothing as it is supposed to and returned the following in TOOLMSG
Code:
RECORD COUNT:  000000000000017                             
NUMBER OF RECORDS RESULTING FROM CRITERIA:  000000000000000
OPERATION RETURN CODE:  00                                 



But here I am trying to do in a way that to set MAXCC to some 2 when the IFTHEN is able to select something or set MAXCC to some 3 when there are 0 records as shown above.


Please help me in this regard

Regards
Amar
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Apr 14, 2008 3:55 pm
Reply with quote

Not sure if you can set an exit RC in ICETOOL.

Maybe you should look at other options - easy enough to establish if a file has 0 or more records, easy enough to use IF/THEN/ELSE foe specific abends as well as RC's.
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: Mon Apr 14, 2008 8:16 pm
Reply with quote

DFSORT/ICETOOL does not have any built-in functions for setting a return code of 2 or 3. You can use ICETOOL's COUNT operator to set a return code of 0, 4 or 12. You can use DFSORT's NULLOUT and NULLOFL options to set a return code of 0, 4 or 16.
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 216
Location: USA

PostPosted: Mon Apr 14, 2008 8:53 pm
Reply with quote

Frank,

But can we set the reurn code as I requested for like when "IFTHEN" returns records as zero

Code:
NUMBER OF RECORDS RESULTING FROM CRITERIA:  000000000000000


Please explain.
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: Mon Apr 14, 2008 9:04 pm
Reply with quote

Quote:
But can we set the reurn code as I requested for like when "IFTHEN" returns records as zero


No. You seem to be misunderstanding the nature of IFTHEN.

The return code is set based on the number of records in the output file. If the control statements you use result in an empty output data set, then the return code will be set accordingly.

IFTHEN does NOT include or omit records, so it cannot affect the number of records in the output data set. IFTHEN only modifies records (or not) based on a condition. The number of records does not change as a result of IFTHEN.

INCLUDE and OMIT include or omit records, so they can affect the number of records in the output data set.

In your control statements, you have the same condition in INCLUDE and IFTHEN, so you don't even need the IFTHEN. The INCLUDE statement will only keep the records with that condition, so those are the only records the IFTHEN will see.
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 216
Location: USA

PostPosted: Mon Apr 14, 2008 9:49 pm
Reply with quote

Yes Yes you are correct. Even I didnt notice that I have used the same condition twice. Now I have removed the IFTHEN.

Thanks for the long explanation.

But I need little clarification. We can get the count of the number of records using the COUNT of ICETOOL operator. But after getting the count how can we set a return code. Will IF cluase of JCL considers the COUNT means will this work

IF COUNT = 0
SET MAXCC=4

Please explain


Regards
Amar
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: Mon Apr 14, 2008 10:47 pm
Reply with quote

I'm not sure I know what you're asking so I'm not sure if my explanation will help. But I'll give it a shot.

If you use COUNT FROM(IN) EMPTY RC4, ICETOOL will pass back RC=0 if IN has any records, or RC=4 if IN does not have any records.

If you use COUNT FROM(IN) NOTEMPTY RC4, ICETOOL will pass back RC=4 if IN has any records or RC=0 if IN does not have any records.

You can use that 0 or 4 return code in the normal way with conditional JCL.

For more information, see the discussion of the "Set RC=12 or RC=4 if file is empty, has more than n records, etc" Smart DFSORT Trick at":

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/

Code:

IF COUNT = 0
SET MAXCC=4


I don't know what language this is. But if it's setting RC=4 when the COUNT is 0, then it would appear to be the equivalent of DFSORT/ICETOOL's COUNT FROM(IN) EMPTY RC4.
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 216
Location: USA

PostPosted: Tue Apr 15, 2008 12:32 pm
Reply with quote

No, I didnt meant that the below is a code. Sorry for miscommunication happened.

Code:

IF COUNT = 0
SET MAXCC=4



I just gave a pseudo code format in the way I need. Your explanation was helpful. I think I ate your time

Thank you

Regards
Amar
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 only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts JCL sortcard to print only the records DFSORT/ICETOOL 11
Search our Forums:

Back to Top