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
 

 

Duplicate Records removal question

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Abhijat Sinha

New User


Joined: 22 Jun 2007
Posts: 11
Location: India

PostPosted: Thu Oct 11, 2007 10:22 am    Post subject: Duplicate Records removal question
Reply with quote

Hi,
I have a following set of input data
Code:

col1  col2  col3  col4
======================
001    aaa   1234  xxx
002    aaa   5678  xxx
003    aaa   1234  xxx
004    aaa   5678  xxx

When i try to use the ICEMAN to sort these records on the basis of following sort card -
Code:

SORT FIELDS=(col2,03,CH,A,col4,03,CH,A,col3,04,CH,A)
SUM FIELDS=NONE                                                       

we are getting the follwing out put-
Code:

col1  col2  col3  col4
======================
001    aaa   1234  xxx
004    aaa   5678  xxx


Now I was expecting 001 and 002 in the col1 instead am getting 001 and 004. Is there any specific reason for this specific type of data? Can anyone please explain how the data was processed to get me the above result?

Thank you,
Back to top
View user's profile Send private message

nuthan

Active User


Joined: 26 Sep 2005
Posts: 146
Location: Bangalore

PostPosted: Thu Oct 11, 2007 10:32 am    Post subject:
Reply with quote

Try with SORT FIELDS=(col2,03,CH,A,col4,03,CH,A,col3,04,CH,A), EQUALS
SUM FIELDS=NONE
Back to top
View user's profile Send private message
Aaru

Senior Member


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

PostPosted: Thu Oct 11, 2007 10:57 am    Post subject: Reply to: Duplicate Records removal question
Reply with quote

This is what i got when i tried with your sort card

Code:
//S1    EXEC  PGM=SORT                                   
//SYSOUT    DD  SYSOUT=*                                 
//SORTIN DD *                                             
001    AAA   1234  XXX                                   
002    AAA   5678  XXX                                   
003    AAA   1234  XXX                                   
004    AAA   5678  XXX                                   
/*                                                       
//SORTOUT DD SYSOUT=*                                     
//SYSIN    DD    *                                       
 SORT FIELDS=(8,3,CH,A,20,3,CH,A,14,4,CH,A)               
 SUM FIELDS=NONE                                         
/*                                                       


output:

Code:
001    AAA   1234  XXX
002    AAA   5678  XXX
Back to top
View user's profile Send private message
Abhijat Sinha

New User


Joined: 22 Jun 2007
Posts: 11
Location: India

PostPosted: Thu Oct 11, 2007 12:12 pm    Post subject:
Reply with quote

Hi Nuthan,
The sort card with EQUALS worked. But is there any explanation for this? Is there any link for this EQUALS that i can go through?

Thanks.

Aaru,
I tried to run your JCL itself but i got 001 and 004 itself instead of your suggested 001 and 002. Can you please re-check?

Thank you
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: Thu Oct 11, 2007 12:25 pm    Post subject:
Reply with quote

Hello,

Quote:
The sort card with EQUALS worked. But is there any explanation for this?
EQUALS tells the process to preserve the original order of the data within the "sort keys". If EQUALS is not specified, the order of the data will be unpredictable beyond the specified keys.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Oct 11, 2007 12:48 pm    Post subject:
Reply with quote

Check this link http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1ca20/3.12?ACTION=MATCHES&REQUEST=EQUALS&TYPE=FUZZY&SHELF=ICE1SH20.bks&DT=20060615185603&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT for the topic OPTION Control Statement.
and http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1ca20/3.16?ACTION=MATCHES&REQUEST=EQUALS&TYPE=FUZZY&SHELF=ICE1SH20.bks&DT=20060615185603&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT for SORT Control Statement.

Also for performance recomendations look at Avoid Options That Might Degrade Performance here http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1cg20/2.9.11?ACTION=MATCHES&REQUEST=EQUALS,option&SHELF=ICE1SH20.bks&DT=20060615173822&TYPE=FUZZY&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT
Back to top
View user's profile Send private message
Aaru

Senior Member


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

PostPosted: Thu Oct 11, 2007 3:03 pm    Post subject: Reply to: Duplicate Records removal question
Reply with quote

Abhijat,

Quote:
Aaru,
I tried to run your JCL itself but i got 001 and 004 itself instead of your suggested 001 and 002. Can you please re-check?


I ran the same JCL again and the output is still the same (001 and 002).
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: Thu Oct 11, 2007 9:19 pm    Post subject:
Reply with quote

Aaru,

Your site default is probably EQUALS. Abhijit's site default is NOEQUALS. DFSORT is shipped with NOEQUALS as the default, but the site can change that to EQUALS.

If you're using DFSORT (and I'm not sure you are), you can see the value for EQUALS in message ICE128I ... it will have EQUALS=N or EQUALS=Y.

You can try using:

Code:

   OPTION NOEQUALS


to turn off EQUALS and see what you get. However, you still might get 001 and 002 since with NOEQUALS, either record can be kept.

The only way to ensure that the first record is kept is to use EQUALS.
Back to top
View user's profile Send private message
Aaru

Senior Member


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

PostPosted: Fri Oct 12, 2007 10:48 am    Post subject: Reply to: Duplicate Records removal question
Reply with quote

Frank,

You are correct. Had a look at the sysout and found that the option EQUALS is in effect.

Code:
WER072I  EQUALS IN EFFECT


Thanks a ton.
Back to top
View user's profile Send private message
venktv

New User


Joined: 29 Mar 2006
Posts: 59
Location: Montreal

PostPosted: Fri Oct 12, 2007 4:50 pm    Post subject:
Reply with quote

With EQUALS, the SORT program will give the first record of the identical records(duplicate records) found when it sorts.

WIth regs
Venkat
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: Fri Oct 12, 2007 8:55 pm    Post subject:
Reply with quote

Aaru,

As I guessed, you're using Syncsort (WER messages), not DFSORT.

Since this is the DFSORT Forum and you can't test with DFSORT, your results will not always be relevant. You might want to think about that, especially in regard to making statements about what works for you since DFSORT and Syncsort do have differences.
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 Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am
No new posts The Last Two Question For You To Ask ... CaptBill Mainframe Interview Questions 0 Fri Apr 14, 2017 5:42 am
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am


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