@sasjs/core 3.7.2 → 3.8.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.
package/README.md CHANGED
@@ -188,6 +188,13 @@ When contributing to this library, it is therefore important to ensure that all
188
188
 
189
189
  - All macros should be compatible with SAS versions from support level B and above (so currently 9.2 and later). If an earlier version is not supported, then the macro should say as such in the header documentation, and exit gracefully (eg `%if %sysevalf(&sysver<9.3) %then %return`).
190
190
 
191
+ ## Breaking Changes
192
+
193
+ We are currently on major release v3. The following changes are planned when the next major (breaking) release becomes necessary:
194
+
195
+ * Remove `dbg` parameter from mp_jsonout.sas (implement mdebug instead)
196
+ * Remove `END_DTTM` and `START_DTTM` from mx_webout JSON
197
+
191
198
  ## Star Gazing
192
199
 
193
200
  If you find this library useful, please leave a [star](https://github.com/sasjs/core/stargazers) and help us grow our star graph!
package/base/mp_abort.sas CHANGED
@@ -110,8 +110,8 @@
110
110
  %if %symexist(SYSPRINTTOLOG) %then %let logloc=&SYSPRINTTOLOG;
111
111
  %else %let logloc=%qsysfunc(getoption(LOG));
112
112
  proc printto log=log;run;
113
+ %let logline=0;
113
114
  %if %length(&logloc)>0 %then %do;
114
- %let logline=0;
115
115
  data _null_;
116
116
  infile &logloc lrecl=5000;
117
117
  input; putlog _infile_;
@@ -160,7 +160,10 @@
160
160
  file _webout mod lrecl=32000 encoding='utf-8';
161
161
  length msg $32767 ;
162
162
  sasdatetime=datetime();
163
- msg=cats(symget('msg'),'\n\nLog Extract:\n',symget('logmsg'));
163
+ msg=symget('msg');
164
+ %if &logline>0 %then %do;
165
+ msg=cats(msg,'\n\nLog Extract:\n',symget('logmsg'));
166
+ %end;
164
167
  /* escape the quotes */
165
168
  msg=tranwrd(msg,'"','\"');
166
169
  /* ditch the CRLFs as chrome complains */
@@ -142,16 +142,16 @@ run;
142
142
  proc sql noprint;
143
143
  select distinct lib into: liblist separated by ' ' from &inds;
144
144
  %put &=liblist;
145
- %do i=1 %to %sysfunc(countw(&liblist));
145
+ %if %length(&liblist)>0 %then %do i=1 %to %sysfunc(countw(&liblist));
146
146
  %let lib=%scan(&liblist,1);
147
147
  %let engine=%mf_getengine(&lib);
148
148
  %if &engine ne V9 and &engine ne BASE %then %do;
149
149
  %let msg=&lib has &engine engine - formats cannot be applied;
150
- proc sql;
151
150
  insert into &outds set lib="&lib",ds="_all_",var="_all", msg="&msg" ;
152
151
  %if &errds=0 %then %put %str(ERR)OR: &msg;
153
152
  %end;
154
153
  %end;
154
+ quit;
155
155
 
156
156
  %if %mf_nobs(&outds)>0 %then %return;
157
157
 
@@ -14,11 +14,11 @@
14
14
 
15
15
  @param ds The dataset from which to obtain column metadata
16
16
  @param outds= (work.cols) The output dataset to create. Sample data:
17
- |NAME $|LENGTH 8|VARNUM 8|LABEL $|FORMAT $49|TYPE $1 |DDTYPE $|
18
- |---|---|---|---|---|---|---|
19
- |AIR|8|2|international airline travel (thousands)|8.|N|NUMERIC|
20
- |DATE|8|1|DATE|MONYY.|N|DATE|
21
- |REGION|3|3|REGION|$3.|C|CHARACTER|
17
+ |NAME:$32.|LENGTH:best.|VARNUM:best.|LABEL:$256.|FMTNAME:$32.|FORMAT:$49.|TYPE:$1.|DDTYPE:$9.|
18
+ |---|---|---|---|---|---|---|---|
19
+ |`AIR `|`8 `|`2 `|`international airline travel (thousands) `|` `|`8. `|`N `|`NUMERIC `|
20
+ |`DATE `|`8 `|`1 `|`DATE `|`MONYY `|`MONYY. `|`N `|`DATE `|
21
+ |`REGION `|`3 `|`3 `|`REGION `|` `|`$3. `|`C `|`CHARACTER `|
22
22
 
23
23
  <h4> Related Macros </h4>
24
24
  @li mf_getvarlist.sas
@@ -30,26 +30,27 @@
30
30
  **/
31
31
 
32
32
  %macro mp_getcols(ds, outds=work.cols);
33
-
33
+ %local dropds;
34
34
  proc contents noprint data=&ds
35
35
  out=_data_ (keep=name type length label varnum format:);
36
36
  run;
37
- data &outds(keep=name type length varnum format label ddtype);
38
- set &syslast(rename=(format=format2 type=type2));
37
+ %let dropds=&syslast;
38
+ data &outds(keep=name type length varnum format label ddtype fmtname);
39
+ set &dropds(rename=(format=fmtname type=type2));
39
40
  name=upcase(name);
40
41
  if type2=2 then do;
41
42
  length format $49.;
42
- if format2='' then format=cats('$',length,'.');
43
- else if formatl=0 then format=cats(format2,'.');
44
- else format=cats(format2,formatl,'.');
43
+ if fmtname='' then format=cats('$',length,'.');
44
+ else if formatl=0 then format=cats(fmtname,'.');
45
+ else format=cats(fmtname,formatl,'.');
45
46
  type='C';
46
47
  ddtype='CHARACTER';
47
48
  end;
48
49
  else do;
49
- if format2='' then format=cats(length,'.');
50
- else if formatl=0 then format=cats(format2,'.');
51
- else if formatd=0 then format=cats(format2,formatl,'.');
52
- else format=cats(format2,formatl,'.',formatd);
50
+ if fmtname='' then format=cats(length,'.');
51
+ else if formatl=0 then format=cats(fmtname,'.');
52
+ else if formatd=0 then format=cats(fmtname,formatl,'.');
53
+ else format=cats(fmtname,formatl,'.',formatd);
53
54
  type='N';
54
55
  if format=:'DATETIME' or format=:'E8601DT' then ddtype='DATETIME';
55
56
  else if format=:'DATE' or format=:'DDMMYY' or format=:'MMDDYY'
@@ -61,5 +62,6 @@ data &outds(keep=name type length varnum format label ddtype);
61
62
  end;
62
63
  if label='' then label=name;
63
64
  run;
64
-
65
+ proc sql;
66
+ drop table &dropds;
65
67
  %mend mp_getcols;
@@ -31,22 +31,20 @@
31
31
  [sasjs adapter](https://github.com/sasjs/adapter).
32
32
  For more information see https://sasjs.io
33
33
 
34
- @param action Valid values:
34
+ @param [in] action Valid values:
35
35
  @li OPEN - opens the JSON
36
36
  @li OBJ - sends a table with each row as an object
37
37
  @li ARR - sends a table with each row in an array
38
38
  @li CLOSE - closes the JSON
39
-
40
- @param ds the dataset to send. Must be a work table.
41
- @param jref= the fileref to which to send the JSON
42
- @param dslabel= the name to give the table in the exported JSON
43
- @param fmt= Whether to keep or strip formats from the table
44
- @param engine= Which engine to use to send the JSON, valid options are:
39
+ @param [in] ds The dataset to send. Must be a work table.
40
+ @param [out] jref= (_webout) The fileref to which to send the JSON
41
+ @param [out] dslabel= The name to give the table in the exported JSON
42
+ @param [in] fmt= (Y) Whether to keep (Y) or strip (N) formats from the table
43
+ @param [in] engine= (DATASTEP) Which engine to use to send the JSON. Options:
45
44
  @li PROCJSON (default)
46
45
  @li DATASTEP (more reliable when data has non standard characters)
47
-
48
- @param dbg= DEPRECATED - was used to conditionally add PRETTY to
49
- proc json but this can cause line truncation in large files.
46
+ @param [in] missing= (NULL) Special numeric missing values can be sent as NULL
47
+ (eg `null`) or as STRING values (eg `".a"` or `".b"`)
50
48
 
51
49
  <h4> Related Macros <h4>
52
50
  @li mp_ds2fmtds.sas
@@ -57,9 +55,11 @@
57
55
 
58
56
  **/
59
57
 
60
- %macro mp_jsonout(action,ds,jref=_webout,dslabel=,fmt=Y,engine=DATASTEP,dbg=0
58
+ %macro mp_jsonout(action,ds,jref=_webout,dslabel=,fmt=Y,engine=DATASTEP
59
+ ,dbg=0 /* DEPRECATED */
60
+ ,missing=NULL
61
61
  )/*/STORE SOURCE*/;
62
- %put output location=&jref;
62
+ %put &sysmacroname: output location=&jref;
63
63
  %if &action=OPEN %then %do;
64
64
  options nobomfile;
65
65
  data _null_;file &jref encoding='utf-8' ;
@@ -72,10 +72,16 @@
72
72
  put ", ""%lowcase(%sysfunc(coalescec(&dslabel,&ds)))"":";
73
73
 
74
74
  %if &engine=PROCJSON %then %do;
75
+ %if &missing=STRING %then %do;
76
+ %put &sysmacroname: Special Missings are not supported in proc json.;
77
+ %put &sysmacroname: Switching to DATASTEP engine;
78
+ %goto datastep;
79
+ %end;
75
80
  data;run;%let tempds=&syslast;
76
81
  proc sql;drop table &tempds;
77
82
  data &tempds /view=&tempds;set &ds;
78
83
  %if &fmt=N %then format _numeric_ best32.;;
84
+ /* PRETTY is necessary to avoid line truncation in large files */
79
85
  proc json out=&jref pretty
80
86
  %if &action=ARR %then nokeys ;
81
87
  ;export &tempds / nosastags fmtnumeric;
@@ -83,6 +89,7 @@
83
89
  proc sql;drop view &tempds;
84
90
  %end;
85
91
  %else %if &engine=DATASTEP %then %do;
92
+ %datastep:
86
93
  %local cols i tempds;
87
94
  %let cols=0;
88
95
  %if %sysfunc(exist(&ds)) ne 1 & %sysfunc(exist(&ds,VIEW)) ne 1 %then %do;
@@ -163,7 +170,15 @@
163
170
  run;
164
171
 
165
172
  proc format; /* credit yabwon for special null removal */
166
- value bart ._ - .z = null
173
+ value bart
174
+ %if &missing=NULL %then %do;
175
+ ._ - .z = null
176
+ %end;
177
+ %else %do;
178
+ ._ = [quote()]
179
+ . = null
180
+ .a - .z = [quote()]
181
+ %end;
167
182
  other = [best.];
168
183
 
169
184
  data;run; %let tempds=&syslast; /* temp table for spesh char management */
@@ -90,8 +90,9 @@ data _null_;
90
90
  /* WEBOUT BEGIN */
91
91
  put ' ';
92
92
  put '%macro mp_jsonout(action,ds,jref=_webout,dslabel=,fmt=Y,engine=DATASTEP,dbg=0 ';
93
+ put ' ,missing=NULL ';
93
94
  put ')/*/STORE SOURCE*/; ';
94
- put '%put output location=&jref; ';
95
+ put '%put &sysmacroname: output location=&jref; ';
95
96
  put '%if &action=OPEN %then %do; ';
96
97
  put ' options nobomfile; ';
97
98
  put ' data _null_;file &jref encoding=''utf-8'' ; ';
@@ -104,10 +105,16 @@ data _null_;
104
105
  put ' put ", ""%lowcase(%sysfunc(coalescec(&dslabel,&ds)))"":"; ';
105
106
  put ' ';
106
107
  put ' %if &engine=PROCJSON %then %do; ';
108
+ put ' %if &missing=STRING %then %do; ';
109
+ put ' %put &sysmacroname: Special Missings are not supported in proc json.; ';
110
+ put ' %put &sysmacroname: Switching to DATASTEP engine; ';
111
+ put ' %goto datastep; ';
112
+ put ' %end; ';
107
113
  put ' data;run;%let tempds=&syslast; ';
108
114
  put ' proc sql;drop table &tempds; ';
109
115
  put ' data &tempds /view=&tempds;set &ds; ';
110
116
  put ' %if &fmt=N %then format _numeric_ best32.;; ';
117
+ put ' /* PRETTY is necessary to avoid line truncation in large files */ ';
111
118
  put ' proc json out=&jref pretty ';
112
119
  put ' %if &action=ARR %then nokeys ; ';
113
120
  put ' ;export &tempds / nosastags fmtnumeric; ';
@@ -115,6 +122,7 @@ data _null_;
115
122
  put ' proc sql;drop view &tempds; ';
116
123
  put ' %end; ';
117
124
  put ' %else %if &engine=DATASTEP %then %do; ';
125
+ put ' %datastep: ';
118
126
  put ' %local cols i tempds; ';
119
127
  put ' %let cols=0; ';
120
128
  put ' %if %sysfunc(exist(&ds)) ne 1 & %sysfunc(exist(&ds,VIEW)) ne 1 %then %do; ';
@@ -195,7 +203,15 @@ data _null_;
195
203
  put ' run; ';
196
204
  put ' ';
197
205
  put ' proc format; /* credit yabwon for special null removal */ ';
198
- put ' value bart ._ - .z = null ';
206
+ put ' value bart ';
207
+ put ' %if &missing=NULL %then %do; ';
208
+ put ' ._ - .z = null ';
209
+ put ' %end; ';
210
+ put ' %else %do; ';
211
+ put ' ._ = [quote()] ';
212
+ put ' . = null ';
213
+ put ' .a - .z = [quote()] ';
214
+ put ' %end; ';
199
215
  put ' other = [best.]; ';
200
216
  put ' ';
201
217
  put ' data;run; %let tempds=&syslast; /* temp table for spesh char management */ ';
@@ -263,7 +279,7 @@ data _null_;
263
279
  put ' run; ';
264
280
  put '%end; ';
265
281
  put '%mend mp_jsonout; ';
266
- put '%macro mm_webout(action,ds,dslabel=,fref=_webout,fmt=Y); ';
282
+ put '%macro mm_webout(action,ds,dslabel=,fref=_webout,fmt=Y,missing=NULL); ';
267
283
  put '%global _webin_file_count _webin_fileref1 _webin_name1 _program _debug ';
268
284
  put ' sasjs_tables; ';
269
285
  put '%local i tempds jsonengine; ';
@@ -328,7 +344,7 @@ data _null_;
328
344
  put ' ';
329
345
  put '%else %if &action=ARR or &action=OBJ %then %do; ';
330
346
  put ' %mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt,jref=&fref ';
331
- put ' ,engine=&jsonengine,dbg=%str(&_debug) ';
347
+ put ' ,engine=&jsonengine,missing=&missing ';
332
348
  put ' ) ';
333
349
  put '%end; ';
334
350
  put '%else %if &action=CLOSE %then %do; ';
@@ -23,17 +23,19 @@
23
23
  %mm_webout(CLOSE)
24
24
 
25
25
 
26
- @param action Either FETCH, OPEN, ARR, OBJ or CLOSE
27
- @param ds The dataset to send back to the frontend
28
- @param dslabel= value to use instead of the real name for sending to JSON
29
- @param fmt=(Y) Set to N to send back unformatted values
30
- @param fref=(_webout) The fileref to which to write the JSON
26
+ @param [in] action Either FETCH, OPEN, ARR, OBJ or CLOSE
27
+ @param [in] ds The dataset to send back to the frontend
28
+ @param [out] dslabel= Value to use instead of table name for sending to JSON
29
+ @param [in] fmt=(Y) Set to N to send back unformatted values
30
+ @param [out] fref= (_webout) The fileref to which to write the JSON
31
+ @param [in] missing= (NULL) Special numeric missing values can be sent as NULL
32
+ (eg `null`) or as STRING values (eg `".a"` or `".b"`)
31
33
 
32
34
  @version 9.3
33
35
  @author Allan Bowe
34
36
 
35
37
  **/
36
- %macro mm_webout(action,ds,dslabel=,fref=_webout,fmt=Y);
38
+ %macro mm_webout(action,ds,dslabel=,fref=_webout,fmt=Y,missing=NULL);
37
39
  %global _webin_file_count _webin_fileref1 _webin_name1 _program _debug
38
40
  sasjs_tables;
39
41
  %local i tempds jsonengine;
@@ -98,7 +100,7 @@
98
100
 
99
101
  %else %if &action=ARR or &action=OBJ %then %do;
100
102
  %mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt,jref=&fref
101
- ,engine=&jsonengine,dbg=%str(&_debug)
103
+ ,engine=&jsonengine,missing=&missing
102
104
  )
103
105
  %end;
104
106
  %else %if &action=CLOSE %then %do;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sasjs/core",
3
- "description": "Production Ready Macros for SAS Application Developers",
3
+ "description": "Macros for SAS Application Developers",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "SAS",
@@ -38,5 +38,5 @@
38
38
  "dependencies": {
39
39
  "ts-loader": "^9.2.6"
40
40
  },
41
- "version": "3.7.2"
41
+ "version": "3.8.0"
42
42
  }
@@ -20,11 +20,13 @@
20
20
  %ms_webout(CLOSE)
21
21
 
22
22
 
23
- @param action Either FETCH, OPEN, ARR, OBJ or CLOSE
24
- @param ds The dataset to send back to the frontend
25
- @param dslabel= value to use instead of the real name for sending to JSON
26
- @param fmt=(Y) Set to N to send back unformatted values
27
- @param fref=(_webout) The fileref to which to write the JSON
23
+ @param [in] action Either FETCH, OPEN, ARR, OBJ or CLOSE
24
+ @param [in] ds The dataset to send back to the frontend
25
+ @param [out] dslabel= value to use instead of table name for sending to JSON
26
+ @param [in] fmt= (Y) Set to N to send back unformatted values
27
+ @param [out] fref= (_webout) The fileref to which to write the JSON
28
+ @param [in] missing= (NULL) Special numeric missing values can be sent as NULL
29
+ (eg `null`) or as STRING values (eg `".a"` or `".b"`)
28
30
 
29
31
  <h4> SAS Macros </h4>
30
32
  @li mp_jsonout.sas
@@ -39,7 +41,7 @@
39
41
 
40
42
  **/
41
43
 
42
- %macro ms_webout(action,ds,dslabel=,fref=_webout,fmt=Y);
44
+ %macro ms_webout(action,ds,dslabel=,fref=_webout,fmt=Y,missing=NULL);
43
45
  %global _webin_file_count _webin_fileref1 _webin_name1 _program _debug
44
46
  sasjs_tables;
45
47
 
@@ -91,7 +93,7 @@
91
93
 
92
94
  %else %if &action=ARR or &action=OBJ %then %do;
93
95
  %mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt,jref=&fref
94
- ,engine=DATASTEP,dbg=%str(&_debug)
96
+ ,engine=DATASTEP,missing=&missing
95
97
  )
