Reordering Variables in SAS Output
You can control the order in which variables are displayed in SAS output by using the
following declarative statements:
ARRAY
ATTRIB
FORMAT
INFORMAT
LENGTH
RETAIN
For any of these statements to work, they must be placed prior to any one of the
following declarative statements:
SET
MERGE
UPDATE
Only the variables whose positions are relevant need to be listed. Variables not listed in
these statements retain their original position. For example, if data set Sashelp.Class has
variables Name, Sex, Age, Height, and Weight (in that order), then you can move the
variable Height to the first position by specifying the LENGTH statement as shown in
the following example:
Example Code 4.1 Using the LENGTH Statement to Reorder Variables
data Class1;
length Height 3; /* The LENGTH statement precedes the SET statement */
set Sashelp.Class; /* and causes the variable Height to be placed first */
run; /* in the output */
proc print data=Class1;
run;
Output 4.3 Using the LENGTH Statement to Reorder Variables
Reordering Variables in SAS Output 47
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.245.1