LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 4 Jun 2004 13:42:24 -0700
Reply-To:   "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Subject:   Re: proc sort vs. order by with character variables
Comments:   To: Sigurd Hermansen <HERMANS1@WESTAT.COM>

More history, a little farther back http://www.osdata.com/kind/history.htm

This site has a plethora of OS info....http://www.osdata.com/

Paul Choate DDS Data Extraction (916) 654-2160

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Sigurd Hermansen Sent: Friday, June 04, 2004 1:20 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: proc sort vs. order by with character variables

See http://www.windowsreinstall.com/install/msdos/msdos/ods/historyofdos.html

I believe that Gates purchased an predecessor of CP/M.

According to http://www.thocp.net/software/operatingsystems/operating_systems.htm

Tim Patterson developed QDOS. And I had thought that DOS stood for Disk Operating System! Now we know the pedigree of MS DOS. Sig -----Original Message----- From: Terjeson, Mark [mailto:TERJEM@DSHS.WA.GOV] Sent: Friday, June 04, 2004 3:50 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: proc sort vs. order by with character variables

Windows(i.e. DOS v1.0) was originally 70%CP/M and 30%Unix.

-----Original Message----- From: Jack Hamilton [mailto:JackHamilton@FIRSTHEALTH.COM] Sent: Friday, June 04, 2004 12:21 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: proc sort vs. order by with character variables

Wouldn't it be more reasonable to say that Windows and Unix are derivatives of the predecessors to VMS? Not that would be accurate either - none of the ancestral OSs is still in commercial use, and there's always been heavy cross-fertilization.

-- JackHamilton@FirstHealth.com Manager, Technical Development Metrics Department, First Health West Sacramento, California USA

>>> "Choate, Paul@DDS" <pchoate@DDS.CA.GOV> 06/04/2004 11:49 AM >>> Fyi -

The ASCII (UNIX and its derivatives, OpenVMS, Windows) and EBCDIC (OS/390, z/OS) sort sequences are under Concepts: SORT Procedure: http://support.sas.com/91doc/getDoc/proc.hlp/a002473663.htm (keyboard characters)

or @

http://www.asciitable.com/ (this list includes the special characters)

Paul Choate DDS Data Extraction (916) 654-2160

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Sigurd Hermansen Sent: Friday, June 04, 2004 11:15 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: proc sort vs. order by with character variables

Roy: My tests confirmed what Quentin reported, and showed that PROC SORT and ORDER BY produced identical results given the test data. The ORDER BY results reported by Walt appear (almost) to be in EBCDIC collating sequence (if I recall correctly, the upper case letters follow the lower case letters in EBCDIC.) I wonder if he is running the query on an IBM mainframe. Other possibilities include different installation options, ordering on formatted values, or displays of formatted values.

Not long back I introduced the topic of SAS functions to a group of people in a training session. Early on I used random number functions and BYTE() and COLLATE() functions to produce sequences of variable values. Some in the group asked why database programmers need to know anything about number representation, collating sequences, bytes, and binary coding. I guess the details don't matter that much anymore when MS Windows and SAS hide them so successfully. Only ever so often, what you see in a display isn't really what you have stored, and you have to move down a level or two. Sig

-----Original Message----- From: Pardee, Roy [mailto:pardee.r@GHC.ORG] Sent: Friday, June 04, 2004 1:45 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: proc sort vs. order by with character variables

I bet Quentin's on the money here. IIRC by default, mssql's collation order is case-insensitive (tho that's changeable). Your dba should be able to (dis)confirm the collating sequence for the table in question & change it if necessary.

I spent an afternoon once wracking my brain as to why the results of a PROC SQL SELECT DISTINCT were violating a unique key constraint when I tried to insert them into a mssql table. SAS considered some differently-cased values as distinct & mssql did not.

Cheers,

-Roy

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Quentin McMullen Sent: Friday, June 04, 2004 9:37 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: proc sort vs. order by with character variables

On Fri, 4 Jun 2004 10:22:58 -0400, Walt Davis <walter_davis@UNC.EDU> wrote:

>hi folks, > >Old-time SAS-Ler who hasn't posted in years. Also proc sql (and >regular >sql) neophyte. > >So here's the problem. We have a character ID variable which is a mix >of upper and lowercase values. PROC SORT is of course case-sensitive >but when >we use an ORDER BY statement in PROC SQL, the sort doesn't appear to be

>case-sensitive. Here's a brief example: > >SQL "order by" proc sort > >aAACPb .. AAAjeB . >aAaEbz .. AAAnqW . >aAAgoW .. AAAzhY . >aaAHmL .. >AaAhOe .. >aAAiQZ .. >AAAjeB .. > >If it matters, we're running SAS v. 8 and Microsoft SQL Server. I did >search SAS tech support but didn't find anything on this specific >problem > >Is there a SAS option, a PROC SQL option, or an SQL "order by" option >to get >"order by" to sort this the same way as SAS? > >Thanks. A direct reply would be appreciated, but we'll be grateful for any >help we get.

Hi Walter,

One of the neat things about SQL is that you can use it with another database, which sounds like what you are doing (pulling from SQL server).

One of things to keep track of when you do this is, which program is running the SQL code (i.e. is SAS running SQL code, or is SAS passing the SQL code to SQL server, so M$ runs the code?).

In below example, it shows (I think) that SAS SQL respects case when it orders, just like SAS sort. Consistency is good. : ) My guess is, your query is passed to SQL Server, which may have its own rules/options for sort order.

So I thin you either need to look into SQL Sever sort order stuff, or find a way to make SAS execute the SQL code.

data a; input var $6.; cards; aAACPb aAaEbz aAAgoW aaAHmL AaAhOe aAAiQZ AAAjeB ;

proc sql; select var from a order by var ; quit;

Hope that helps, --Quentin


Back to: Top of message | Previous page | Main SAS-L page