Assign labels and formats in the DATA step.
libname ia 'SAS-data-library';
data ia.dfwlax;
infile 'raw-data-file';
input @1 Flight $3. @4 Date mmddyy8.
@12 Dest $3. @15 FirstClass 3.
@18 Economy 3.;
format Date mmddyy10.;
label Dest='Destination'
FirstClass='First Class Passengers'
Economy='Economy Passengers';
run;
Examine the descriptor portion of the ia.dfwlax data set.
proc contents data=ia.dfwlax;
run;
OUTPUT
-----Alphabetic List of Variables and Attributes-----
# Variable Type Len Pos Format Label
----------------------------------------------------------------
2 Date Num 8 0 MMDDYY10.
3 Dest Char 3 27 Destination
5 Economy Num 8 16 Economy Passengers
4 FirstClass Num 8 8 First Class Passengers
1 Flight Char 3 24
Override Permanent Attributes
Use a FORMAT statement in a PROC step to temporarily override the format stored in the data set descriptor.
proc print data=ia.dfwlax label;
format Date date9.;
run;
No comments:
Post a Comment