((Classroom )?[Dd]uration: (\d\.\d|\d) day(s)? )?( )*((Live Web d|D)uration: (\d\.\d|\d) half-day session(s)? )?( )*CEU: (\d\.\d|\d) <\/p>/');
re_offering=prxparse('/
(.*)<\/td> | (.*)<\/td> | (.*)<\/td><\/tr>/');
re_br =prxparse('/(\d\d\w\w\w\d\d\d\d)\s+([A-Za-z,\.\s]*) (.*)/');
end;
input;
if prxmatch(re_duration, _infile_) then do;
duration_course = input(prxposn(re_duration, 3, _infile_), 4.);
duration_liveweb = input(prxposn(re_duration, 8, _infile_), 4.);
ceu = input(prxposn(re_duration, 11, _infile_), 4.);
return;
end;
if prxmatch(re_offering, _infile_) then do;
offer1 = prxposn(re_offering, 1, _infile_);
do while (prxmatch(re_br, offer1));
Start =input(prxposn(re_br, 1, offer1), date9.);
Location=prxposn(re_br, 2, offer1);
if location eq 'Live Web,' then duration = duration_liveweb;
else duration = duration_course;
offer1 =prxposn(re_br, 3, offer1);
output;
end;
offer2 = prxposn(re_offering, 2, _infile_);
do while (prxmatch(re_br, offer2));
Start =input(prxposn(re_br, 1, offer2), date9.);
Location=prxposn(re_br, 2, offer2);
if location eq 'Live Web,' then duration = duration_liveweb;
else duration = duration_course;
offer2 =prxposn(re_br, 3, offer2);
output;
end;
offer3 = prxposn(re_offering, 3, _infile_);
do while (prxmatch(re_br, offer3));
Start =input(prxposn(re_br, 1, offer3), date9.);
Location=prxposn(re_br, 2, offer3);
if location eq 'Live Web,' then duration = duration_liveweb;
else duration = duration_course;
offer3 =prxposn(re_br, 3, offer3);
output;
end;
end;
else delete;
run;
filename schedule clear;
proc append base=SAS_Schedule data=_schedule_ force; run;
proc datasets library=work nodetails nolist; delete _schedule_; run; quit;
%mend;
proc datasets library=work nodetails nolist;
delete sas_schedule;
run;
quit;
data _null_;
set SAS_Catalog;
where schedule;
calltext = cats('%getSchedule(', course_code, ');');
call execute(calltext);
run;
proc sql;
create table SAS_Training as
select distinct c.*, s.*
from sas_catalog as c
left join sas_schedule as s
on c.course_code=s.course_code
order by course_desc, location, start
;
quit;
|