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

get count after eliminating dups...using single sort parm.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
keyarika

New User


Joined: 24 May 2008
Posts: 10
Location: bangalore

PostPosted: Sat Jun 14, 2008 2:12 am
Reply with quote

Is there any way to eliminate the duplicates and get the count of the records in a file using a single sort parm.

sagar keyarika
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Sat Jun 14, 2008 3:17 am
Reply with quote

The following DFSORT JCL will give you desired results

Code:

//STEP0100 EXEC PGM=ICEMAN               
//SYSOUT   DD SYSOUT=*                   
//SORTIN   DD *                         
ABC                                     
ABC                                     
ABC                                     
DEF                                     
DEF                                     
//SORTOUT  DD SYSOUT=*                   
//SYSIN    DD *                         
  SORT FIELDS=(1,3,CH,A)                 
  OUTFIL REMOVECC,NODETAIL,             
  SECTIONS=(1,3,                         
  TRAILER3=(1,3,X,COUNT=(M11,LENGTH=5)))
/*


Or the following DFSORT/ICETOOL JCL will give you the desired results

Code:

//STEP0200 EXEC  PGM=ICETOOL           
//TOOLMSG  DD SYSOUT=*                 
//DFSMSG   DD SYSOUT=*                 
//IN       DD *                       
ABC                                   
ABC                                   
ABC                                   
DEF                                   
DEF                                   
//OUT      DD SYSOUT=*                 
//TOOLIN    DD *                       
 OCCURS FROM(IN) LIST(OUT) NOHEADER - 
 ON(1,3,CH) ON(VALCNT,E'99999') BLANK 
/*                                     
Back to top
View user's profile Send private message
keyarika

New User


Joined: 24 May 2008
Posts: 10
Location: bangalore

PostPosted: Tue Jun 17, 2008 5:09 pm
Reply with quote

Thank you for the reply, i have not checked this solution yet but i fear that it will return all the records also along with the count. actually i wanted only the count.
thanks!
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Jun 17, 2008 5:25 pm
Reply with quote

keyarika,

Quote:
but i fear that it will return all the records also along with the count. actually i wanted only the count.


It wont return all the records. It would return one record for duplicates with teh count.

The output would be like this.

Code:
ABC   00003
DEF   00002


I think this is what you wanted. If you do not want tthe record then how will you identify the counts?
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: Tue Jun 17, 2008 9:41 pm
Reply with quote

Quote:
i have not checked this solution yet but i fear that it will return all the records also along with the count.


Why do you think that? Why didn't you try it before assuming it wouldn't work? Why didn't you give more details of what you want in your first post, such as an example of your input records and what you want for output? Kolusu and I are glad to help, but you need to provide the details of what you want so we can help you. We test our solutions to make sure they work based on how you describe what you want.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Jun 18, 2008 5:02 am
Reply with quote

Hi,

I think keyarika has missed the keword "NODETAIL"

Gerry
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: Wed Jun 18, 2008 6:21 am
Reply with quote

Hello,

Quote:
I think keyarika has missed the keword "NODETAIL"
Quite possibly, but before questioning the suggestion/solution, running a test would have been a better choice - especially as the test is so small and could have been done with a single copy/paste. . .
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Jun 18, 2008 6:34 am
Reply with quote

Hi Dick,

I agree with you 110%, I'm not sure why people are reluctant to test things before requesting assistance.


Gerry
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jun 18, 2008 12:47 pm
Reply with quote

Quote:
Is there any way to eliminate the duplicates and get the count of the records in a file using a single sort parm.


and to add more I just cannot stand when people ask something and add
constraints to the request
- it usually sounds like homework

they should have the good sense of trusting the responders to give the best/simpler solution

this especially holds for the dfsort/icetool were the people answering do that as part of their job

as I always say...
if You are putting constraints on the solution, You have already evaluated with the due competence
all the alternatives, and You have made Your choice ..
and You should not have the need to ask
Back to top
View user's profile Send private message
keyarika

New User


Joined: 24 May 2008
Posts: 10
Location: bangalore

PostPosted: Sat Jul 12, 2008 11:54 am
Reply with quote

HI guys,
thank you for the reply. i think i have bothered you all a lot by my earlier reply. Actually i gave that reply to confirm that i have seen the solution provided by you all. actually, by my last reply i meant to say that i will check that and get back to you but it was misdrafted and bothered you all.
thanks again for the solution guys.
next time i will reply only after testing the solutions provided.
have a good day.
thanks,
keyarika
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts To get the count of rows for every 1 ... DB2 3
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top