IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can we change the order of SORTING


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Mon May 04, 2009 5:44 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon May 04, 2009 5:51 pm
Reply with quote

look at ALTSEQ ... in the Sort Manuals

or do a search in this forum for ALTSEQ
Back to top
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Mon May 04, 2009 6:26 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon May 04, 2009 6:33 pm
Reply with quote

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
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Mon May 04, 2009 6:43 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon May 04, 2009 9:29 pm
Reply with quote

You can use AC format to do what you want. For example:

Code:

    SORT FIELDS=(5,4,AC,A)
Back to top
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Tue May 05, 2009 11:39 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue May 05, 2009 8:55 pm
Reply with quote

Yes, you can use LOCALE with DFSORT. You just need to know the name of the LOCALE you want to use and then you can specify something like:

Code:

...
//DFSPARM DD *
  OPTION LOCALE=name
  SORT FIELDS=(5,4,CH,A)
/*


DFSORT will use the LOCALE for all CH sort fields.

See the following for more information:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA30/1.5.3?DT=20080528171007

and do a find for LOCALE in:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA30/3.12?DT=20080528171007
Back to top
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Wed May 06, 2009 5:12 pm
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed May 06, 2009 9:22 pm
Reply with quote

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
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Thu May 07, 2009 2:11 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu May 07, 2009 4:38 pm
Reply with quote

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
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Thu May 07, 2009 8:41 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu May 07, 2009 9:55 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Rotate partition-logical & physic... DB2 0
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts 3270 personal communications. Can't c... TSO/ISPF 2
No new posts SELECT from data change table DB2 5
No new posts Trying to change copybook in online c... CICS 4
Search our Forums:

Back to Top