96
98
  %end;
97
99
  %else %if &action=CLOSE %then %do;
@@ -238,8 +238,9 @@ data _null_;
238
238
  /* WEBOUT BEGIN */
239
239
  put ' ';
240
240
  put '%macro mp_jsonout(action,ds,jref=_webout,dslabel=,fmt=Y,engine=DATASTEP,dbg=0 ';
241
+ put ' ,missing=NULL ';
241
242
  put ')/*/STORE SOURCE*/; ';
242
- put '%put output location=&jref; ';
243
+ put '%put &sysmacroname: output location=&jref; ';
243
244
  put '%if &action=OPEN %then %do; ';
244
245
  put ' options nobomfile; ';
245
246
  put ' data _null_;file &jref encoding=''utf-8'' ; ';
@@ -252,10 +253,16 @@ data _null_;
252
253
  put ' put ", ""%lowcase(%sysfunc(coalescec(&dslabel,&ds)))"":"; ';
253
254
  put ' ';
254
255
  put ' %if &engine=PROCJSON %then %do; ';
256
+ put ' %if &missing=STRING %then %do; ';
257
+ put ' %put &sysmacroname: Special Missings are not supported in proc json.; ';
258
+ put ' %put &sysmacroname: Switching to DATASTEP engine; ';
259
+ put ' %goto datastep; ';
260
+ put ' %end; ';
255
261
  put ' data;run;%let tempds=&syslast; ';
