@sasjs/core 4.31.2 → 4.32.1
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_binarycopy.sas +12 -22
- package/base/mp_ds2cards.sas +2 -1
- package/base/mp_jsonout.sas +11 -15
- package/meta/mm_createfolder.sas +1 -1
- package/meta/mm_createwebservice.sas +16 -20
- package/meta/mm_webout.sas +1 -0
- package/package.json +1 -1
- package/server/ms_createwebservice.sas +12 -15
- package/server/ms_webout.sas +1 -0
- package/viya/mv_createwebservice.sas +11 -15
package/base/mp_binarycopy.sas
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
@details Reads in a file byte by byte and writes it back out. Is an
|
|
5
5
|
os-independent method to copy files. In case of naming collision, the
|
|
6
6
|
default filerefs can be modified.
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
Note that if you have a new enough version of SAS, and you don't need features
|
|
8
|
+
such as APPEND, you may be better of using the fcopy() function instead.
|
|
9
9
|
|
|
10
10
|
%mp_binarycopy(inloc="/home/me/blah.txt", outref=_webout)
|
|
11
11
|
|
|
@@ -45,14 +45,9 @@
|
|
|
45
45
|
,outref=____out /* override default to use own filerefs */
|
|
46
46
|
,mode=CREATE
|
|
47
47
|
)/*/STORE SOURCE*/;
|
|
48
|
-
%local mod
|
|
49
|
-
%if &mode=APPEND %then %
|
|
50
|
-
|
|
51
|
-
%let outmode='a';
|
|
52
|
-
%end;
|
|
53
|
-
%else %do;
|
|
54
|
-
%let outmode='o';
|
|
55
|
-
%end;
|
|
48
|
+
%local mod;
|
|
49
|
+
%if &mode=APPEND %then %let mod=mod;
|
|
50
|
+
|
|
56
51
|
/* these IN and OUT filerefs can point to anything */
|
|
57
52
|
%if &inref = ____in %then %do;
|
|
58
53
|
filename &inref &inloc lrecl=1048576 ;
|
|
@@ -63,22 +58,17 @@
|
|
|
63
58
|
|
|
64
59
|
/* copy the file byte-for-byte */
|
|
65
60
|
data _null_;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
rc = fget(filein,rec,1);
|
|
72
|
-
rc = fput(fileid, rec);
|
|
73
|
-
rc =fwrite(fileid);
|
|
74
|
-
end;
|
|
75
|
-
rc = fclose(filein);
|
|
76
|
-
rc = fclose(fileid);
|
|
61
|
+
infile &inref lrecl=1 recfm=n;
|
|
62
|
+
file &outref &mod recfm=n;
|
|
63
|
+
input sourcechar $char1. @@;
|
|
64
|
+
format sourcechar hex2.;
|
|
65
|
+
put sourcechar char1. @@;
|
|
77
66
|
run;
|
|
67
|
+
|
|
78
68
|
%if &inref = ____in %then %do;
|
|
79
69
|
filename &inref clear;
|
|
80
70
|
%end;
|
|
81
71
|
%if &outref=____out %then %do;
|
|
82
72
|
filename &outref clear;
|
|
83
73
|
%end;
|
|
84
|
-
%mend mp_binarycopy;
|
|
74
|
+
%mend mp_binarycopy;
|
package/base/mp_ds2cards.sas
CHANGED
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
@cond
|
|
52
52
|
**/
|
|
53
53
|
|
|
54
|
-
%macro mp_ds2cards(base_ds
|
|
54
|
+
%macro mp_ds2cards(base_ds, tgt_ds=
|
|
55
55
|
,cards_file="%sysfunc(pathname(work))/cardgen.sas"
|
|
56
56
|
,maxobs=max
|
|
57
57
|
,random_sample=NO
|
|
@@ -254,6 +254,7 @@ data _null_;
|
|
|
254
254
|
;
|
|
255
255
|
%end;
|
|
256
256
|
put ";";
|
|
257
|
+
put 'missing a b c d e f g h i j k l m n o p q r s t u v w x y z _;';
|
|
257
258
|
put "datalines4;";
|
|
258
259
|
end;
|
|
259
260
|
end;
|
package/base/mp_jsonout.sas
CHANGED
|
@@ -234,22 +234,18 @@
|
|
|
234
234
|
"&&name&i"n /* name literal for reserved variable names */
|
|
235
235
|
%end;
|
|
236
236
|
%if &action=ARR %then "]" ; %else "}" ; ;
|
|
237
|
-
/* now write the long strings to _webout 1
|
|
237
|
+
/* now write the long strings to _webout 1 char at a time */
|
|
238
238
|
data _null_;
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
rc=fput(fileid, "]");
|
|
250
|
-
rc=fwrite(fileid);
|
|
251
|
-
rc=fclose(filein);
|
|
252
|
-
rc=fclose(fileid);
|
|
239
|
+
infile _sjs lrecl=1 recfm=n;
|
|
240
|
+
file &jref mod lrecl=1 recfm=n;
|
|
241
|
+
input sourcechar $char1. @@;
|
|
242
|
+
format sourcechar hex2.;
|
|
243
|
+
put sourcechar char1. @@;
|
|
244
|
+
run;
|
|
245
|
+
/* close out the table */
|
|
246
|
+
data _null_;
|
|
247
|
+
file &jref mod;
|
|
248
|
+
put ']';
|
|
253
249
|
run;
|
|
254
250
|
filename _sjs clear;
|
|
255
251
|
%end;
|
package/meta/mm_createfolder.sas
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
@file mm_createwebservice.sas
|
|
3
3
|
@brief Create a Web Ready Stored Process
|
|
4
4
|
@details This macro creates a Type 2 Stored Process with the mm_webout macro
|
|
5
|
-
|
|
5
|
+
(and dependencies) included as pre-code.
|
|
6
|
+
|
|
6
7
|
Usage:
|
|
7
8
|
|
|
8
9
|
%* compile macros ;
|
|
@@ -267,22 +268,18 @@ data _null_;
|
|
|
267
268
|
put ' "&&name&i"n /* name literal for reserved variable names */ ';
|
|
268
269
|
put ' %end; ';
|
|
269
270
|
put ' %if &action=ARR %then "]" ; %else "}" ; ; ';
|
|
270
|
-
put ' /* now write the long strings to _webout 1
|
|
271
|
+
put ' /* now write the long strings to _webout 1 char at a time */ ';
|
|
271
272
|
put ' data _null_; ';
|
|
272
|
-
put '
|
|
273
|
-
put '
|
|
274
|
-
put '
|
|
275
|
-
put '
|
|
276
|
-
put '
|
|
277
|
-
put '
|
|
278
|
-
put '
|
|
279
|
-
put '
|
|
280
|
-
put '
|
|
281
|
-
put '
|
|
282
|
-
put ' rc=fput(fileid, "]"); ';
|
|
283
|
-
put ' rc=fwrite(fileid); ';
|
|
284
|
-
put ' rc=fclose(filein); ';
|
|
285
|
-
put ' rc=fclose(fileid); ';
|
|
273
|
+
put ' infile _sjs lrecl=1 recfm=n; ';
|
|
274
|
+
put ' file &jref mod lrecl=1 recfm=n; ';
|
|
275
|
+
put ' input sourcechar $char1. @@; ';
|
|
276
|
+
put ' format sourcechar hex2.; ';
|
|
277
|
+
put ' put sourcechar char1. @@; ';
|
|
278
|
+
put ' run; ';
|
|
279
|
+
put ' /* close out the table */ ';
|
|
280
|
+
put ' data _null_; ';
|
|
281
|
+
put ' file &jref mod; ';
|
|
282
|
+
put ' put '']''; ';
|
|
286
283
|
put ' run; ';
|
|
287
284
|
put ' filename _sjs clear; ';
|
|
288
285
|
put ' %end; ';
|
|
@@ -452,6 +449,7 @@ data _null_;
|
|
|
452
449
|
put ' put '',"_METAPERSON": '' _METAPERSON; ';
|
|
453
450
|
put ' put '',"_PROGRAM" : '' _PROGRAM ; ';
|
|
454
451
|
put ' put ",""SYSCC"" : ""&syscc"" "; ';
|
|
452
|
+
put ' put ",""SYSENCODING"" : ""&sysencoding"" "; ';
|
|
455
453
|
put ' syserrortext=quote(cats(symget(''SYSERRORTEXT''))); ';
|
|
456
454
|
put ' put '',"SYSERRORTEXT" : '' syserrortext; ';
|
|
457
455
|
put ' put ",""SYSHOSTNAME"" : ""&syshostname"" "; ';
|
|
@@ -493,7 +491,7 @@ run;
|
|
|
493
491
|
%if &x>1 %then %let mod=mod;
|
|
494
492
|
|
|
495
493
|
%let fref=%scan(&freflist,&x);
|
|
496
|
-
|
|
494
|
+
%&mD.put &sysmacroname: adding &fref;
|
|
497
495
|
data _null_;
|
|
498
496
|
file "&work/&tmpfile" lrecl=3000 &mod;
|
|
499
497
|
infile &fref;
|
|
@@ -529,12 +527,10 @@ data _null_;
|
|
|
529
527
|
if rc=0 then call symputx('url',url,'l');
|
|
530
528
|
run;
|
|
531
529
|
|
|
532
|
-
%put ;%put ;%put ;%put ;%put ;%put ;
|
|
533
530
|
%put &sysmacroname: STP &name successfully created in &path;
|
|
534
|
-
%put ;%put ;%put ;
|
|
535
531
|
%put Check it out here:;
|
|
536
532
|
%put ;%put ;%put ;
|
|
537
533
|
%put &url?_PROGRAM=&path/&name;
|
|
538
|
-
%put ;%put ;%put
|
|
534
|
+
%put ;%put ;%put ;
|
|
539
535
|
|
|
540
536
|
%mend mm_createwebservice;
|
package/meta/mm_webout.sas
CHANGED
|
@@ -157,6 +157,7 @@
|
|
|
157
157
|
put ',"_METAPERSON": ' _METAPERSON;
|
|
158
158
|
put ',"_PROGRAM" : ' _PROGRAM ;
|
|
159
159
|
put ",""SYSCC"" : ""&syscc"" ";
|
|
160
|
+
put ",""SYSENCODING"" : ""&sysencoding"" ";
|
|
160
161
|
syserrortext=quote(cats(symget('SYSERRORTEXT')));
|
|
161
162
|
put ',"SYSERRORTEXT" : ' syserrortext;
|
|
162
163
|
put ",""SYSHOSTNAME"" : ""&syshostname"" ";
|
package/package.json
CHANGED
|
@@ -269,22 +269,18 @@ data _null_;
|
|
|
269
269
|
put ' "&&name&i"n /* name literal for reserved variable names */ ';
|
|
270
270
|
put ' %end; ';
|
|
271
271
|
put ' %if &action=ARR %then "]" ; %else "}" ; ; ';
|
|
272
|
-
put ' /* now write the long strings to _webout 1
|
|
272
|
+
put ' /* now write the long strings to _webout 1 char at a time */ ';
|
|
273
273
|
put ' data _null_; ';
|
|
274
|
-
put '
|
|
275
|
-
put '
|
|
276
|
-
put '
|
|
277
|
-
put '
|
|
278
|
-
put '
|
|
279
|
-
put '
|
|
280
|
-
put '
|
|
281
|
-
put '
|
|
282
|
-
put '
|
|
283
|
-
put '
|
|
284
|
-
put ' rc=fput(fileid, "]"); ';
|
|
285
|
-
put ' rc=fwrite(fileid); ';
|
|
286
|
-
put ' rc=fclose(filein); ';
|
|
287
|
-
put ' rc=fclose(fileid); ';
|
|
274
|
+
put ' infile _sjs lrecl=1 recfm=n; ';
|
|
275
|
+
put ' file &jref mod lrecl=1 recfm=n; ';
|
|
276
|
+
put ' input sourcechar $char1. @@; ';
|
|
277
|
+
put ' format sourcechar hex2.; ';
|
|
278
|
+
put ' put sourcechar char1. @@; ';
|
|
279
|
+
put ' run; ';
|
|
280
|
+
put ' /* close out the table */ ';
|
|
281
|
+
put ' data _null_; ';
|
|
282
|
+
put ' file &jref mod; ';
|
|
283
|
+
put ' put '']''; ';
|
|
288
284
|
put ' run; ';
|
|
289
285
|
put ' filename _sjs clear; ';
|
|
290
286
|
put ' %end; ';
|
|
@@ -444,6 +440,7 @@ data _null_;
|
|
|
444
440
|
put ' put ",""_DEBUG"" : ""&_debug"" "; ';
|
|
445
441
|
put ' put '',"_PROGRAM" : '' _PROGRAM ; ';
|
|
446
442
|
put ' put ",""SYSCC"" : ""&syscc"" "; ';
|
|
443
|
+
put ' put ",""SYSENCODING"" : ""&sysencoding"" "; ';
|
|
447
444
|
put ' syserrortext=quote(cats(symget(''SYSERRORTEXT''))); ';
|
|
448
445
|
put ' put '',"SYSERRORTEXT" : '' syserrortext; ';
|
|
449
446
|
put ' SYSHOSTINFOLONG=quote(trim(symget(''SYSHOSTINFOLONG''))); ';
|
package/server/ms_webout.sas
CHANGED
|
@@ -153,6 +153,7 @@
|
|
|
153
153
|
put ",""_DEBUG"" : ""&_debug"" ";
|
|
154
154
|
put ',"_PROGRAM" : ' _PROGRAM ;
|
|
155
155
|
put ",""SYSCC"" : ""&syscc"" ";
|
|
156
|
+
put ",""SYSENCODING"" : ""&sysencoding"" ";
|
|
156
157
|
syserrortext=quote(cats(symget('SYSERRORTEXT')));
|
|
157
158
|
put ',"SYSERRORTEXT" : ' syserrortext;
|
|
158
159
|
SYSHOSTINFOLONG=quote(trim(symget('SYSHOSTINFOLONG')));
|
|
@@ -411,22 +411,18 @@ data _null_;
|
|
|
411
411
|
put ' "&&name&i"n /* name literal for reserved variable names */ ';
|
|
412
412
|
put ' %end; ';
|
|
413
413
|
put ' %if &action=ARR %then "]" ; %else "}" ; ; ';
|
|
414
|
-
put ' /* now write the long strings to _webout 1
|
|
414
|
+
put ' /* now write the long strings to _webout 1 char at a time */ ';
|
|
415
415
|
put ' data _null_; ';
|
|
416
|
-
put '
|
|
417
|
-
put '
|
|
418
|
-
put '
|
|
419
|
-
put '
|
|
420
|
-
put '
|
|
421
|
-
put '
|
|
422
|
-
put '
|
|
423
|
-
put '
|
|
424
|
-
put '
|
|
425
|
-
put '
|
|
426
|
-
put ' rc=fput(fileid, "]"); ';
|
|
427
|
-
put ' rc=fwrite(fileid); ';
|
|
428
|
-
put ' rc=fclose(filein); ';
|
|
429
|
-
put ' rc=fclose(fileid); ';
|
|
416
|
+
put ' infile _sjs lrecl=1 recfm=n; ';
|
|
417
|
+
put ' file &jref mod lrecl=1 recfm=n; ';
|
|
418
|
+
put ' input sourcechar $char1. @@; ';
|
|
419
|
+
put ' format sourcechar hex2.; ';
|
|
420
|
+
put ' put sourcechar char1. @@; ';
|
|
421
|
+
put ' run; ';
|
|
422
|
+
put ' /* close out the table */ ';
|
|
423
|
+
put ' data _null_; ';
|
|
424
|
+
put ' file &jref mod; ';
|
|
425
|
+
put ' put '']''; ';
|
|
430
426
|
put ' run; ';
|
|
431
427
|
put ' filename _sjs clear; ';
|
|
432
428
|
put ' %end; ';
|