因為實在試不出來~
拜託~作者: shiyiming 时间: 2009-3-4 11:51 标题: Re: <一個處理資料的問題...請教高手> 你的意思是這樣嗎:
data all1;
set all;
if sic1^= . then do;
if sic2^= . then do;
if sic3^= . then do;
if sic4^= . then do;
if sic5^= . then do;
if sic6^= . then do;
if sic7^= . then do;
if sic8^= . then do;
if sic9^= . then do;
if sic10^= . then do;
if sic1=sic2=SIC3= sCI4=siC5=sic6=sic7=sic8=sic9=sic10 then dummy=1;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
run;作者: Qiong 时间: 2009-3-10 14:48 标题: Re: <一個處理資料的問題...請教高手> Q1
[code:19s4zsrt]
data temp;
set temp;
array s(*)_all_;
yummy=1;
do i=2 to dim(s);
if s(i)^=. and s(i)^=s(1) then yummy=0;
end;
drop i;
run;[/code:19s4zsrt]作者: Qiong 时间: 2009-3-10 15:09 标题: Re: <一個處理資料的問題...請教高手> 方便起见,把对应的数据复制进去就行,code不用改。
[code:24e99oh7]
data format;
input sic $2. value $ ;
cards;
01 234
02 634
03 423
04 234
;
data format;
set format;
informat start $16. end $16. label $40. fmtname $32. type $1.;
start=sic;
end=sic;
label=value;
fmtname='aa';
type='c';
keep start end label fmtname type;
run;
proc format library=work cntlin=format;run;
data new;
informat sic1-sic10 $2. ;
format sic1-sic10 $aa.;
input sic1-sic10 $ ;
cards;
01 02 . . . . . . . .
. 02 03 04 . . . . . .
;
run;[/code:24e99oh7]作者: shiyiming 时间: 2009-3-12 21:24 标题: Re: <一個處理資料的問題...請教高手> 謝謝你的答覆~第一題我寫出來了
Data format;
infile "&savepath\&file1..txt" firstobs=1;
input sic $2. value $ ;
;
data format;
set format;
informat start $16. end $16. label $40. fmtname $32. type $1.;
start=sic;
end=sic;
label=value;
fmtname='aa';
type='c';
keep start end label fmtname type;
run;
proc format library=work cntlin=format;run;