Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mddl_dc_locktable.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Locktable DDL
4 @details For "locking" tables prior to multipass loads. Used by
5 mp_lockanytable.sas
6
7**/
8
9
10%macro mddl_dc_locktable(libds=WORK.LOCKTABLE);
11
12%local nn lib;
13%if "%substr(&sysver,1,1)" ne "4" and "%substr(&sysver,1,1)" ne "5" %then %do;
14 %let nn=not null;
15%end;
16%else %let nn=;
17
18 proc sql;
19 create table &libds(
20 lock_lib char(8),
21 lock_ds char(32),
22 lock_status_cd char(10) &nn,
23 lock_user_nm char(100) &nn ,
24 lock_ref char(200),
25 lock_pid char(10),
26 lock_start_dttm num format=E8601DT26.6,
27 lock_end_dttm num format=E8601DT26.6
28 );
29
30 %let libds=%upcase(&libds);
31 %if %index(&libds,.)=0 %then %let lib=WORK;
32 %else %let lib=%scan(&libds,1,.);
33
34 proc datasets lib=&lib noprint;
35 modify %scan(&libds,-1,.);
36 index create
37 pk_mp_lockanytable=(lock_lib lock_ds)
38 /nomiss unique;
39 quit;
40
41%mend mddl_dc_locktable;