@@ -39,15 +39,35 @@
|
||||
%let &outresult=NO;
|
||||
%let &outreason=NOTFOUND;
|
||||
|
||||
/* check if there is actually a version to restore */
|
||||
%local libds;
|
||||
proc sql noprint;
|
||||
select upcase(cats(base_lib,'.',base_ds)) into: libds
|
||||
from &dc_libref..mpe_submit
|
||||
where TABLE_ID="&load_ref";
|
||||
|
||||
/**
|
||||
* check if there is actually a version to restore
|
||||
*/
|
||||
%local audtab;
|
||||
proc sql noprint;
|
||||
select coalescec(audit_libds,"&dc_libref..MPE_AUDIT") into: audtab
|
||||
from &dclib..MPE_TABLES
|
||||
where &dc_dttmtfmt. lt tx_to
|
||||
and libref="%scan(&libds,1,.)" and dsn="%scan(&libds,2,.)";
|
||||
%if "&audtab"="0" %then %do;
|
||||
%let allow_restore=NO;
|
||||
%let reason= &libds has no audit table configured;
|
||||
%return;
|
||||
%end;
|
||||
|
||||
%local chk;
|
||||
%let chk=0;
|
||||
proc sql noprint;
|
||||
select count(*) into: chk from &dc_libref..mpe_audit
|
||||
select count(*) into: chk from &audtab
|
||||
where load_ref="&load_ref";
|
||||
%if &chk=0 %then %do;
|
||||
%let allow_restore=NO;
|
||||
%let reason=No entry for &load_ref in MPE_AUDIT;
|
||||
%let reason=No entry for &load_ref in &audtab;
|
||||
%return;
|
||||
%end;
|
||||
|
||||
@@ -70,11 +90,6 @@
|
||||
%end;
|
||||
|
||||
/* check if user has basic access */
|
||||
%local libds;
|
||||
proc sql noprint;
|
||||
select cats(base_lib,'.',base_ds) into: libds
|
||||
from &mpelib..mpe_submit
|
||||
where TABLE_ID="&load_ref";
|
||||
%mpe_accesscheck(&libds,outds=work.access_check
|
||||
,user=&user
|
||||
,access_level=EDIT
|
||||
|
||||
Reference in New Issue
Block a user