Date: Fri, 16 Nov 2001 14:33:16 -0800
Reply-To: "William W. Viergever" <wwvierg@ATTGLOBAL.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "William W. Viergever" <wwvierg@ATTGLOBAL.NET>
Subject: Re: shorthand in sas reg model?
In-Reply-To: <15104802790BD411A2C100D0B73EA33C01B42ED3@remailnt3-re01.we
stat.com>
Content-Type: multipart/alternative;
At 04:45 PM 11/16/2001 -0500, Dianne Rhodes wrote:
>"Andrew H. Karp" <sfbay0001@AOL.COMNOSPAM> wrote :
> > The second approach is very dangerous to use and should be applied if you
>are
> > absolutely, positively certain that all the independent variables are
>physically
> > adjacent to each other. You can determine this by using PROC CONTENTS
>with the
> > POSITION option.
>
>
>Actually, in version 8 when you run a PROC CONTENTS with the POSITION
>option,
>what you get is the variables ordered by VARNUM, or their logical order in
>the
>file.
>
>The only way to really see them by POSITION is to roll your own using the
>dictionary tables. I have an example around somewhere.
>
>Version 8 writes all of your numeric variables, then moves all the character
>variables to the end.
>
> > If, and only if, all your independent variables are physically adjacent to
>each
> > other, then you list address them with a double dash (--).
>
>So I would guess in Version 8 they must be logically adjacent to each other,
>as they may or may not be physically adjacent.
>
>Any one played around with this in Version 8?
Here's my peso:
SN-002676
Determining the order of variables within a SAS data set
In Version 6 of the SAS System, the position of variables on a SAS data
set is determined by the order in which they are encountered regardless
of their type or length. In order to improve performance, Version 7 and
beyond of the SAS System positions 8 byte and 4 byte numeric variables
at 8 byte boundaries at the front of a SAS data set. Note that if the
data set has 4 byte numerics but not 8 byte numerics, alignment is based
on 4 byte boundaries instead. Character variables are placed next in the
order in which they are encountered, followed by all other numeric
variables in the order in which they were encountered. The position of
the variable can be viewed in PROC CONTENTS output in the POS column or
the NPOS variable when an output data set is created via the OUT=
option.
Although the physical position of variables on the data set may be
different, the logical order of variables has not changed. The logical
order of variables can be viewed in PROC CONTENTS output in the '#'
column or the VARNUM variable when an output data set is created via the
OUT= option.
Additionally, the 'Observation Length' reported by PROC CONTENTS in
Version 7 and beyond may be larger than the same data set created by
Version 6. This occurs because each observation is padded so that the
subsequent observation aligns at the beginning of either an 8 byte or 4
byte boundary (if no 8 byte numeric variables exist) in the newer
releases.
For example, consider the following code and partial output it produces
in Version 6.
data one;
length x 6 y 4;
s=3;
a='a';
x=1;
y=5;
run;
proc contents;
run;
-----Alphabetic List of Variables and Attributes-----
# Variable Type Len Pos
-----------------------------------
4 A Char 1 18
3 S Num 8 10
1 X Num 6 0
2 Y Num 4 6
Additionally, the observation length is reported as 19 bytes. Below is
the comparable output from Version 8, which reports the observation
length as 24 bytes.
-----Alphabetic List of Variables and Attributes-----
# Variable Type Len Pos
-----------------------------------
4 a Char 1 12
3 s Num 8 0
1 x Num 6 13
2 y Num 4 8
Due to the change in the algorithm determining physical position, the
POSITION option on PROC CONTENTS has been replaced by the more
descriptive VARNUM option. The POSITION option still produces output
ordered by the logical position of variables on the data set, but it is
no longer documented.
------------------------------------------------------------
William W. Viergever Voice : (916) 483-8398
Viergever & Associates Fax : (916) 486-1488
Sacramento, CA 95825 E-mail : wwvierg@attglobal.net
------------------------------------------------------------
[text/html]