@sasjs/core 4.18.14 → 4.18.17

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_init.sas CHANGED
@@ -73,4 +73,4 @@ options
73
73
  %end;
74
74
  ;
75
75
 
76
- %mend mp_init;
76
+ %mend mp_init;
@@ -199,19 +199,23 @@
199
199
  format _numeric_ bart.;
200
200
  %do i=1 %to &numcols;
201
201
  %if &&typelong&i=char or &fmt=Y %then %do;
202
- &&name&i='"'!!trim(prxchange('s/"/\"/',-1,
203
- prxchange('s/'!!'0A'x!!'/\n/',-1,
204
- prxchange('s/'!!'0D'x!!'/\r/',-1,
205
- prxchange('s/'!!'09'x!!'/\t/',-1,
206
- prxchange('s/\x00/\\u0000/',-1, /* NUL */
207
- prxchange('s/\x0E/\\u000E/',-1, /* SS */
208
- prxchange('s/\x0F/\\u000F/',-1, /* SF */
209
- prxchange('s/\x01/\\u0001/',-1, /* SOH */
210
- prxchange('s/\x02/\\u0002/',-1, /* STX */
211
- prxchange('s/\x10/\\u0010/',-1, /* DLE */
212
- prxchange('s/\x11/\\u0011/',-1, /* DC1 */
213
- prxchange('s/\\/\\\\/',-1,&&name&i)
214
- ))))))))))))!!'"';
202
+ if findc(&&name&i,'"\'!!'0A0D09000E0F01021011'x) then do;
203
+ &&name&i='"'!!trim(
204
+ prxchange('s/"/\\"/',-1, /* double quote */
205
+ prxchange('s/\x0A/\n/',-1, /* new line */
206
+ prxchange('s/\x0D/\r/',-1, /* carriage return */
207
+ prxchange('s/\x09/\\t/',-1, /* tab */
208
+ prxchange('s/\x00/\\u0000/',-1, /* NUL */
209
+ prxchange('s/\x0E/\\u000E/',-1, /* SS */
210
+ prxchange('s/\x0F/\\u000F/',-1, /* SF */
211
+ prxchange('s/\x01/\\u0001/',-1, /* SOH */
212
+ prxchange('s/\x02/\\u0002/',-1, /* STX */
213
+ prxchange('s/\x10/\\u0010/',-1, /* DLE */
214
+ prxchange('s/\x11/\\u0011/',-1, /* DC1 */
215
+ prxchange('s/\\/\\\\/',-1,&&name&i)
216
+ ))))))))))))!!'"';
217
+ end;
218
+ else &&name&i=quote(cats(&&name&i));
215
219
  %end;
216
220
  %end;
217
221
  run;
@@ -232,19 +232,23 @@ data _null_;
232
232
  put ' format _numeric_ bart.; ';
233
233
  put ' %do i=1 %to &numcols; ';
234
234
  put ' %if &&typelong&i=char or &fmt=Y %then %do; ';
235
- put ' &&name&i=''"''!!trim(prxchange(''s/"/\"/'',-1, ';
236
- put ' prxchange(''s/''!!''0A''x!!''/\n/'',-1, ';
237
- put ' prxchange(''s/''!!''0D''x!!''/\r/'',-1, ';
238
- put ' prxchange(''s/''!!''09''x!!''/\t/'',-1, ';
239
- put ' prxchange(''s/\x00/\\u0000/'',-1, /* NUL */ ';
240
- put ' prxchange(''s/\x0E/\\u000E/'',-1, /* SS */ ';
241
- put ' prxchange(''s/\x0F/\\u000F/'',-1, /* SF */ ';
242
- put ' prxchange(''s/\x01/\\u0001/'',-1, /* SOH */ ';
243
- put ' prxchange(''s/\x02/\\u0002/'',-1, /* STX */ ';
244
- put ' prxchange(''s/\x10/\\u0010/'',-1, /* DLE */ ';
245
- put ' prxchange(''s/\x11/\\u0011/'',-1, /* DC1 */ ';
246
- put ' prxchange(''s/\\/\\\\/'',-1,&&name&i) ';
247
- put ' ))))))))))))!!''"''; ';
235
+ put ' if findc(&&name&i,''"\''!!''0A0D09000E0F01021011''x) then do; ';
236
+ put ' &&name&i=''"''!!trim( ';
237
+ put ' prxchange(''s/"/\\"/'',-1, /* double quote */ ';
238
+ put ' prxchange(''s/\x0A/\n/'',-1, /* new line */ ';
239
+ put ' prxchange(''s/\x0D/\r/'',-1, /* carriage return */ ';
240
+ put ' prxchange(''s/\x09/\\t/'',-1, /* tab */ ';
241
+ put ' prxchange(''s/\x00/\\u0000/'',-1, /* NUL */ ';
242
+ put ' prxchange(''s/\x0E/\\u000E/'',-1, /* SS */ ';
243
+ put ' prxchange(''s/\x0F/\\u000F/'',-1, /* SF */ ';
244
+ put ' prxchange(''s/\x01/\\u0001/'',-1, /* SOH */ ';
245
+ put ' prxchange(''s/\x02/\\u0002/'',-1, /* STX */ ';
246
+ put ' prxchange(''s/\x10/\\u0010/'',-1, /* DLE */ ';
247
+ put ' prxchange(''s/\x11/\\u0011/'',-1, /* DC1 */ ';
248
+ put ' prxchange(''s/\\/\\\\/'',-1,&&name&i) ';
249
+ put ' ))))))))))))!!''"''; ';
250
+ put ' end; ';
251
+ put ' else &&name&i=quote(cats(&&name&i)); ';
248
252
  put ' %end; ';
