mirror of
https://github.com/sasjs/core.git
synced 2026-01-07 09:30:06 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8de2dd4e7c | ||
|
|
e46165c140 |
56
all.sas
56
all.sas
@@ -10616,35 +10616,39 @@ run;
|
|||||||
%end;
|
%end;
|
||||||
%end;
|
%end;
|
||||||
%else %if &ACTION=UNLOCK %then %do;
|
%else %if &ACTION=UNLOCK %then %do;
|
||||||
%local status;
|
%local status cnt;
|
||||||
|
%let cnt=0;
|
||||||
proc sql noprint;
|
proc sql noprint;
|
||||||
select LOCK_STATUS_CD into: status from &ctl_ds
|
select count(*) into: cnt from &ctl_ds where LOCK_LIB ="&lib" & LOCK_DS="&ds";
|
||||||
where LOCK_LIB ="&lib" and LOCK_DS="&ds";
|
%if &cnt=0 %then %do;
|
||||||
quit;
|
%put %str(WAR)NING: &lib..&ds was not previously locked in &ctl_ds!;
|
||||||
%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;
|
|
||||||
data _null_;
|
|
||||||
putlog "&sysmacroname: unlocking &lib..&ds:";
|
|
||||||
run;
|
|
||||||
proc sql;
|
|
||||||
update &ctl_ds
|
|
||||||
set LOCK_STATUS_CD='UNLOCKED'
|
|
||||||
, LOCK_END_DTTM="%sysfunc(datetime(),%mf_fmtdttm())"dt
|
|
||||||
, LOCK_USER_NM="&user"
|
|
||||||
, LOCK_PID="&sysjobid"
|
|
||||||
, LOCK_REF="&ref"
|
|
||||||
where LOCK_LIB ="&lib" and LOCK_DS="&ds";
|
|
||||||
quit;
|
|
||||||
%end;
|
|
||||||
%else %if &status=UNLOCKED %then %do;
|
|
||||||
%put %str(WAR)NING: &lib..&ds is already unlocked!;
|
|
||||||
%end;
|
%end;
|
||||||
%else %do;
|
%else %do;
|
||||||
%put NOTE: Unrecognised STATUS_CD (&status) in &ctl_ds;
|
select LOCK_STATUS_CD into: status from &ctl_ds
|
||||||
%let abortme=1;
|
where LOCK_LIB ="&lib" and LOCK_DS="&ds";
|
||||||
|
quit;
|
||||||
|
%if &syscc>0 %then %put syscc=&syscc sqlrc=&sqlrc;
|
||||||
|
%if &status=LOCKED %then %do;
|
||||||
|
data _null_;
|
||||||
|
putlog "&sysmacroname: unlocking &lib..&ds:";
|
||||||
|
run;
|
||||||
|
proc sql;
|
||||||
|
update &ctl_ds
|
||||||
|
set LOCK_STATUS_CD='UNLOCKED'
|
||||||
|
, LOCK_END_DTTM="%sysfunc(datetime(),%mf_fmtdttm())"dt
|
||||||
|
, LOCK_USER_NM="&user"
|
||||||
|
, LOCK_PID="&sysjobid"
|
||||||
|
, LOCK_REF="&ref"
|
||||||
|
where LOCK_LIB ="&lib" and LOCK_DS="&ds";
|
||||||
|
quit;
|
||||||
|
%end;
|
||||||
|
%else %if &status=UNLOCKED %then %do;
|
||||||
|
%put %str(WAR)NING: &lib..&ds is already unlocked!;
|
||||||
|
%end;
|
||||||
|
%else %do;
|
||||||
|
%put NOTE: Unrecognised STATUS_CD (&status) in &ctl_ds;
|
||||||
|
%let abortme=1;
|
||||||
|
%end;
|
||||||
%end;
|
%end;
|
||||||
%end;
|
%end;
|
||||||
%else %do;
|
%else %do;
|
||||||
|
|||||||
@@ -194,35 +194,39 @@ run;
|
|||||||
%end;
|
%end;
|
||||||
%end;
|
%end;
|
||||||
%else %if &ACTION=UNLOCK %then %do;
|
%else %if &ACTION=UNLOCK %then %do;
|
||||||
%local status;
|
%local status cnt;
|
||||||
|
%let cnt=0;
|
||||||
proc sql noprint;
|
proc sql noprint;
|
||||||
select LOCK_STATUS_CD into: status from &ctl_ds
|
select count(*) into: cnt from &ctl_ds where LOCK_LIB ="&lib" & LOCK_DS="&ds";
|
||||||
where LOCK_LIB ="&lib" and LOCK_DS="&ds";
|
%if &cnt=0 %then %do;
|
||||||
quit;
|
%put %str(WAR)NING: &lib..&ds was not previously locked in &ctl_ds!;
|
||||||
%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;
|
|
||||||
data _null_;
|
|
||||||
putlog "&sysmacroname: unlocking &lib..&ds:";
|
|
||||||
run;
|
|
||||||
proc sql;
|
|
||||||
update &ctl_ds
|
|
||||||
set LOCK_STATUS_CD='UNLOCKED'
|
|
||||||
, LOCK_END_DTTM="%sysfunc(datetime(),%mf_fmtdttm())"dt
|
|
||||||
, LOCK_USER_NM="&user"
|
|
||||||
, LOCK_PID="&sysjobid"
|
|
||||||
, LOCK_REF="&ref"
|
|
||||||
where LOCK_LIB ="&lib" and LOCK_DS="&ds";
|
|
||||||
quit;
|
|
||||||
%end;
|
|
||||||
%else %if &status=UNLOCKED %then %do;
|
|
||||||
%put %str(WAR)NING: &lib..&ds is already unlocked!;
|
|
||||||
%end;
|
%end;
|
||||||
%else %do;
|
%else %do;
|
||||||
%put NOTE: Unrecognised STATUS_CD (&status) in &ctl_ds;
|
select LOCK_STATUS_CD into: status from &ctl_ds
|
||||||
%let abortme=1;
|
where LOCK_LIB ="&lib" and LOCK_DS="&ds";
|
||||||
|
quit;
|
||||||
|
%if &syscc>0 %then %put syscc=&syscc sqlrc=&sqlrc;
|
||||||
|
%if &status=LOCKED %then %do;
|
||||||
|
data _null_;
|
||||||
|
putlog "&sysmacroname: unlocking &lib..&ds:";
|
||||||
|
run;
|
||||||
|
proc sql;
|
||||||
|
update &ctl_ds
|
||||||
|
set LOCK_STATUS_CD='UNLOCKED'
|
||||||
|
, LOCK_END_DTTM="%sysfunc(datetime(),%mf_fmtdttm())"dt
|
||||||
|
, LOCK_USER_NM="&user"
|
||||||
|
, LOCK_PID="&sysjobid"
|
||||||
|
, LOCK_REF="&ref"
|
||||||
|
where LOCK_LIB ="&lib" and LOCK_DS="&ds";
|
||||||
|
quit;
|
||||||
|
%end;
|
||||||
|
%else %if &status=UNLOCKED %then %do;
|
||||||
|
%put %str(WAR)NING: &lib..&ds is already unlocked!;
|
||||||
|
%end;
|
||||||
|
%else %do;
|
||||||
|
%put NOTE: Unrecognised STATUS_CD (&status) in &ctl_ds;
|
||||||
|
%let abortme=1;
|
||||||
|
%end;
|
||||||
%end;
|
%end;
|
||||||
%end;
|
%end;
|
||||||
%else %do;
|
%else %do;
|
||||||
|
|||||||
Reference in New Issue
Block a user