|
Re: 如何将以下数据转为format库。
[code:1qizry56]data aaa;
input var$ x$40.;
cards;
sex 1=M|2=F|3=N
yes 1=Y|2=N
;
run;
data vformat(keep=start end label fmtname type );
set aaa;
do i=1 to 100;
temp=scan(x,i,"|");
fmtname=var;
start=scan(temp,1,"=");
end=scan(temp,1,"=");
label=scan(temp,2,"=");
type='n';
if compress(temp)~="" then output;
end;
run;
proc format library=work cntlin=vformat;run;
data _null_;
x=1;
put x sex. ;
put x yes. ;
run;[/code:1qizry56] |
|