View previous topic :: View next topic
|
Author |
Message |
keyarika
New User
Joined: 24 May 2008 Posts: 10 Location: bangalore
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
keyarika
New User
Joined: 24 May 2008 Posts: 10 Location: bangalore
|
|
|
|
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 |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
I think keyarika has missed the keword "NODETAIL"
Gerry |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
keyarika
New User
Joined: 24 May 2008 Posts: 10 Location: bangalore
|
|
|
|
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 |
|
|
|