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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: get count after eliminating dups...using single sort parm.
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    Post subject: Reply to: get count after eliminating dups...using single so
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    Post subject: Reply to: get count after eliminating dups...using single so
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: 1288
Location: Chennai, India

PostPosted: Tue Jun 17, 2008 5:25 pm    Post subject: Reply to: get count after eliminating dups...using single so
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 Moderator


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

PostPosted: Tue Jun 17, 2008 9:41 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Jun 18, 2008 5:02 am    Post subject:
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

Site Director


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

PostPosted: Wed Jun 18, 2008 6:21 am    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Jun 18, 2008 6:34 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Wed Jun 18, 2008 12:47 pm    Post subject: Reply to: get count after eliminating dups...using single so
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    Post subject: Reply to: get count after eliminating dups...using single so
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    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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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