Please check me on this code. What am I missing? Is this a bug?
Using SAShelp.Cars, I'm creating a character format, $MAKE, which maps the first three (3) characters of the column Make to the full text. Then I'm attempting to create a table using ODSTABLE giving the 3 character data to the procedure and I'm wanting the procedure to transform that data by the format. This is suppose to work like the example here: SAS Help Center: Defining Variables with the COLUMN Statement -- I think. (??)
options nofmterr nocenter;
data cntlin (keep=FMTNAME end start label type );
set SAShelp.Cars (obs=50);
by Make ;
if first.Make then do;
FMTNAME="Make";
type="C";
length start end $3;
start=substr(Make,1,3);
format start $Make.;
end=start;
label=Make;
output;
end;
proc format cntlin=&sysLast;
run;
proc odstable data=cntlin(Keep=start ) PAGEBREAK=No;
column start ;
define start;
format=$make.;
end;
run;
I get this output like this:
start
Acu
Aud
BMW
Bui
I expected this:
start
Acura
Audi
BMW
Buick
... View more