256
262
  put ' proc sql;drop table &tempds; ';
257
263
  put ' data &tempds /view=&tempds;set &ds; ';
258
264
  put ' %if &fmt=N %then format _numeric_ best32.;; ';
265
+ put ' /* PRETTY is necessary to avoid line truncation in large files */ ';
259
266
  put ' proc json out=&jref pretty ';
260
267
  put ' %if &action=ARR %then nokeys ; ';
261
268
  put ' ;export &tempds / nosastags fmtnumeric; ';
@@ -263,6 +270,7 @@ data _null_;
263
270
  put ' proc sql;drop view &tempds; ';
264
271
  put ' %end; ';
265
272
  put ' %else %if &engine=DATASTEP %then %do; ';
273
+ put ' %datastep: ';
266
274
  put ' %local cols i tempds; ';
267
275
  put ' %let cols=0; ';
268
276
  put ' %if %sysfunc(exist(&ds)) ne 1 & %sysfunc(exist(&ds,VIEW)) ne 1 %then %do; ';
@@ -343,7 +351,15 @@ data _null_;
343
351
  put ' run; ';
344
352
  put ' ';
345
353
  put ' proc format; /* credit yabwon for special null removal */ ';
346
- put ' value bart ._ - .z = null ';
354
+ put ' value bart ';
355
+ put ' %if &missing=NULL %then %do; ';
356
+ put ' ._ - .z = null ';
357
+ put ' %end; ';
358
+ put ' %else %do; ';
359
+ put ' ._ = [quote()] ';
360
+ put ' . = null ';
361
+ put ' .a - .z = [quote()] ';
362
+ put ' %end; ';
347
363
  put ' other = [best.]; ';
