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
 

 

Setting RC4 for a specific no. records Synsort/tool

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Setting RC4 for a specific no. records Synsort/tool
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    Post subject:
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

Senior Member


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

PostPosted: Tue Aug 28, 2012 4:11 pm    Post subject:
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    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Tue Aug 28, 2012 4:24 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Aug 28, 2012 7:42 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Aug 29, 2012 8:18 am    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Wed Aug 29, 2012 7:15 pm    Post subject: Reply to: How To Use Total count of a file in IF-ELSE condit
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: 1703
Location: Australia

PostPosted: Thu Aug 30, 2012 3:32 am    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Aug 30, 2012 4:37 am    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Sep 04, 2012 12:11 pm    Post subject: Reply to: How To Use Total count of a file in IF-ELSE condit
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

Senior Member


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

PostPosted: Tue Sep 04, 2012 2:34 pm    Post subject: Re: Reply to: How To Use Total count of a file in IF-ELSE co
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts how to split records based on specifi... Venkata Ramayya DFSORT/ICETOOL 6 Wed Sep 28, 2016 3:20 am


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