Eleminating Duplicates using SELECT and LASTDUP.



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Eleminating Duplicates using SELECT and LASTDUP.

Postby Viswanathchandru » Wed May 14, 2014 2:20 am

Hi All,

I have to remove duplicates from a flat file. I tried using SELECT (DFSORT) along with LASTDUP it removed the duplicates as expected. The sort card was like this.

SELECT FROM(IN) TO(OUT) ON(32,8,CH) LASTDUP


But, the problem is, there were few records like this which had duplicates.

 
    MAILABQ
    MAILTRN
    MAILLOM
    MAIEDD
    MAILWER


For the above record, it has removed all the data and it has given only MAILWER. Is there a way I can get the proper record.

My record length is 800.

Thanks,
Viswa..
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: Eleminating Duplicates using SELECT and LASTDUP.

Postby enrico-sorichetti » Wed May 14, 2014 2:31 am

hard to believe, that any SORT flavor would drop on its own part of a record :shock:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Eleminating Duplicates using SELECT and LASTDUP.

Postby dick scherrer » Wed May 14, 2014 2:53 am

Hello,

What do the informational messages show?

It may help if you post the complete JCL and control statements.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Eleminating Duplicates using SELECT and LASTDUP.

Postby Viswanathchandru » Wed May 14, 2014 2:58 am

Hello Mr. Scherrer,

I'm not getting any error messages and the JCL goes with RC 0. Here is the JCL..

//S1 EXEC PGM=ICETOOL                       
//TOOLMSG DD SYSOUT=*                       
//DFSMSG DD SYSOUT=*                         
//IN DD DSN=VENUS3V.IN.TEXT2,DISP=SHR     
//OUT DD DSN=VENUS3V.IN.TEXT2,DISP=SHR   
//TOOLIN DD *                               
 SELECT FROM(IN) TO(OUT) ON(32,8,CH) LASTDUP


Hello Mr. Enrico,

I don't think sort is doing it wrong ! I'm 90% sure I'm going somewhere wrong ! so, thought of checking with experts..

Thanks,
Viswa..
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: Eleminating Duplicates using SELECT and LASTDUP.

Postby NicC » Wed May 14, 2014 3:01 am

definitely the control statements and the sysout. Sample input/output would be good.

What the heck is
SELECT(DFSORT)
?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Eleminating Duplicates using SELECT and LASTDUP.

Postby dick scherrer » Wed May 14, 2014 3:02 am

Hello,

"Some" informational messages Are generated, unless they have been discarded somehow.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Eleminating Duplicates using SELECT and LASTDUP.

Postby dick scherrer » Wed May 14, 2014 3:03 am

Hi Nic,

TS is just saying SELECT was used, I believe.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Eleminating Duplicates using SELECT and LASTDUP.

Postby NicC » Wed May 14, 2014 3:09 am

Then why mention DFSORT when we are in the Syncsort section of the forum? The (conveniently forgotten/not found) messages would have told us.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Eleminating Duplicates using SELECT and LASTDUP.

Postby Viswanathchandru » Wed May 14, 2014 3:19 am

Hi ,

My apologies, I didn't notice a seperate section for DFSORT. If someone could please move this topic to DFSORT it will be helpful !

Thanks,
Viswa..
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: Eleminating Duplicates using SELECT and LASTDUP.

Postby enrico-sorichetti » Wed May 14, 2014 3:20 am

//IN DD DSN=VENUS3V.IN.TEXT2,DISP=SHR     
//OUT DD DSN=VENUS3V.IN.TEXT2,DISP=SHR   


using as output the same dataset used for input is looking for troubles
usually unpredictable behavior

try again using the proper approach ( a different output dataset )
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post