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
 

 

SET MAXCC IF THEN returns 0 records

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

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Mon Apr 14, 2008 3:42 pm    Post subject: SET MAXCC IF THEN returns 0 records
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: 8593
Location: Back in jolly old England

PostPosted: Mon Apr 14, 2008 3:55 pm    Post subject:
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 Moderator


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

PostPosted: Mon Apr 14, 2008 8:16 pm    Post subject:
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: 189
Location: INDIA

PostPosted: Mon Apr 14, 2008 8:53 pm    Post subject:
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 Moderator


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

PostPosted: Mon Apr 14, 2008 9:04 pm    Post subject:
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: 189
Location: INDIA

PostPosted: Mon Apr 14, 2008 9:49 pm    Post subject:
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 Moderator


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

PostPosted: Mon Apr 14, 2008 10:47 pm    Post subject:
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":

http://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: 189
Location: INDIA

PostPosted: Tue Apr 15, 2008 12:32 pm    Post subject: Reply to: How to SET MAXCC when IFTHEN returns 0 records
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    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 Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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