Date: Mon, 1 Oct 2001 19:09:23 +0100
Reply-To: Peter Crawford <peter.crawford@DB.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Peter Crawford <peter.crawford@DB.COM>
Subject: Re: PROC SORT
Content-type: text/plain; charset=iso-8859-1
Hi Jack
in an "almost production" context I used the sortseq EBCDIC when using sas/connect MPconnect to distribute preparations for a multi-way merge on the mainframe.
In an earlier posting to sas-l, I was asking why the batch job was looking for sasuser.profile when I used proc sort option ebcdic.
Unfortunately no-one offered much explanation.
Perhaps personal trantabs are sought before the sort proc uses the sashelp.host trantab for ebcdic collating sequence.
With globalisation of warehouses, National Language Support might have to become more sophisticated. We may need to ensure a global translate table will provide more than "pan-european" language support. I don't know how far this will go, but our applications have names from all around the world.
On one ods report/listing/rtf/webpage I need to see Scandanavian and Spanish, SouthAmerican and Japaneese ++
.... Greek/Turkish/Israeli/Ababic must coexist - at least in our counterparty file of borrower names !
Not hundreds of translate tables, but two == to and from ebcdic === perhaps also upper and lower case translation.
I might have to come along to see your paper.
Regards
Peter
Datum: 01/10/2001 17:25
An: Peter Crawford/Zentrale/DeuBaExt@Zentrale
SAS-L@LISTSERV.UGA.EDU
Betreff: Re: PROC SORT
Nachrichtentext:
This is an interesting and apparently little-used feature of PROC SORT. I wonder if it is better known outside the USA, where the idea of using a different character set is not so unheard-of.
Coincidentally, I turned in a SUGI paper proposal on PROC SORT which discusses the SORTSEQ option; I don't know whether it will be accepted. It's straightforward to use, but deciding which of the hundreds of translation tables to use in any given situation might be problematic. Unicode will eventually solve these problems, I suppose.
--
JackHamilton@FirstHealth.com
Development Manager, Technical Group
METRICS Department, First Health
West Sacramento, California USA
>>> "Peter Crawford" <peter.crawford@DB.COM> 10/01/2001 4:53 AM >>>
A national language support feature provides a useful clue for a
simple solution here. From the on-line doc for proc trantab, it is
clear that one of the default translation tables is for lower to upper
case translation. You only have to define this translate table on the
SORTSEQ= option of the proc sort statement.
The actual value is obviously platform dependant. I found the
default val;ue (SASUCS) shown on on-line doc not valid for
my UK SAS v8.1 on winNT. Instead WLT1_UCS works just fine !
data names;
length name $32;
input name & ;
datalines;
Hold
Keep
private Lives
counterparty ID
;
proc sort OUT=NORMAL;
by name;
run;
dm 'fsv';
proc sort sortseq=WLT1_UCS out=w_ucs;
by name;
run;
dm 'fsv';
produces these windows
+FSVIEW: WORK.NORMAL (B)---------------------+
| Obs name |
| |
| 1 Hold |
| 2 Keep |
| 3 counterparty ID |
| 4 private Lives |
| |
+---------------------------------------------+
+FSVIEW: WORK.W_UCS (B)----------------------+
| Obs name |
| |
| 1 counterparty ID |
| 2 Hold |
| 3 Keep |
| 4 private Lives |
| |
+---------------------------------------------+
Looks like the simplest way to provide "case-insensitive" sorting !
regards
Peter Crawford
Datum: 01/10/2001 09:40
An: SAS-L@LISTSERV.UGA.EDU
Antwort an: "Karsten M. Self" <kmself@IX.NETCOM.COM>
Betreff: Sort w/ folded case (was Re: PROC SORT)
Nachrichtentext:
on Mon, Oct 01, 2001 at 01:01:59AM -0700, ninon (ndavi@AUFEMININ.COM) wrote:
> Hi,
>
> I want to sort a data set with small letter and capital letter
> like :
>
> Before the sort the data set is :
>
> Paris
> London
> Bruxelle
> france
> belgique
>
> After the sort the data set is :
>
> belgique
> Bruxelle
> france
> London
> Paris
>
> with a PROC SORT how I do it ?
> THANKS
> NINON
I'd pick SQL instead:
proc sql;
create table mydata as
select *
from mydata
order by (upcase( city ))
;
quit;
SQL allows you to sort by a condition or result which isn't itself a
field/column in the input table/dataset. Very handy, that.
You could substitute 'lowcase' for 'upcase' in the above, so long as the
conversion is consistent.
Note that for the purposes of merging or joining the data, the dataset
isn't strictly sorted.
Peace.
--
Karsten M. Self <kmself@ix.netcom.com>
--
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
--
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.