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
 
Need help with ICETool

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

New User


Joined: 21 Jul 2006
Posts: 39
Location: US

PostPosted: Fri Jan 30, 2009 8:22 am    Post subject: Need help with ICETool
Reply with quote

Hi,
I have a file which has records as:

1234 1
1234 271
1233 1
1255 1
1276 1
1276 271

I want the unique records as well as the first record out of duplicates. Expected O/P :
1234 1
1233 1
1255 1
1276 1

I am using a SORT step to SORT by the 2 fields and tthen ICETOOL .
SELECT FROM(IN) TO(OUT) ON(2,20,CH) FIRSTDUP.

But this is eliminating all the unique records. Now my O/P looks like below which not what I need:
1234 1
1276 1
Please help me at the earliest!
Thanks!
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: Fri Jan 30, 2009 9:06 am    Post subject:
Reply with quote

Hello,

Try this:
Code:
SORT FIELDS=(your sort fields from the unposted sort step)
SUM FIELDS=NONE

I believe the output of this one SORT step will be what you want.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Fri Jan 30, 2009 9:28 am    Post subject:
Reply with quote

shilpa.khaire,

How about trying FIRST instead of FIRSTDUP.
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: Fri Jan 30, 2009 9:31 am    Post subject:
Reply with quote

Hi Arun,

If done in the sort step, would it not save a step and an extra read/write of the file?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Jan 30, 2009 9:34 am    Post subject:
Reply with quote

Hi,

I believe a seqnum will need to be added and output resorted as the the requested output is not in ascending order.


Gerry
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Jan 30, 2009 10:10 am    Post subject:
Reply with quote

Hi Dick,

I believe we need more information, if 1234 1 covers the 2 fields, ie.

1234 is field1 and 1 is field2, and
1234 is field1 and 271 is field2, the sum fields=none will not delete any records.


Gerry
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: Fri Jan 30, 2009 10:21 am    Post subject:
Reply with quote

Hi Gerry,

Good catch - i misread icon_redface.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Fri Jan 30, 2009 10:46 am    Post subject:
Reply with quote

dick scherrer wrote:
Hi Arun,

If done in the sort step, would it not save a step and an extra read/write of the file?
Hi Dick,

I believe we dont need to have an extra SORT while using SELECT.
If the OP is interested in retaining the input order, then I would agree with Gerry. But I dont undertand the purpose of 'sorting on 2 fields' and the expected output is
Code:
1234 1
1233 1
1255 1
1276 1
instead of
Code:
1233 1
1234 1
1255 1
1276 1
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 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 Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Group elements using ICETOOL Learncoholic DFSORT/ICETOOL 2 Fri Apr 14, 2017 11:01 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm

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