data todaytable; tdate = today(); run;
proc sql noprint; select "'"||put(tdate,date9.)||":00:00:00'dt" into :todaydate1 from todaytable; select "'"||put(tdate,date9.)||":23:59:59'dt" into :todaydate2 from todaytable; quit;
%Global differenceText AcademicPeriodCounter; %let differenceText = %Str();
%macro createRegBioArchTables(RegBioCounter);
proc sql; create table studentsUD&RegBioCounter. as SELECT ACADEMIC_PERIOD, FROM mytable where rundate >= &todaydate1. and rundate <= &todaydate2. quit;
%mend;
%createRegBioArchTables(1); %let todaydate1=%sysfunc(intnx(year,&todaydate1,-1)); %let todaydate2=%sysfunc(intnx(year,&todaydate2,-1)); %createRegBioArchTables(2);
proc sql; select count(*) FROM mytable where t1.rundate >= &todaydate1. and t1.rundate <= &todaydate2.; quit;
%put( test &todaydate1.);
... View more