@sasjs/core 4.46.2 → 4.46.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/mp_lockanytable.sas +29 -25
- package/package.json +1 -1
package/base/mp_lockanytable.sas
CHANGED
|
@@ -194,35 +194,39 @@ run;
|
|
|
194
194
|
%end;
|
|
195
195
|
%end;
|
|
196
196
|
%else %if &ACTION=UNLOCK %then %do;
|
|
197
|
-
%local status;
|
|
197
|
+
%local status cnt;
|
|
198
|
+
%let cnt=0;
|
|
198
199
|
proc sql noprint;
|
|
199
|
-
select
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
%if &syscc>0 %then %put syscc=&syscc sqlrc=&sqlrc;
|
|
203
|
-
%if &sqlobs=0 %then %do;
|
|
204
|
-
%put %str(WAR)NING: &lib..&ds has never been locked!;
|
|
200
|
+
select count(*) into: cnt from &ctl_ds where LOCK_LIB ="&lib" & LOCK_DS="&ds";
|
|
201
|
+
%if &cnt=0 %then %do;
|
|
202
|
+
%put %str(WAR)NING: &lib..&ds was not previously locked in &ctl_ds!;
|
|
205
203
|
%end;
|
|
206
|
-
%else %
|
|
207
|
-
|
|
208
|
-
putlog "&sysmacroname: unlocking &lib..&ds:";
|
|
209
|
-
run;
|
|
210
|
-
proc sql;
|
|
211
|
-
update &ctl_ds
|
|
212
|
-
set LOCK_STATUS_CD='UNLOCKED'
|
|
213
|
-
, LOCK_END_DTTM="%sysfunc(datetime(),%mf_fmtdttm())"dt
|
|
214
|
-
, LOCK_USER_NM="&user"
|
|
215
|
-
, LOCK_PID="&sysjobid"
|
|
216
|
-
, LOCK_REF="&ref"
|
|
204
|
+
%else %do;
|
|
205
|
+
select LOCK_STATUS_CD into: status from &ctl_ds
|
|
217
206
|
where LOCK_LIB ="&lib" and LOCK_DS="&ds";
|
|
218
207
|
quit;
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
208
|
+
%if &syscc>0 %then %put syscc=&syscc sqlrc=&sqlrc;
|
|
209
|
+
%if &status=LOCKED %then %do;
|
|
210
|
+
data _null_;
|
|
211
|
+
putlog "&sysmacroname: unlocking &lib..&ds:";
|
|
212
|
+
run;
|
|
213
|
+
proc sql;
|
|
214
|
+
update &ctl_ds
|
|
215
|
+
set LOCK_STATUS_CD='UNLOCKED'
|
|
216
|
+
, LOCK_END_DTTM="%sysfunc(datetime(),%mf_fmtdttm())"dt
|
|
217
|
+
, LOCK_USER_NM="&user"
|
|
218
|
+
, LOCK_PID="&sysjobid"
|
|
219
|
+
, LOCK_REF="&ref"
|
|
220
|
+
where LOCK_LIB ="&lib" and LOCK_DS="&ds";
|
|
221
|
+
quit;
|
|
222
|
+
%end;
|
|
223
|
+
%else %if &status=UNLOCKED %then %do;
|
|
224
|
+
%put %str(WAR)NING: &lib..&ds is already unlocked!;
|
|
225
|
+
%end;
|
|
226
|
+
%else %do;
|
|
227
|
+
%put NOTE: Unrecognised STATUS_CD (&status) in &ctl_ds;
|
|
228
|
+
%let abortme=1;
|
|
229
|
+
%end;
|
|
226
230
|
%end;
|
|
227
231
|
%end;
|
|
228
232
|
%else %do;
|
package/package.json
CHANGED