1
0
mirror of https://github.com/sasjs/core.git synced 2026-04-20 23:13:14 +00:00

Merge pull request #340 from sasjs/issue339

fix: avoid error in mp_lockanytable.sas …
This commit is contained in:
Allan Bowe
2023-06-26 22:05:18 +01:00
committed by GitHub
2 changed files with 60 additions and 52 deletions
+9 -5
View File
@@ -10616,16 +10616,19 @@ run;
%end;
%end;
%else %if &ACTION=UNLOCK %then %do;
%local status;
%local status cnt;
%let cnt=0;
proc sql noprint;
select count(*) into: cnt from &ctl_ds where LOCK_LIB ="&lib" & LOCK_DS="&ds";
%if &cnt=0 %then %do;
%put %str(WAR)NING: &lib..&ds was not previously locked in &ctl_ds!;
%end;
%else %do;
select LOCK_STATUS_CD into: status from &ctl_ds
where LOCK_LIB ="&lib" and LOCK_DS="&ds";
quit;
%if &syscc>0 %then %put syscc=&syscc sqlrc=&sqlrc;
%if &sqlobs=0 %then %do;
%put %str(WAR)NING: &lib..&ds has never been locked!;
%end;
%else %if &status=LOCKED %then %do;
%if &status=LOCKED %then %do;
data _null_;
putlog "&sysmacroname: unlocking &lib..&ds:";
run;
@@ -10646,6 +10649,7 @@ run;
%put NOTE: Unrecognised STATUS_CD (&status) in &ctl_ds;
%let abortme=1;
%end;
%end;
%end;
%else %do;
%let msg=lock_anytable given unsupported action (&action);
+9 -5
View File
@@ -194,16 +194,19 @@ run;
%end;
%end;
%else %if &ACTION=UNLOCK %then %do;
%local status;
%local status cnt;
%let cnt=0;
proc sql noprint;
select count(*) into: cnt from &ctl_ds where LOCK_LIB ="&lib" & LOCK_DS="&ds";
%if &cnt=0 %then %do;
%put %str(WAR)NING: &lib..&ds was not previously locked in &ctl_ds!;
%end;
%else %do;
select LOCK_STATUS_CD into: status from &ctl_ds
where LOCK_LIB ="&lib" and LOCK_DS="&ds";
quit;
%if &syscc>0 %then %put syscc=&syscc sqlrc=&sqlrc;
%if &sqlobs=0 %then %do;
%put %str(WAR)NING: &lib..&ds has never been locked!;
%end;
%else %if &status=LOCKED %then %do;
%if &status=LOCKED %then %do;
data _null_;
putlog "&sysmacroname: unlocking &lib..&ds:";
run;
@@ -224,6 +227,7 @@ run;
%put NOTE: Unrecognised STATUS_CD (&status) in &ctl_ds;
%let abortme=1;
%end;
%end;
%end;
%else %do;
%let msg=lock_anytable given unsupported action (&action);