SAS 9.1.3 Language Reference: Concepts, Third Edition, Volumes 1 and 2
In SAS, numeric variables are automatically aligned. You can further control their alignment by using a format.
However, when you assign a character value in an assignment statement, SAS stores the value as it appears in the statement and does not perform any alignment. Output 5.2 illustrates the character value alignment produced by the following program:
data aircode; input city -13; length airport $ 10; if city='San Francisco' then airport='SFO'; else if city='Honolulu' then airport='HNL'; else if city='New York' then airport='JFK or EWR'; else if city='Miami' then airport=' MIA '; datalines; San Francisco Honolulu New York Miami ; proc print data=aircode; run;
This example produces the following output:
Output 5.2: Output from the PRINT Procedure
|
The SAS System OBS CITY AIRPORT 1 SanFrancisco SFO 2 Honolulu HNL 3 New York JFK or EWR 4 Miami MIA
|