@sasjs/core 2.61.1 → 3.0.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.
|
@@ -29,45 +29,44 @@
|
|
|
29
29
|
|
|
30
30
|
Usage:
|
|
31
31
|
|
|
32
|
-
%
|
|
32
|
+
%mp_ds2md(sashelp.class)
|
|
33
33
|
|
|
34
|
+
@param [in] libds the library / dataset to create or read from.
|
|
35
|
+
@param [out] outref= (mdtable) Fileref to contain the markdown
|
|
36
|
+
@param [out] showlog= (YES) Set to NO to avoid printing markdown to the log
|
|
34
37
|
|
|
35
38
|
<h4> SAS Macros </h4>
|
|
36
39
|
@li mf_getvarlist.sas
|
|
37
40
|
@li mf_getvarformat.sas
|
|
38
41
|
|
|
39
|
-
@param [in] libds= the library / dataset to create or read from.
|
|
40
|
-
@param [out] fref= Fileref to contain the markdown. Default=mdtable.
|
|
41
|
-
@param [out] showlog= set to YES to show the markdown in the log. Default=NO.
|
|
42
|
-
|
|
43
42
|
@version 9.3
|
|
44
43
|
@author Allan Bowe
|
|
45
44
|
**/
|
|
46
45
|
|
|
47
|
-
%macro
|
|
48
|
-
libds
|
|
49
|
-
|
|
50
|
-
showlog=
|
|
46
|
+
%macro mp_ds2md(
|
|
47
|
+
libds,
|
|
48
|
+
outref=mdtable,
|
|
49
|
+
showlog=YES
|
|
51
50
|
)/*/STORE SOURCE*/;
|
|
52
51
|
|
|
53
52
|
/* check fileref is assigned */
|
|
54
|
-
%if %sysfunc(fileref(&
|
|
55
|
-
filename &
|
|
53
|
+
%if %sysfunc(fileref(&outref)) > 0 %then %do;
|
|
54
|
+
filename &outref temp;
|
|
56
55
|
%end;
|
|
57
56
|
|
|
58
57
|
%local vars;
|
|
59
|
-
%let vars=%mf_getvarlist(&libds);
|
|
58
|
+
%let vars=%upcase(%mf_getvarlist(&libds));
|
|
60
59
|
|
|
61
60
|
/* create the header row */
|
|
62
61
|
data _null_;
|
|
63
|
-
file &
|
|
62
|
+
file &outref;
|
|
64
63
|
length line $32767;
|
|
65
64
|
call missing(line);
|
|
66
65
|
put '|'
|
|
67
66
|
%local i var fmt;
|
|
68
67
|
%do i=1 %to %sysfunc(countw(&vars));
|
|
69
68
|
%let var=%scan(&vars,&i);
|
|
70
|
-
%let fmt=%mf_getvarformat(&libds,&var,force=1);
|
|
69
|
+
%let fmt=%lowcase(%mf_getvarformat(&libds,&var,force=1));
|
|
71
70
|
"&var:&fmt|"
|
|
72
71
|
%end;
|
|
73
72
|
;
|
|
@@ -80,20 +79,20 @@ run;
|
|
|
80
79
|
|
|
81
80
|
/* write out the data */
|
|
82
81
|
data _null_;
|
|
83
|
-
file &
|
|
82
|
+
file &outref mod dlm='|' lrecl=32767;
|
|
84
83
|
set &libds ;
|
|
85
84
|
length line $32767;
|
|
86
|
-
line=cats(
|
|
85
|
+
line='|`'!!cats(%mf_getvarlist(&libds,dlm=%str(%)!!' `|`'!!cats%()))!!' `|';
|
|
87
86
|
put line;
|
|
88
87
|
run;
|
|
89
88
|
|
|
90
89
|
%if %upcase(&showlog)=YES %then %do;
|
|
91
90
|
options ps=max;
|
|
92
91
|
data _null_;
|
|
93
|
-
infile &
|
|
92
|
+
infile &outref;
|
|
94
93
|
input;
|
|
95
94
|
putlog _infile_;
|
|
96
95
|
run;
|
|
97
96
|
%end;
|
|
98
97
|
|
|
99
|
-
%mend
|
|
98
|
+
%mend mp_ds2md;
|
package/base/mp_getformats.sas
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
24
24
|
| | | | |$|F|B|1|0|32767|0|1|0|
|
|
25
25
|
| | | | |$|I|B|1|0|32767|0|1|0|
|
|
26
|
-
|
|
26
|
+
|` `|` `|/opt/sas/sas9/SASHome/SASFoundation/9.4/sasexe|UWIANYDT|$ANYDTIF|I|U|1|0|60|0|19|0|
|
|
27
27
|
| | |/opt/sas/sas9/SASHome/SASFoundation/9.4/sasexe|UWFASCII|$ASCII|F|U|1|0|32767|0|1|0|
|
|
28
28
|
| | |/opt/sas/sas9/SASHome/SASFoundation/9.4/sasexe|UWIASCII|$ASCII|I|U|1|0|32767|0|1|0|
|
|
29
29
|
| | |/opt/sas/sas9/SASHome/SASFoundation/9.4/sasexe|UWFBASE6|$BASE64X|F|U|1|0|32767|0|1|0|
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
@param [out] outdetail= (0) Provide an output dataset in which to export all
|
|
33
33
|
the custom format definitions (from proc format CNTLOUT). Definitions:
|
|
34
34
|
https://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473477.htm
|
|
35
|
-
|
|
35
|
+
Sample data:
|
|
36
36
|
|
|
37
37
|
|FMTNAME:$32.|START:$16.|END:$16.|LABEL:$256.|MIN:best.|MAX:best.|DEFAULT:best.|LENGTH:best.|FUZZ:best.|PREFIX:$2.|MULT:best.|FILL:$1.|NOEDIT:best.|TYPE:$1.|SEXCL:$1.|EEXCL:$1.|HLO:$13.|DECSEP:$1.|DIG3SEP:$1.|DATATYPE:$8.|LANGUAGE:$8.|
|
|
38
38
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
|`WHICHPATH `|`0 `|`0 `|`path1 `|`1 `|`40 `|`28 `|`28 `|`1E-12 `|` `|`0 `|` `|`0 `|`N `|`N `|`N `|` `|` `|` `|` `|` `|
|
|
40
|
+
|`WHICHPATH `|`**OTHER** `|`**OTHER** `|`big fat problem if not path1 `|`1 `|`40 `|`28 `|`28 `|`1E-12 `|` `|`0 `|` `|`0 `|`N `|`N `|`N `|`O `|` `|` `|` `|` `|
|
|
41
41
|
|
|
42
42
|
<h4> SAS Macros </h4>
|
|
43
43
|
@li mf_dedup.sas
|
package/base/mp_makedata.sas
CHANGED
package/package.json
CHANGED