| Date: | Thu, 25 Mar 1999 22:11:08 +0000 |
| Reply-To: | John Whittington <medisci@POWERNET.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU> |
| From: | John Whittington <medisci@POWERNET.COM> |
| Subject: | Re: Sorting BY functions/expressions |
|
| Content-Type: | text/plain; charset="us-ascii" |
|---|
At 14:23 25/03/99 -0500, HERMANS1 wrote:
>Offhand I'd say that the SAS System already has the capability that you want
>(even if it does require use of the SQL procedure that some may consider
>unaesthetic). You can specify a physical ordering of the observations in the
>dataset by either creating an ordered view of a dataset in SQL and SETting the
>view in a data step, or by defining the output of a datastep as a view (say,
>Xvw, and sorting the dataset in a SQL statement (say, ....SELECT * FROM Xvw
>ORDER BY UCASE(var), LENGTH(var), ABS(numvar). For those inclined to data
step
>programming can regard these methods as special SORT procedures that sort on
>functions of variables. Sig
Sig, yes, as I've responded to others, those are all options - and it
wouldn't surprise me if performance was comparable in all cases - but I'm
not sure that alters what I said. As we often discuss here, the fact that a
particular functionality can be achieved 'in other ways' is not necessarily
an excuse for not allowing a user-friendly syntax - is that not the point of
any 'higher level' computer language? A vast amount of the SAS semantics
and syntax could be eliminated without making it impossible for us to find a
way of coding the functionality we want - but, just as we seem to like
having the (technically redundant) SQRT() function, I think it wouldn't be
unreasonable to be able to sort 'BY UPCASE(var)'. Indeed, for all I care,
the compiler might interpret such an instruction in terms of a 'SQL
solution'; that would be fine by me!
Kind Regards
John
----------------------------------------------------------------
Dr John Whittington, Voice: +44 (0) 1296 730225
Mediscience Services Fax: +44 (0) 1296 738893
Twyford Manor, Twyford, E-mail: medisci@powernet.com
Buckingham MK18 4EL, UK mediscience@compuserve.com
----------------------------------------------------------------
|