@sasjs/core 4.37.3 → 4.38.0
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.
|
@@ -18,11 +18,14 @@
|
|
|
18
18
|
%mp_deleteconstraints(inds=work.constraints,outds=dropped,execute=YES)
|
|
19
19
|
%mp_createconstraints(inds=work.constraints,outds=created,execute=YES)
|
|
20
20
|
|
|
21
|
-
@param inds= The input table containing the
|
|
22
|
-
|
|
23
|
-
@param
|
|
21
|
+
@param inds= (work.mp_getconstraints) The input table containing the
|
|
22
|
+
constraint info
|
|
23
|
+
@param outds= (work.mp_createconstraints) A table containing the create
|
|
24
|
+
statements (create_statement column)
|
|
25
|
+
@param execute= (NO) To actually create, use YES.
|
|
24
26
|
|
|
25
|
-
<h4>
|
|
27
|
+
<h4> Related Files </h4>
|
|
28
|
+
@li mp_getconstraints.sas
|
|
26
29
|
|
|
27
30
|
@version 9.2
|
|
28
31
|
@author Allan Bowe
|
|
@@ -30,7 +33,7 @@
|
|
|
30
33
|
**/
|
|
31
34
|
|
|
32
35
|
%macro mp_createconstraints(inds=mp_getconstraints
|
|
33
|
-
,outds=mp_createconstraints
|
|
36
|
+
,outds=work.mp_createconstraints
|
|
34
37
|
,execute=NO
|
|
35
38
|
)/*/STORE SOURCE*/;
|
|
36
39
|
|
|
@@ -64,4 +67,4 @@ data &outds;
|
|
|
64
67
|
output;
|
|
65
68
|
run;
|
|
66
69
|
|
|
67
|
-
%mend mp_createconstraints;
|
|
70
|
+
%mend mp_createconstraints;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
@file mp_dictionary.sas
|
|
3
|
+
@brief Creates a portal (libref) into the SQL Dictionary Views
|
|
4
|
+
@details Provide a libref and the macro will create a series of views against
|
|
5
|
+
each view in the special PROC SQL dictionary libref.
|
|
6
|
+
|
|
7
|
+
This is useful if you would like to visualise (navigate) the views in a SAS
|
|
8
|
+
client such as Base SAS, Enterprise Guide, or Studio (or [Data Controller](
|
|
9
|
+
https://datacontroller.io)).
|
|
10
|
+
|
|
11
|
+
It works by extracting the dictionary.dictionaries view into
|
|
12
|
+
YOURLIB.dictionaries, then uses that to create a YOURLIB.{viewName} for every
|
|
13
|
+
other dictionary.view, eg:
|
|
14
|
+
|
|
15
|
+
proc sql;
|
|
16
|
+
create view YOURLIB.columns as select * from dictionary.columns;
|
|
17
|
+
|
|
18
|
+
Usage:
|
|
19
|
+
|
|
20
|
+
libname demo "/lib/directory";
|
|
21
|
+
%mp_dictionary(lib=demo)
|
|
22
|
+
|
|
23
|
+
Or, to just create them in WORK:
|
|
24
|
+
|
|
25
|
+
%mp_dictionary()
|
|
26
|
+
|
|
27
|
+
If you'd just like to browse the dictionary data model, you can also check
|
|
28
|
+
out [this article](https://rawsas.com/dictionary-of-dictionaries/).
|
|
29
|
+
|
|
30
|
+
@param lib= (WORK) The libref in which to create the views
|
|
31
|
+
|
|
32
|
+
<h4> Related Files </h4>
|
|
33
|
+
@li mp_dictionary.test.sas
|
|
34
|
+
|
|
35
|
+
@version 9.2
|
|
36
|
+
@author Allan Bowe
|
|
37
|
+
|
|
38
|
+
**/
|
|
39
|
+
|
|
40
|
+
%macro mp_dictionary(lib=WORK)/*/STORE SOURCE*/;
|
|
41
|
+
%local list i mem;
|
|
42
|
+
proc sql noprint;
|
|
43
|
+
create view &lib..dictionaries as select * from dictionary.dictionaries;
|
|
44
|
+
select distinct memname into: list separated by ' ' from &lib..dictionaries;
|
|
45
|
+
%do i=1 %to %sysfunc(countw(&list,%str( )));
|
|
46
|
+
%let mem=%scan(&list,&i,%str( ));
|
|
47
|
+
create view &lib..&mem as select * from dictionary.&mem;
|
|
48
|
+
%end;
|
|
49
|
+
quit;
|
|
50
|
+
%mend mp_dictionary;
|
package/package.json
CHANGED