@sasjs/core 4.37.3 → 4.39.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 constraint info
22
- @param outds= a table containing the create statements (create_statement column)
23
- @param execute= `YES|NO` - default is NO. To actually create, use YES.
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> SAS Macros </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,52 @@
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
+ ![](https://user-images.githubusercontent.com/4420615/188278365-2987db97-0594-4a39-ac81-dbacdef5cdc8.png)
31
+
32
+ @param lib= (WORK) The libref in which to create the views
33
+
34
+ <h4> Related Files </h4>
35
+ @li mp_dictionary.test.sas
36
+
37
+ @version 9.2
38
+ @author Allan Bowe
39
+
40
+ **/
41
+
42
+ %macro mp_dictionary(lib=WORK)/*/STORE SOURCE*/;
43
+ %local list i mem;
44
+ proc sql noprint;
45
+ create view &lib..dictionaries as select * from dictionary.dictionaries;
46
+ select distinct memname into: list separated by ' ' from &lib..dictionaries;
47
+ %do i=1 %to %sysfunc(countw(&list,%str( )));
48
+ %let mem=%scan(&list,&i,%str( ));
49
+ create view &lib..&mem as select * from dictionary.&mem;
50
+ %end;
51
+ quit;
52
+ %mend mp_dictionary;
package/package.json CHANGED
@@ -35,5 +35,5 @@
35
35
  "devDependencies": {
36
36
  "@sasjs/cli": "3.13.0"
37
37
  },
38
- "version": "4.37.3"
38
+ "version": "4.39.0"
39
39
  }
@@ -24,7 +24,8 @@
24
24
  @param [in] contentdisp= (inline) Content Disposition. Example values:
25
25
  @li inline
26
26
  @li attachment
27
-
27
+ @param [in] ctype= (0) Set a default HTTP Content-Type header to be returned
28
+ with the file when the content is retrieved from the Files service.
28
29
  @param [in] access_token_var= The global macro variable to contain the access
29
30
  token, if using authorization_code grant type.
30
31
  @param [in] grant_type= (sas_services) Valid values are:
@@ -52,6 +53,7 @@
52
53
  ,inref=
53
54
  ,intype=BINARY
54
55
  ,contentdisp=inline
56
+ ,ctype=0
55
57
  ,access_token_var=ACCESS_TOKEN
56
58
  ,grant_type=sas_services
57
59
  ,mdebug=0
@@ -103,8 +105,10 @@ filename &fref filesrvc
103
105
  folderPath="&path"
104
106
  filename="&name"
105
107
  cdisp="&contentdisp"
108
+ %if "&ctype" ne "0" %then %do;
109
+ ctype="&ctype"
110
+ %end;
106
111
  lrecl=1048544;
107
-
108
112
  %if &intype=BINARY %then %do;
109
113
  %mp_binarycopy(inref=&inref, outref=&fref)
110
114
  %end;