Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Icetool to get all unique's and last duplicate

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Icetool to get all unique's and last duplicate
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10374
Location: italy

PostPosted: Wed Sep 07, 2011 9:36 pm    Post subject: Reply to: Icetool to get all unique's and last duplicate
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 http://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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Wed Sep 07, 2011 10:52 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Sep 08, 2011 3:52 am    Post subject:
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    Post subject:
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    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 ICETOOL - RESIZE DYNAMICALLY kranthikumarb DFSORT/ICETOOL 0 Tue Nov 21, 2017 5:30 pm
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us