348
364
  put ' ';
349
365
  put ' data;run; %let tempds=&syslast; /* temp table for spesh char management */ ';
@@ -411,7 +427,7 @@ data _null_;
411
427
  put ' run; ';
412
428
  put '%end; ';
413
429
  put '%mend mp_jsonout; ';
414
- put '%macro mv_webout(action,ds,fref=_mvwtemp,dslabel=,fmt=Y,stream=Y); ';
430
+ put '%macro mv_webout(action,ds,fref=_mvwtemp,dslabel=,fmt=Y,stream=Y,missing=NULL); ';
415
431
  put '%global _webin_file_count _webin_fileuri _debug _omittextlog _webin_name ';
416
432
  put ' sasjs_tables SYS_JES_JOB_URI; ';
417
433
  put '%if %index("&_debug",log) %then %let _debug=131; ';
@@ -538,7 +554,7 @@ data _null_;
538
554
  put '%end; ';
539
555
  put '%else %if &action=ARR or &action=OBJ %then %do; ';
540
556
  put ' %mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt ';
541
- put ' ,jref=&fref,engine=DATASTEP,dbg=%str(&_debug) ';
557
+ put ' ,jref=&fref,engine=DATASTEP,missing=&missing ';
542
558
  put ' ) ';
543
559
  put '%end; ';
