View previous topic :: View next topic
|
Author |
Message |
Narendra Bade
New User
Joined: 12 Oct 2010 Posts: 13 Location: Pune
|
|
|
|
Need your help as It is urgent required for my project.
I get file from my upstream which contains data of fixed length.
I want to create other file , which will eliminate all duplicate records taking key as starting position = 1 and length =10 .
That key should use first 10 column for search for duplicate.
If I use sort fields = ( 1,10,CH,A) SUM FIELDS=NONE then as it takes first 10 column as key to find duplicate in whole file , instead of that I want , key should use only 10 column of file to search duplicate!!
Input :
12345678901234567890
56789678901234567890
12345678902162061853
12345678901234567850
34545678911234567890
current output :
12345678901234567890
12345678902162061853
12345678901234567850
My Expected output :
12345678901234567890
56789678901234567890
34545678911234567890 |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
Need your help as It is urgent required for my project. |
we do not do urgent,
remember... replying is
on voluntary basis,
on the responders time and equipment
free of charge
if You want things done according to Your timings You should get a paid consultant ! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Move the SUM FIELDS to the next line. It is being ignored. . . |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
great catch, Dick!
i was thinking about telling him to provide a sysout display,
but this being Frank's domain,
i hesitate to post,
but since you did, i will/have. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
With this input:
Code: |
12345678901234567890
56789678901234567890
12345678902162061853
12345678901234567850
34545678911234567890 |
and considering only first 10-digits as key to eliminate duplicates, you'll get:
Code: |
12345678901234567890
34545678911234567890
56789678901234567890 |
and not what you show. In the output I show, 2nd and 3rd record are shuffled with each other compared to what you show. So, what do you want? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Dick,
Thanks
I also suspect that Syncsort is being used. . . .
d |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
dick scherrer wrote: |
Thanks |
Do you guys watch Cricket in U.S.? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Baseball catch, maybe?
Football (American) catch? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
chriwho? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
as in ' i caught him *******-up'! |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
i was thinking about telling him to provide a sysout display,
but this being Frank's domain,
i hesitate to post,
but since you did, i will/have. |
JCL Forum is NOT my "domain", DFSORT Forum is. I always try to make sure that posts in the DFSORT Forum are answered. I sometimes post in the JCL Forum. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
I just wonder if Narendra Sahebrao Bade has this working now. . . |
|
Back to top |
|
|
Narendra Bade
New User
Joined: 12 Oct 2010 Posts: 13 Location: Pune
|
|
|
|
Hi Dick ,
Looking at your catch , I suggest ,you should learn Gilli-Danda to know what is exactly catch means .
Hi Anuj,
Can you give me sort card which will only eliminate duplicates in the first 10 columns of file.
Sort Card that i have used:
SORT FIELDS=(1,10,CH,A)
SUM FIELDS=NONE
Here , it is using first 10 columns ro remove duplicates in whole file ? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
using first 10 columns ro remove duplicates in whole file |
What do you mean by this? Your sort will remove duplicate keys in pos 1-10 as shown above by Anuj.
If that is not what you want show some example with input records and the expected output. |
|
Back to top |
|
|
Narendra Bade
New User
Joined: 12 Oct 2010 Posts: 13 Location: Pune
|
|
|
|
I get my answer.
Thank you Dick , Anuj , arun , frank , enrico. |
|
Back to top |
|
|
Narendra Bade
New User
Joined: 12 Oct 2010 Posts: 13 Location: Pune
|
|
|
|
Sorry for giving incorrect information.
SORTIN file is in VB format and SORTOUT file is in FB format.
To get expected output , I should used
SORT FIELDS=(5,10,CH,A)
SUM FIELDS=NONE
Sorry guys for wasting your time |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Well, you're not making much sense, Naren.
In your first post, You showed us some sample records from input - I, for one, will pick them up as in-stream data for SORTIN (or IN) and will try to get a SORT card on the fly to get the expected-output. In-stream data will be treated as FB/80; so yes, it was incorrect information since start.
Also, you did not notice the other post of mine in this thread which talks about the order of records. I'm not sure if you got it really working for you or not but I was thinking that you might need to use EQUALS possibly, per the output you show.
Just an aside, EQUALS will keep the duplicate records in their original order, but will not keep all of the records in their original order. For that, you need two passes over the data. Though it can get site-specific but I thought it's worth mentioing about it here. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thank you for letting us know
d |
|
Back to top |
|
|
|