There are many variations but here are a couple.
StudentID='A1'; Score=78; Gender='M';
Address='123 Cherry Tree Lane'; output;
StudentID='B2'; Score=79; Gender='F';
Address='456 Cherry Tree Lane'; output;
We can order the columns specifically, AND
we can order the columns by CHARACTER then NUMERIC.
Below are examples of both.
There are several ways to order the column
in specific order:
* SQL order as you list them ;
create table result1 as
* datastep compiler order them in ;
* the order they are incurred. ;
* i.e. LENGTH found before SET. ;
length StudentID $2
Here is one way to order by CHAR then NUM.
* ordering by character then numeric ;
Hope this is helpful.
Senior Programmer Analyst
Investment Management & Research
Global Leaders in Multi-Manager Investing
From: SAS(r) Discussion [mailto: XXXX@XXXXX.COM ] On Behalf Of
Sent: Saturday, April 26, 2008 9:00 AM
Subject: how to sort variable by character variable first then numeric
who knows if we can use SAS to sort the variables by character
variable first and then numeric variable.
The original order is:
StudentID Score Gender Address
I want to sort it as
StudentID Gender Address Score
Thanks very much!