544
560
  put '%else %if &action=CLOSE %then %do; ';
@@ -20,13 +20,15 @@
20
20
  %mv_webout(CLOSE)
21
21
 
22
22
 
23
- @param action Either OPEN, ARR, OBJ or CLOSE
24
- @param ds The dataset to send back to the frontend
25
- @param _webout= fileref for returning the json
26
- @param fref=(_mvwtemp) Temp fileref to which to write the output
27
- @param dslabel= value to use instead of the real name for sending to JSON
28
- @param fmt=(Y) change to N to strip formats from output
29
- @param stream=(Y) Change to N if not streaming to _webout
23
+ @param [in] action Either OPEN, ARR, OBJ or CLOSE
24
+ @param [in] ds The dataset to send back to the frontend
25
+ @param [in] _webout= fileref for returning the json
26
+ @param [out] fref=(_mvwtemp) Temp fileref to which to write the output
27
+ @param [out] dslabel= value to use instead of table name for sending to JSON
28
+ @param [in] fmt=(Y) change to N to strip formats from output
29
+ @param [in] stream=(Y) Change to N if not streaming to _webout
30
+ @param [in] missing= (NULL) Special numeric missing values can be sent as NULL
31
+ (eg `null`) or as STRING values (eg `".a"` or `".b"`)
30
32
 
31
33
  <h4> SAS Macros </h4>
32
34
  @li mp_jsonout.sas
@@ -36,7 +38,7 @@
36
38
  @author Allan Bowe, source: https://github.com/sasjs/core
37
39
 
38
40
  **/
39
- %macro mv_webout(action,ds,fref=_mvwtemp,dslabel=,fmt=Y,stream=Y);
41
+ %macro mv_webout(action,ds,fref=_mvwtemp,dslabel=,fmt=Y,stream=Y,missing=NULL);
40
42
  %global _webin_file_count _webin_fileuri _debug _omittextlog _webin_name
41
43
  sasjs_tables SYS_JES_JOB_URI;
42
44
  %if %index("&_debug",log) %then %let _debug=131;
@@ -163,7 +165,7 @@
163
165
  %end;
164
166
  %else %if &action=ARR or &action=OBJ %then %do;
165
167
  %mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt
166
- ,jref=&fref,engine=DATASTEP,dbg=%str(&_debug)
168
+ ,jref=&fref,engine=DATASTEP,missing=&missing
167
169
  )
168
170
  %end;
169
171
  %else %if &action=CLOSE %then %do;