@sasjs/core 4.18.15 → 4.18.16

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.
@@ -199,19 +199,27 @@
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 prxmatch(
203
+ 'm/\"|\x0A|\x0D|\x09|\x00|\x0E|\x0F|\x01|\x02|\x10|\x11|\\/o',
204
+ &&name&i
205
+ )>0
206
+ then do;
207
+ &&name&i='"'!!trim(
208
+ prxchange('s/"/\\"/',-1, /* double quote */
209
+ prxchange('s/\x0A/\n/',-1, /* new line */
210
+ prxchange('s/\x0D/\r/',-1, /* carriage return */
211
+ prxchange('s/\x09/\\t/',-1, /* tab */
212
+ prxchange('s/\x00/\\u0000/',-1, /* NUL */
213
+ prxchange('s/\x0E/\\u000E/',-1, /* SS */
214
+ prxchange('s/\x0F/\\u000F/',-1, /* SF */
215
+ prxchange('s/\x01/\\u0001/',-1, /* SOH */
216
+ prxchange('s/\x02/\\u0002/',-1, /* STX */
217
+ prxchange('s/\x10/\\u0010/',-1, /* DLE */
218
+ prxchange('s/\x11/\\u0011/',-1, /* DC1 */
219
+ prxchange('s/\\/\\\\/',-1,&&name&i)
220
+ ))))))))))))!!'"';
221
+ end;
222
+ else &&name&i=quote(cats(&&name&i));
215
223
  %end;
216
224
  %end;
217
225
  run;
@@ -232,19 +232,27 @@ 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 prxmatch( ';
236
+ put ' ''m/\"|\x0A|\x0D|\x09|\x00|\x0E|\x0F|\x01|\x02|\x10|\x11|\\/o'', ';
237
+ put ' &&name&i ';
238
+ put ' )>0 ';
239
+ put ' then do; ';
240
+ put ' &&name&i=''"''!!trim( ';
241
+ put ' prxchange(''s/"/\\"/'',-1, /* double quote */ ';
242
+ put ' prxchange(''s/\x0A/\n/'',-1, /* new line */ ';
243
+ put ' prxchange(''s/\x0D/\r/'',-1, /* carriage return */ ';
244
+ put ' prxchange(''s/\x09/\\t/'',-1, /* tab */ ';
245
+ put ' prxchange(''s/\x00/\\u0000/'',-1, /* NUL */ ';
246
+ put ' prxchange(''s/\x0E/\\u000E/'',-1, /* SS */ ';
247
+ put ' prxchange(''s/\x0F/\\u000F/'',-1, /* SF */ ';
248
+ put ' prxchange(''s/\x01/\\u0001/'',-1, /* SOH */ ';
249
+ put ' prxchange(''s/\x02/\\u0002/'',-1, /* STX */ ';
250
+ put ' prxchange(''s/\x10/\\u0010/'',-1, /* DLE */ ';
251
+ put ' prxchange(''s/\x11/\\u0011/'',-1, /* DC1 */ ';
252
+ put ' prxchange(''s/\\/\\\\/'',-1,&&name&i) ';
253
+ put ' ))))))))))))!!''"''; ';
254
+ put ' end; ';
255
+ put ' else &&name&i=quote(cats(&&name&i)); ';
248
256
  put ' %end; ';
249
257
  put ' %end; ';
250
258
  put ' run; ';
package/package.json CHANGED
@@ -35,5 +35,5 @@
35
35
  "devDependencies": {
36
36
  "@sasjs/cli": "3.13.0"
37
37
  },
38
- "version": "4.18.15"
38
+ "version": "4.18.16"
39
39
  }
@@ -376,19 +376,27 @@ 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 prxmatch( ';
380
+ put ' ''m/\"|\x0A|\x0D|\x09|\x00|\x0E|\x0F|\x01|\x02|\x10|\x11|\\/o'', ';
381
+ put ' &&name&i ';
382
+ put ' )>0 ';
383
+ put ' then do; ';
384
+ put ' &&name&i=''"''!!trim( ';
385
+ put ' prxchange(''s/"/\\"/'',-1, /* double quote */ ';
386
+ put ' prxchange(''s/\x0A/\n/'',-1, /* new line */ ';
387
+ put ' prxchange(''s/\x0D/\r/'',-1, /* carriage return */ ';
388
+ put ' prxchange(''s/\x09/\\t/'',-1, /* tab */ ';
389
+ put ' prxchange(''s/\x00/\\u0000/'',-1, /* NUL */ ';
390
+ put ' prxchange(''s/\x0E/\\u000E/'',-1, /* SS */ ';
391
+ put ' prxchange(''s/\x0F/\\u000F/'',-1, /* SF */ ';
392
+ put ' prxchange(''s/\x01/\\u0001/'',-1, /* SOH */ ';
393
+ put ' prxchange(''s/\x02/\\u0002/'',-1, /* STX */ ';
394
+ put ' prxchange(''s/\x10/\\u0010/'',-1, /* DLE */ ';
395
+ put ' prxchange(''s/\x11/\\u0011/'',-1, /* DC1 */ ';
396
+ put ' prxchange(''s/\\/\\\\/'',-1,&&name&i) ';
397
+ put ' ))))))))))))!!''"''; ';
398
+ put ' end; ';
399
+ put ' else &&name&i=quote(cats(&&name&i)); ';
392
400
  put ' %end; ';
393
401
  put ' %end; ';
394
402
  put ' run; ';