공부하세요

sas 연속된 날짜에 대해 매크로 돌리기

김영국 2009. 7. 1. 13:37

rsubmit;
data aggr(compress=yes);
length kword $40. cnt 8.;
run;
%macro zzz(stddate);
data eng_&stddate.(compress=yes);
set gk.kword_&stddate.;
aaa = compbl(left (kword));
if compress(aaa) ne aaa and compress(lowcase(aaa),'abcdefghijklmnopqrstuvwxyz ') = '';
run;

proc sql;
insert into aggr
 select aaa as kword, cnt from eng_&stddate.;
quit;
%mend;


* rsubmit;
%macro aaa(date1, date2);
data _null_;
 call symput('d1', input("&date1",yymmdd8.) ) ;
 call symput('d2', input("&date2",yymmdd8.) ) ;
run;
%do i = &d1 %to &d2;
data _null_;
 call symput('stddate', put(&i,yymmdd6.) ) ;
run;
%put &d1 &d2 &stddate ;
%zzz(&stddate) ;
%end;
%mend;

%aaa(20090601, 20090630);

'공부하세요' 카테고리의 다른 글

[SAS] 결측치 없애는 방법1  (0) 2010.09.09
특정디렉토리에서 대량 파일 지우기  (0) 2009.12.14
linux replace  (0) 2008.09.04
tar 압축  (0) 2008.06.18
[펌] 리눅스에서 삭제된 파일 복구하기  (0) 2008.05.20