35 %MACRO _checkScenario(i_examinee =
46 call symput (
'l_cntObs',put(cnt_obs, 3.));
49 SET target.scn(keep=scn_id scn_path scn_end) nobs=cnt_obs;
50 pos = find(scn_path,
'/',-200)+1;
51 scn_name = substr(scn_path,pos);
55 create table findScenariosToInsertInDB as
56 select s.scn_id, scn.changed as scn_changed, s.scn_end, scn.membername as name,
57 CASE WHEN scn_id EQ . THEN 1
61 full join &i_scn_pre as scn
62 on scn.membername=s.scn_name
68 retain index &l_cntObs;
69 SET findScenariosToInsertInDB;
70 IF scn_id EQ . THEN DO;
78 create table noAutocall as
79 select unique cas_scnid
84 create table Dependenciesbyscenario as
85 select h.scn_id, h.name, h.scn_end, h.scn_changed, d.calledByCaller, s.changed as called_changed, h.insertIntoDB,
86 case WHEN scn_end < scn_changed OR scn_end < called_changed OR h.scn_id in (select cas_scnid from noAutocall) THEN 1
90 left join &i_dependency as d on h.name = d.caller
91 left join &i_examinee as s on s.membername=d.calledByCaller
96 create table &i_scenariosToRun as
97 select distinct d1.scn_id, e.membername as name, d1.insertIntoDB, e.filename, (select max(dorun) as dorun
98 from Dependenciesbyscenario as d
99 where e.membername = d.name
102 from &i_scn_pre. as e, Dependenciesbyscenario as d1
103 where d1.name = e.membername
107 %MEND _checkScenario;