Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Can we change the order of SORTING

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
bipinpeter

Active User


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

PostPosted: Mon May 04, 2009 5:44 pm    Post subject: Can we change the order of SORTING
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    Post subject:
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: 208
Location: Cochin/Kerala/India

PostPosted: Mon May 04, 2009 6:26 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon May 04, 2009 6:33 pm    Post subject:
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: 208
Location: Cochin/Kerala/India

PostPosted: Mon May 04, 2009 6:43 pm    Post subject:
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 Moderator


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

PostPosted: Mon May 04, 2009 9:29 pm    Post subject:
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: 208
Location: Cochin/Kerala/India

PostPosted: Tue May 05, 2009 11:39 am    Post subject:
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 Moderator


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

PostPosted: Tue May 05, 2009 8:55 pm    Post subject:
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:

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

and do a find for LOCALE in:

http://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: 208
Location: Cochin/Kerala/India

PostPosted: Wed May 06, 2009 5:12 pm    Post subject:
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    Post subject:
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: 208
Location: Cochin/Kerala/India

PostPosted: Thu May 07, 2009 2:11 pm    Post subject:
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    Post subject:
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: 208
Location: Cochin/Kerala/India

PostPosted: Thu May 07, 2009 8:41 pm    Post subject:
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 Moderator


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

PostPosted: Thu May 07, 2009 9:55 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Efficient sorting chandracdac DFSORT/ICETOOL 5 Sat Oct 22, 2016 3:23 am
No new posts Stripping and Sorting of VB file G SRINIVASA RAO SYNCSORT 5 Wed Sep 14, 2016 1:34 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am
No new posts How to change dataset attributes of m... ignich7 JCL & VSAM 3 Thu Jul 21, 2016 9:17 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us