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

Setting RC4 for a specific no. records Synsort/tool


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

New User


Joined: 30 Jul 2012
Posts: 18
Location: India

PostPosted: Tue Aug 28, 2012 3:08 pm
Reply with quote

Hi Guys,

I got one requirement to get total records of a file and then based on those count, I have to execute step2 or step3.

I am able to get the count using below code snippet. Is it possible to capture the count in Symbolic parameter, so that I can use IF/ELSE criteria to run below steps??

//STEP01 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=.... input file,DISP=SHR
//OUT DD SYSOUT=*
//TOOLIN DD *
COUNT FROM(IN) WRITE(OUT) DIGITS(8)
/*
~~~~ trying to implement below thing ~~~~
// IF COUNTNUM=100 THEN
//STEP02
...
// ELSE
//STEP03
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Aug 28, 2012 4:11 pm
Reply with quote

no,
but you could set the RC.
use cond codes instead of IF/THEN/ELSE, also.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Tue Aug 28, 2012 4:11 pm
Reply with quote

Possibly you can make use of SYMNAMES from SORT product. Which SORT product are you using at your shop?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Aug 28, 2012 4:14 pm
Reply with quote

HTF are going to get this to work:
IF COUNTNUM=100
Back to top
View user's profile Send private message
pankaj1002

New User


Joined: 30 Jul 2012
Posts: 18
Location: India

PostPosted: Tue Aug 28, 2012 4:17 pm
Reply with quote

dbzTHEdinosauer wrote:
no,
but you could set the RC.
use cond codes instead of IF/THEN/ELSE, also.


Ok..but how we will SET MAXXCC depending on record counts?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Tue Aug 28, 2012 4:24 pm
Reply with quote

I overlooked that part from original post...
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Aug 28, 2012 4:29 pm
Reply with quote

you are using sort (either syncsort or DFSORT).
both can set the RC based on a count.
check/search the forum(s) (jcl for synsort/DFSORT for <guess>)

maxcc is something else. check the JCL manual and learn the difference.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Aug 28, 2012 7:42 pm
Reply with quote

Hello,

Very good point Dick icon_smile.gif
Possibly this will be a distraction, but maybe it is time to say this once again. . . .

Although many posters here use RETURN CODE, RC, Condition Code, and MAXCC interchangably - THEY ARE NOT.

MAXCC is completely different and should only be mentioned when using a utility that has this - most often IDCAMS.

Note that MAXCC is not ever referenced in the JCL manuals.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Aug 29, 2012 8:18 am
Reply with quote

Hi,

is COUNTNUM always going to be 100 ?


Gerry
Back to top
View user's profile Send private message
pankaj1002

New User


Joined: 30 Jul 2012
Posts: 18
Location: India

PostPosted: Wed Aug 29, 2012 3:49 pm
Reply with quote

gcicchet wrote:
Hi,

is COUNTNUM always going to be 100 ?


Gerry


Yes Gerry COUNTNUM will be a constant value and will not change
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Aug 29, 2012 7:15 pm
Reply with quote

This is what I came up with using Syncsort/Synctool and assuming that it wants the count to be exactly 100:

Code:

//STEP001  EXEC PGM=SYNCTOOL     
//TOOLMSG  DD   SYSOUT=*         
//DFSMSG   DD   SYSOUT=*         
//IN       DD   DSN=...
//OUT      DD   DSN=&&T1,DISP=(,PASS),UNIT=VIO,SPACE=(CYL,(1,1)) 
//CNT      DD   DSN=&&T2,DISP=(,PASS),UNIT=VIO,SPACE=(CYL,(1,1)) 
//TOOLIN   DD   *                                                 
COUNT FROM(IN) WRITE(OUT) DIGITS(8)                               
COPY FROM(OUT) TO(CNT) USING(CTL1)                               
COUNT FROM(CNT) EMPTY RC4                                         
/*                                                               
//CTL1CNTL DD   *                                                 
  OUTFIL INCLUDE=(1,8,ZD,EQ,100)                                 
/*                                                               
//*                                                               
// IF STEP001.RC = 0 THEN                                         
//STEP002  EXEC PGM=IEFBR14                                       
// ENDIF                                                         
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Aug 30, 2012 3:32 am
Reply with quote

Hi,

this might be slightly simpler
Code:
//STEP0001 EXEC PGM=SYNCTOOL                 
//TOOLMSG  DD SYSOUT=*                       
//DFSMSG   DD SYSOUT=*                       
//IN       DD DSN=input dsn                 
//TOOLIN   DD *                             
  COUNT FROM(IN) EQUAL(100) RC4             
/*                                           



Gerry
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Aug 30, 2012 4:37 am
Reply with quote

Further simplification. Sets RC to 12 by default. If 12 is not too "scary"... :-)

Code:
//STEP0001 EXEC PGM=ICETOOL                 
//TOOLMSG  DD SYSOUT=*                       
//DFSMSG   DD SYSOUT=*                       
//IN       DD DSN=input dsn                 
//TOOLIN   DD *                             
  COUNT FROM(IN) EQUAL(100)             
/*                                           


The RC of 12 or 4 works with EMPTY, NOTEMPTY, HIGHER(x), LOWER(y), EQUAL(v), or NOTEQUAL(w), so able to cover a wide range of situations and not just limited to an exact value. SUB and ADD are available for adjusting the count prior to testing, if needing to deal with presence/addition of headers, trailers or some such.

...with DFSORT's ICETOOL, anyway :-)

Check your Synctool Docu... oh, you probably can't :-)
Back to top
View user's profile Send private message
pankaj1002

New User


Joined: 30 Jul 2012
Posts: 18
Location: India

PostPosted: Tue Sep 04, 2012 11:46 am
Reply with quote

Thanks All for your inputs icon_biggrin.gif ,

The final code which worked for me icon_smile.gif is:

Code:
//STEP0001 EXEC PGM=ICETOOL                 
//TOOLMSG  DD SYSOUT=*                       
//DFSMSG   DD SYSOUT=*                       
//INPFILE  DD DSN=FILENAME                 
//TOOLIN   DD *                             
  COUNT FROM(INPFILE) EQUAL(100)  RC4           
/*                                           
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Sep 04, 2012 12:11 pm
Reply with quote

Thanks for letting us know.

Now that we know what you wanted, I've edited your subject :-)
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Tue Sep 04, 2012 2:34 pm
Reply with quote

Bill Woodger wrote:
Now that we know what you wanted, I've edited your subject :-)
And I wondered how the "contents of other topic" are exactly same of "a previous topic". icon_biggrin.gif

Thanks actually, it was indeed confusing.
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

 


Similar Topics
Topic Forum Replies
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts To Omit records based n SORT condition DFSORT/ICETOOL 6
No new posts Need help In Mainframe Automation AF/... CLIST & REXX 14
No new posts To fetch records that has Ttamp value... DFSORT/ICETOOL 5
No new posts ICETOOL returns no records JCL & VSAM 1
Search our Forums:

Back to Top