View previous topic :: View next topic
|
Author |
Message |
bipinpeter
Active User
Joined: 18 Jun 2007 Posts: 213 Location: Cochin/Kerala/India
|
|
|
|
Hi All,
When we are sorting a file,normally it will sort based on EBCDIC collating sequence order,like space,lower case,upper case,numeric. Can we change this order??
Regards,
Bipin Peter |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
look at ALTSEQ ... in the Sort Manuals
or do a search in this forum for ALTSEQ |
|
Back to top |
|
|
bipinpeter
Active User
Joined: 18 Jun 2007 Posts: 213 Location: Cochin/Kerala/India
|
|
|
|
I saw the ALTSEQ command,for that i've to give for 10 values for numeric(0-9),52 values for alphabets(upper case and lower case),so the code will be huge.Is any other way to do this?
Regards,
Bipin Peter |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
It may be possible, but you need to explain exactly what you want to achieve, giving examples of both input and output required. Also the usual suspects, RECFM and LRECL. |
|
Back to top |
|
|
bipinpeter
Active User
Joined: 18 Jun 2007 Posts: 213 Location: Cochin/Kerala/India
|
|
|
|
My requirement is follows,
I'll have a file with data with numeric,upper case,lowe case,and spaces.
If i sort that the order of data will be spaces,lowe case,upper case and numeric.
but i want it in the order of spaces,numeric,upper case and lowe case
Bipin Peter |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use AC format to do what you want. For example:
Code: |
SORT FIELDS=(5,4,AC,A)
|
|
|
Back to top |
|
|
bipinpeter
Active User
Joined: 18 Jun 2007 Posts: 213 Location: Cochin/Kerala/India
|
|
|
|
Hi Frank,
Thanks..It worked..
One more help...
If my input file has german charatcters now its coming at the top..i want it in bottom..is it possible..
Can we use LOCALE??? whats is its use and format which to be use?
Regards,
Bipin Peter |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
bipinpeter
Active User
Joined: 18 Jun 2007 Posts: 213 Location: Cochin/Kerala/India
|
|
|
|
Hi Frank,
I used LOCALE,but i'm not getting the expected result.One doubt...I read that if we give LOCALE=NONE,it will go for the default code page..What is the default code which is used in DFSORT and Can we override the code page.I mean that can we give any other code page?
Regards,
Bipin Peter |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Bipinpeter,
when you specify LOCALE=NONE, DFSORT will use the binary encoding of the code page defined for your data for collating and comparing. Since you are having issues with german character, use LOCALE=DE_DE.IBM-1047
The locale for the German language and the cultural conventions of Germany based on the IBM-1047 encoded character set will be active. The character (CH) control field will be SORTED according to the collating rules defined in locale De_DE.IBM-1047.
Code: |
//DFSPARM DD *
SORT FIELDS=(5,4,CH,A)
OPTION LOCALE=DE_DE.IBM-1047
/* |
|
|
Back to top |
|
|
bipinpeter
Active User
Joined: 18 Jun 2007 Posts: 213 Location: Cochin/Kerala/India
|
|
|
|
Hi Skolusu,
i'm not getting the expected result,
I want the output in below order,
spaces
numeric
upper case(english)
lower case(english)
german characters
Bipin Peter |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Bipin Peter,
what you are asking for is ascii sequence with an exception of the 6 german characters (ö,ü,ä,Ö,Ü,Ä).
since that is not a normal sort of anything,
you would probably have to use the AC option to sort the english
and then code some control cards to force the german chars to follow the lower case z.
do you want the german to be sorted upper then lower, also?
or you are back to ALTSEQ for all. |
|
Back to top |
|
|
bipinpeter
Active User
Joined: 18 Jun 2007 Posts: 213 Location: Cochin/Kerala/India
|
|
|
|
I want the german to be sorted upper the lower..
When i using the ' AC' in sort card,i'm getting result in below order..
Spaces
Geman(upper case)
numeric
English upper case..
English lower..
German lower..
Bipin Peter |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
i'm not getting the expected result |
When using the German LOCALE?
If so, then the problem is that the German LOCALE does not do what you want. I would think that the German LOCALE would be set up to do what is normally required for the language. So it sounds like you want to do something different for some reason.
If you can't find a LOCALE that does what you want, then the only way to do it is to set up an ALTSEQ table that will do what you want, and use AQ for the fields you want to sort using that ALTSEQ table. |
|
Back to top |
|
|
|