249
253
  put ' %end; ';
250
254
  put ' run; ';
package/package.json CHANGED
@@ -35,8 +35,5 @@
35
35
  "devDependencies": {
36
36
  "@sasjs/cli": "3.13.0"
37
37
  },
38
- "dependencies": {
39
- "@sasjs/core": "^4.18.13"
40
- },
41
- "version": "4.18.14"
38
+ "version": "4.18.17"
42
39
  }
@@ -29,12 +29,16 @@
29
29
  ,mdebug=0
30
30
  );
31
31
 
32
- %local fname0 fname1 fname2 boundary fname statcd msg;
32
+ %local fname0 fname1 fname2 boundary fname statcd msg optval;
33
33
  %let fname0=%mf_getuniquefileref();
34
34
  %let fname1=%mf_getuniquefileref();
35
35
  %let fname2=%mf_getuniquefileref();
36
36
  %let boundary=%mf_getuniquename();
37
37
 
38
+ /* avoid sending bom marker to API */
39
+ %let optval=%sysfunc(getoption(bomfile));
40
+ options nobomfile;
41
+
38
42
  data _null_;
39
43
  file &fname0 termstr=crlf;
40
44
  infile &inref end=eof;
@@ -95,4 +99,7 @@ run;
95
99
  ,msg=%superq(msg)
96
100
  )
97
101
 
102
+ /* reset options */
103
+ options &optval;
104
+
98
105
  %mend ms_createfile;
@@ -376,19 +376,23 @@ data _null_;
376
376
  put ' format _numeric_ bart.; ';
377
377
  put ' %do i=1 %to &numcols; ';
378
378
  put ' %if &&typelong&i=char or &fmt=Y %then %do; ';
379
- put ' &&name&i=''"''!!trim(prxchange(''s/"/\"/'',-1, ';
380
- put ' prxchange(''s/''!!''0A''x!!''/\n/'',-1, ';
381
- put ' prxchange(''s/''!!''0D''x!!''/\r/'',-1, ';
382
- put ' prxchange(''s/''!!''09''x!!''/\t/'',-1, ';
383
- put ' prxchange(''s/\x00/\\u0000/'',-1, /* NUL */ ';
384
- put ' prxchange(''s/\x0E/\\u000E/'',-1, /* SS */ ';
385
- put ' prxchange(''s/\x0F/\\u000F/'',-1, /* SF */ ';
386
- put ' prxchange(''s/\x01/\\u0001/'',-1, /* SOH */ ';
387
- put ' prxchange(''s/\x02/\\u0002/'',-1, /* STX */ ';
388
- put ' prxchange(''s/\x10/\\u0010/'',-1, /* DLE */ ';
389
- put ' prxchange(''s/\x11/\\u0011/'',-1, /* DC1 */ ';
390
- put ' prxchange(''s/\\/\\\\/'',-1,&&name&i) ';
391
- put ' ))))))))))))!!''"''; ';
379
+ put ' if findc(&&name&i,''"\''!!''0A0D09000E0F01021011''x) then do; ';
380
+ put ' &&name&i=''"''!!trim( ';
381
+ put ' prxchange(''s/"/\\"/'',-1, /* double quote */ ';
382
+ put ' prxchange(''s/\x0A/\n/'',-1, /* new line */ ';
383
+ put ' prxchange(''s/\x0D/\r/'',-1, /* carriage return */ ';
384
+ put ' prxchange(''s/\x09/\\t/'',-1, /* tab */ ';
385
+ put ' prxchange(''s/\x00/\\u0000/'',-1, /* NUL */ ';
386
+ put ' prxchange(''s/\x0E/\\u000E/'',-1, /* SS */ ';
387
+ put ' prxchange(''s/\x0F/\\u000F/'',-1, /* SF */ ';
388
+ put ' prxchange(''s/\x01/\\u0001/'',-1, /* SOH */ ';
389
+ put ' prxchange(''s/\x02/\\u0002/'',-1, /* STX */ ';
390
+ put ' prxchange(''s/\x10/\\u0010/'',-1, /* DLE */ ';
391
+ put ' prxchange(''s/\x11/\\u0011/'',-1, /* DC1 */ ';
392
+ put ' prxchange(''s/\\/\\\\/'',-1,&&name&i) ';
393
+ put ' ))))))))))))!!''"''; ';
394
+ put ' end; ';
395
+ put ' else &&name&i=quote(cats(&&name&i)); ';
392
396
  put ' %end; ';
393
397
  put ' %end; ';
394
398
  put ' run; ';