To get a list of Tuesdays starting Jan 6, 2010 into a dataset called tuesdays:
%let start_date='06jan2009'd;To load all Tuesday's SAS data files:
data tuesdays ;
do i = 0 to 103;
Tuesday=put(Intnx( 'Day' , &start_date ., i*7 ),date9.);
output;
end;
drop i;
run ;
proc print data=tuesdays; run;
%let start_date='06jan2009'd;Enjoy learning SAS, a little bit at a time every day.
%macro load_tuesday_sas_dataset;
%global tuedate;
%do i=0 %to 103;
data _null_;
call symput("tuedate",left(put(Intnx('Day',&start_date., &i. * 7),date9.)));
run;
%put &tuedate;
data dataset_&tuedate.;
set filelib.sasfile_&tuedate.;
run;
%end;
%mend load_tuesday_sas_dataset;
%load_tuesday_sas_dataset;
No comments:
Post a Comment