@sasjs/core 3.0.1 → 3.0.2
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_jsonout.sas +6 -6
- package/package.json +1 -1
- package/server/ms_webout.sas +11 -8
package/base/mp_jsonout.sas
CHANGED
|
@@ -62,13 +62,13 @@
|
|
|
62
62
|
%put output location=&jref;
|
|
63
63
|
%if &action=OPEN %then %do;
|
|
64
64
|
options nobomfile;
|
|
65
|
-
data _null_;file &jref encoding='utf-8';
|
|
65
|
+
data _null_;file &jref encoding='utf-8' termstr=lf;
|
|
66
66
|
put '{"PROCESSED_DTTM" : "' "%sysfunc(datetime(),E8601DT26.6)" '"';
|
|
67
67
|
run;
|
|
68
68
|
%end;
|
|
69
69
|
%else %if (&action=ARR or &action=OBJ) %then %do;
|
|
70
70
|
options validvarname=upcase;
|
|
71
|
-
data _null_;file &jref mod encoding='utf-8';
|
|
71
|
+
data _null_;file &jref mod encoding='utf-8' termstr=lf;
|
|
72
72
|
put ", ""%lowcase(%sysfunc(coalescec(&dslabel,&ds)))"":";
|
|
73
73
|
|
|
74
74
|
%if &engine=PROCJSON %then %do;
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
run;
|
|
148
148
|
%let ds=&fmtds;
|
|
149
149
|
%end; /* &fmt=Y */
|
|
150
|
-
data _null_;file &jref mod encoding='utf-8';
|
|
150
|
+
data _null_;file &jref mod encoding='utf-8' termstr=lf;
|
|
151
151
|
put "["; call symputx('cols',0,'l');
|
|
152
152
|
proc sort
|
|
153
153
|
data=sashelp.vcolumn(where=(libname='WORK' & memname="%upcase(&ds)"))
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
/* write to temp loc to avoid _webout truncation
|
|
193
193
|
- https://support.sas.com/kb/49/325.html */
|
|
194
194
|
filename _sjs temp lrecl=131068 encoding='utf-8';
|
|
195
|
-
data _null_; file _sjs lrecl=131068 encoding='utf-8' mod;
|
|
195
|
+
data _null_; file _sjs lrecl=131068 encoding='utf-8' mod termstr=lf;
|
|
196
196
|
set &tempds;
|
|
197
197
|
if _n_>1 then put "," @; put
|
|
198
198
|
%if &action=ARR %then "[" ; %else "{" ;
|
|
@@ -219,14 +219,14 @@
|
|
|
219
219
|
rc = fclose(fileid);
|
|
220
220
|
run;
|
|
221
221
|
filename _sjs clear;
|
|
222
|
-
data _null_; file &jref mod encoding='utf-8';
|
|
222
|
+
data _null_; file &jref mod encoding='utf-8' termstr=lf;
|
|
223
223
|
put "]";
|
|
224
224
|
run;
|
|
225
225
|
%end;
|
|
226
226
|
%end;
|
|
227
227
|
|
|
228
228
|
%else %if &action=CLOSE %then %do;
|
|
229
|
-
data _null_;file &jref encoding='utf-8' mod;
|
|
229
|
+
data _null_;file &jref encoding='utf-8' mod termstr=lf;
|
|
230
230
|
put "}";
|
|
231
231
|
run;
|
|
232
232
|
%end;
|
package/package.json
CHANGED
package/server/ms_webout.sas
CHANGED
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
OPTIONS NOBOMFILE;
|
|
80
80
|
|
|
81
81
|
/* setup json */
|
|
82
|
-
data _null_;file &fref encoding='utf-8';
|
|
82
|
+
data _null_;file &fref encoding='utf-8' termstr=lf;
|
|
83
83
|
%if %str(&_debug) ge 131 %then %do;
|
|
84
84
|
put '>>weboutBEGIN<<';
|
|
85
85
|
%end;
|
|
@@ -108,14 +108,14 @@
|
|
|
108
108
|
i+1;
|
|
109
109
|
call symputx('wt'!!left(i),name,'l');
|
|
110
110
|
call symputx('wtcnt',i,'l');
|
|
111
|
-
data _null_; file &fref mod encoding='utf-8';
|
|
111
|
+
data _null_; file &fref mod encoding='utf-8' termstr=lf;
|
|
112
112
|
put ",""WORK"":{";
|
|
113
113
|
%do i=1 %to &wtcnt;
|
|
114
114
|
%let wt=&&wt&i;
|
|
115
115
|
proc contents noprint data=&wt
|
|
116
116
|
out=_data_ (keep=name type length format:);
|
|
117
117
|
run;%let tempds=%scan(&syslast,2,.);
|
|
118
|
-
data _null_; file &fref mod encoding='utf-8';
|
|
118
|
+
data _null_; file &fref mod encoding='utf-8' termstr=lf;
|
|
119
119
|
dsid=open("WORK.&wt",'is');
|
|
120
120
|
nlobs=attrn(dsid,'NLOBS');
|
|
121
121
|
nvars=attrn(dsid,'NVARS');
|
|
@@ -126,15 +126,15 @@
|
|
|
126
126
|
put ',"nvars":' nvars;
|
|
127
127
|
%mp_jsonout(OBJ,&tempds,jref=&fref,dslabel=colattrs,engine=DATASTEP)
|
|
128
128
|
%mp_jsonout(OBJ,&wt,jref=&fref,dslabel=first10rows,engine=DATASTEP)
|
|
129
|
-
data _null_; file &fref mod encoding='utf-8';
|
|
129
|
+
data _null_; file &fref mod encoding='utf-8' termstr=lf;
|
|
130
130
|
put "}";
|
|
131
131
|
%end;
|
|
132
|
-
data _null_; file &fref mod encoding='utf-8';
|
|
132
|
+
data _null_; file &fref mod encoding='utf-8' termstr=lf termstr=lf;
|
|
133
133
|
put "}";
|
|
134
134
|
run;
|
|
135
135
|
%end;
|
|
136
136
|
/* close off json */
|
|
137
|
-
data _null_;file &fref mod encoding='utf-8';
|
|
137
|
+
data _null_;file &fref mod encoding='utf-8' termstr=lf;
|
|
138
138
|
_PROGRAM=quote(trim(resolve(symget('_PROGRAM'))));
|
|
139
139
|
put ",""SYSUSERID"" : ""&sysuserid"" ";
|
|
140
140
|
put ",""MF_GETUSER"" : ""%mf_getuser()"" ";
|
|
@@ -147,7 +147,9 @@
|
|
|
147
147
|
put ",""SYSHOSTNAME"" : ""&syshostname"" ";
|
|
148
148
|
put ",""SYSPROCESSID"" : ""&SYSPROCESSID"" ";
|
|
149
149
|
put ",""SYSPROCESSMODE"" : ""&SYSPROCESSMODE"" ";
|
|
150
|
-
|
|
150
|
+
length SYSPROCESSNAME $512;
|
|
151
|
+
SYSPROCESSNAME=quote(urlencode(cats(SYSPROCESSNAME)));
|
|
152
|
+
put ",""SYSPROCESSNAME"" : " SYSPROCESSNAME;
|
|
151
153
|
put ",""SYSJOBID"" : ""&sysjobid"" ";
|
|
152
154
|
put ",""SYSSCPL"" : ""&sysscpl"" ";
|
|
153
155
|
put ",""SYSSITE"" : ""&syssite"" ";
|
|
@@ -156,7 +158,8 @@
|
|
|
156
158
|
put ',"SYSVLONG" : ' sysvlong;
|
|
157
159
|
put ",""SYSWARNINGTEXT"" : ""&syswarningtext"" ";
|
|
158
160
|
put ',"END_DTTM" : "' "%sysfunc(datetime(),datetime20.3)" '" ';
|
|
159
|
-
autoexec
|
|
161
|
+
length autoexec $512;
|
|
162
|
+
autoexec=quote(urlencode(trim(getoption('autoexec'))));
|
|
160
163
|
put ',"AUTOEXEC" : ' autoexec;
|
|
161
164
|
memsize="%sysfunc(INPUTN(%sysfunc(getoption(memsize)), best.),sizekmg.)";
|
|
162
165
|
memsize=quote(cats(memsize));
|