|Date: ||Wed, 17 Apr 2002 11:23:38 -0400|
|Reply-To: ||Michael Raithel <RAITHEM@WESTAT.COM>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||Michael Raithel <RAITHEM@WESTAT.COM>|
|Subject: ||(MAR) RE: Proc Contents - Simple Question|
|Content-Type: ||text/plain; charset="iso-8859-1"|
In the continuing discussion of Sorts and the CONTENTS Procedure between Jim
Groeneveld and Dr. John Whittington, Jim posted the following:
>Your explanation is all right of course. The behaviour of SAS is known and
>justified, logically conservative as far as deciding about being sorted is
>concerned. That is not the problem.
>But I was wondering how the Sorted: value (Yes or No) can be used in an
>application program. Or is the Sorted: value only displayed in the print
>output? What is its use then (except for visually reading a dataset is
>sorted or actually unknown)?
Jim, unfortunately, SORTED: is not in either the dictionary tables or the
SQL views, so it cannot be used programmatically. However, I believe that
it is an important piece of information.
SORTED: (Yes or No) is one of the first things that I look at when I look at
a CONTENTS PROCEDURE listing. If it specifies "YES", then I look down at
the Sorted Information portion of the output to determine what variables the
data set is sorted by. For example:
Sortedby: dns appservr
Character Set: ANSI
In the above example, I now know that the data is already sorted. I know
that the SAS System did the sorting and knows about the sort order.
Further, it is sorted into the order that I need it sorted by (since I want
my data sorted by DNS and APPSERVR). So, I will not waste time coding a
SORT into my program. Nor, will I wonder if it was sorted "outside" of the
SAS System and wonder what order it might be in.
I find SORTED: to be very useful, indeed. For me, it is better to know that
a SAS data set was sorted by the SAS System and to know what variables were
used in the sort than to guess if it was sorted and/or try to keep track of
how I think it must have been sorted.
Jim, I wish you the best of luck in determining how the SORTED:
specification fits into your own SAS programming scheme!
I hope that this suggestion proves helpful now, and in the future!
Of course, all of these opinions and insights are my own, and do not reflect
those of my organization or my associates. All SAS code and/or
methodologies specified in this posting are for illustrative purposes only
and no warranty is stated or implied as to their accuracy or applicability.
People deciding to use information in this posting do so at their own risk.
Michael A. Raithel
"The man who wrote the book on performance"
Author: Tuning SAS Applications in the MVS Environment
...seasons will pass you by; I get up, I get down... - YES