View previous topic :: View next topic
|
Author |
Message |
amrita.chatterjee
New User
Joined: 27 Apr 2006 Posts: 48 Location: Bangalore, India
|
|
|
|
3829363
3829954
3836931
51005199
8432818
8432819
I have to sort these field but when I'm doing the sort..the result is coming like above..but it should come like below..
3829363
3829954
3836931
8432818
8432819
51005199
Anyone can help me in this regards... |
|
Back to top |
|
|
amrita.chatterjee
New User
Joined: 27 Apr 2006 Posts: 48 Location: Bangalore, India
|
|
|
|
I hope, in my last mail I have mention my problem clearly. I have to sort a column of the input File.
Say input File is
13245
1234
1563
So I have to specify the SYSIN card as
SORT FIELDS=(1,5,CH,A)
& the result should come as below.
1234
1563
13245
But it is coming like below.
1234
13245
1563
because it is padding the 4 digit number with zeros. But I don't want this.
I want to sort the field & and i'm expecting a result as
1234
1563
13245
So can anyone help me in this regards...
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
surya_pathaus
Active User
Joined: 28 Aug 2006 Posts: 110
|
|
|
|
Hi Frank,
For me "UFF" is giving abend. It is giving U268 abend.
I think in our SHOP SYNCSORT release is not holding this format.
Is there any other way to do the above query? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
UFF works fine with DFSORT. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort. |
|
Back to top |
|
|
kbmkris
Active User
Joined: 24 Jun 2006 Posts: 101
|
|
|
|
amrita.chatterjee wrote: |
I hope, in my last mail I have mention my problem clearly. I have to sort a column of the input File.
Say input File is
13245
1234
1563
So I have to specify the SYSIN card as
SORT FIELDS=(1,5,CH,A)
& the result should come as below.
1234
1563
13245
But it is coming like below.
1234
13245
1563
because it is padding the 4 digit number with zeros. But I don't want this.
I want to sort the field & and i'm expecting a result as
1234
1563
13245
So can anyone help me in this regards...
:( |
hi,
i can suggest you to use numbers of equal size. that is you itself pad zero's to the numbers in the left as that's the normal procedure to do.e.g
if you want to sort the following numbers
1
13
155
12345
then mention it like
00001
00013
00155
12345
if there is any other way if you have come across means update us.
Thanks,
Bala |
|
Back to top |
|
|
shivsingla Warnings : 1 New User
Joined: 14 Jul 2006 Posts: 15 Location: New Delhi
|
|
|
|
hi amrita
plz try this below thing
SORT FIELDS=(1,5,FS,A)
IT WILL WORK DEFINITELY
SHIV |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Yeap it is wrkg...
Thanks SHiv |
|
Back to top |
|
|
kbmkris
Active User
Joined: 24 Jun 2006 Posts: 101
|
|
|
|
shivsingla wrote: |
hi amrita
plz try this below thing
SORT FIELDS=(1,5,FS,A)
IT WILL WORK DEFINITELY
SHIV |
hi shiv,
can you tell what 'FS' stands for? And what are all the other options we can use for that?
Thanks,
Bala |
|
Back to top |
|
|
IQofaGerbil
Active User
Joined: 05 May 2006 Posts: 183 Location: Scotland
|
|
|
|
FS will NOT work definitely if you have no records with 4 or more characters in your input file. Always test the extremes!
eg try this
132
15
12
with
SORT FIELDS=(1,5,FS,A)
I get;
132
15
12
ie the same order as input
I don't know why maybe Frank can explain.
Use Frank's method he knows best. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
FS is NOT appropriate for this kind of data. FS extracts the digits from right to left. However, the first non-decimal digit (that is, 0-9) going from right to left is treated as the sign and anything else to the left of the sign is ignored. So for a value in positions 1-5, a blank in position 4 will give you a 0 value.
Thus, with 1,5,FS, here's how various values are interpreted:
Code: |
12345 -> 12345
1234 -> 00000
123 -> 00000
12 -> 00000
1 -> 00000
|
If you sorted these values with (1,5,FS,A), you'd get:
Code: |
1234
123
12
1
12345
|
Definitely not what you want.
UFF extracts the digits right to left wherever it finds them and ignores non-digits. So with 1,5,UFF, here's how the various values are interpreted:
Code: |
12345 -> 12345
1234 -> 01234
123 -> 00123
12 -> 00012
1 -> 00001
|
If you sorted these values with (1,5,UFF,A), you'd get:
Code: |
1
12
123
1234
12345
|
which is what you want. |
|
Back to top |
|
|
kbmkris
Active User
Joined: 24 Jun 2006 Posts: 101
|
|
|
|
Frank.
Thanks for your detailed explanation.
And thanks for all who have provided a suggestion.
Bala |
|
Back to top |
|
|
sai_n
New User
Joined: 09 Sep 2006 Posts: 3 Location: chennai
|
|
|
|
can some one tell me what 'FS' and UFF stands for. |
|
Back to top |
|
|
|