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

Icetool to get all unique's and last duplicate


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

New User


Joined: 11 Nov 2008
Posts: 11
Location: Pune

PostPosted: Wed Sep 07, 2011 9:24 pm
Reply with quote

Hi,


I have one requirement in which I need to keep the last duplicate(if there is any) as well as all the unique records in a single file.My input is a single file and single output file.

What i have done is below :

SELECT FROM(SYSUT1) TO(SYSUT2) ON(1,3,CH) NODUPS

it is getting me all the unique records.I want to have the last duplicate as well in this sort card.

data sample:

aaa 230
aaa 120
bbb 200
ccc 500
bbb 200

o/p shud be :

aaa 120
bbb 200
ccc 500


Kindly suggest


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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 07, 2011 9:36 pm
Reply with quote

what happened when You searched the forums with
keep last duplicate checking search for all terms
and clicked on the sixth topic returned ( the one with urgent ) (*)


To make the most out of the questions You ask it would be worth to read and meditate on
How To Ask Questions The Smart Way
here catb.org/~esr/faqs/smart-questions.html

(*) most probably You just did not care to do a bit of homework before posting icon_cool.gif
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Sep 07, 2011 9:37 pm
Reply with quote

aishvarya_82,

You need to use the Parm LAST on select operator. Use the following DFSORT/ICETOOL JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL             
//TOOLMSG  DD SYSOUT=*                   
//DFSMSG   DD SYSOUT=*                   
//IN       DD *                         
AAA 230                                 
AAA 120                                 
BBB 200                                 
CCC 500                                 
BBB 200                                 
//OUT      DD SYSOUT=*                   
//TOOLIN   DD *                         
  SELECT FROM(IN) TO(OUT) ON(1,3,CH) LAST
//*
Back to top
View user's profile Send private message
THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Wed Sep 07, 2011 9:40 pm
Reply with quote

Hi,

can you tell me in what order the output is displayed.
Ideally if you are picking the last duplicate record then the output would have been as follows.

aaa 120
ccc 500
bbb 200

Do you want it in any specific order?
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: Wed Sep 07, 2011 10:52 pm
Reply with quote

Elo,

I don't understand your question. Kolusu's job gives the output and order requested in the op's first post.

Quote:

o/p should be :

aaa 120
bbb 200
ccc 500
Back to top
View user's profile Send private message
THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Thu Sep 08, 2011 3:29 am
Reply with quote

Hi Frank,

That was a question I posted to aishvarya_82.
I wanted to know if she wanted the output to maintain the same order as that of input.

i.e

Input:

aaa 230
aaa 120
bbb 200
ccc 500
bbb 320

Output:

aaa 120
ccc 500
bbb 320

Since such a scenario was not taken into consideration,I wanted aishvarya_82 to clarify that.
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: Thu Sep 08, 2011 3:52 am
Reply with quote

She did show the output she wanted in her first post as sorted - so I guess you're asking if she got it wrong and didn't realize it.
Back to top
View user's profile Send private message
THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Thu Sep 08, 2011 3:58 am
Reply with quote

Yes Frank you are right.
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 Duplicate transid's declared using CEDA CICS 3
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
Search our Forums:

Back to Top