View previous topic :: View next topic
|
Author |
Message |
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
I have a file with characters, alphanumeric, decimal and signed decimal fields.
I need to sort this file to remove duplicates comparing record wise and not field wise.
eg:
0001 ashimer -903 xcd
0001 ashimer -903 xcd
0201 ashimer -913 xcd
the o/p should have only
0001 ashimer -903 xcd
0201 ashimer -913 xcd
Any help ? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
RECFM=
LRECL= |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
What about
SORT FIELDS=(1,length of record,CH,A)
SUM FIELDS=NONE |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
RECFM=FB, LRECL=800 |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Code: |
SORT FIELDS=(1,800,CH,A)
SUM FIELDS=NONE
|
Do you need anything else?
With what input you have given with above sort card you will get desired output.
[/code] |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
Hi Sambhaji,
The record contains not only characters but also decimal, signed decimal fields too .. as the LRECL is big i dont want to split the sort keys according to their types .... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello Ashimer,
The CH type should work for what you want to do. |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
No Dick, CH type is not working ... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
No Dick, CH type is not working ... |
Quote: |
The record contains not only characters but also decimal, signed decimal fields too .. as the LRECL is big i dont want to split the sort keys according to their types |
CH would work with the example records you showed, but you are implying that example does not illustrate the different types of data you have to deal with. You should have shown an example that does illustrate that point (one where CH does not work).
You are contradicting yourself. If the record contains different types of fields, then you must split the sort keys according to their type. For example, you need to use SFF to handle a sddd.dd field, not CH. There's no magic format that you can use for every data type - that's why we have different formats for different data types. |
|
Back to top |
|
|
|