@sasjs/core 4.32.0 → 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_jsonout.sas +11 -15
- package/meta/mm_createfolder.sas +1 -1
- package/meta/mm_createwebservice.sas +15 -20
- package/package.json +1 -1
- package/server/ms_createwebservice.sas +11 -15
- 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_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; ';
|
|
@@ -494,7 +491,7 @@ run;
|
|
|
494
491
|
%if &x>1 %then %let mod=mod;
|
|
495
492
|
|
|
496
493
|
%let fref=%scan(&freflist,&x);
|
|
497
|
-
|
|
494
|
+
%&mD.put &sysmacroname: adding &fref;
|
|
498
495
|
data _null_;
|
|
499
496
|
file "&work/&tmpfile" lrecl=3000 &mod;
|
|
500
497
|
infile &fref;
|
|
@@ -530,12 +527,10 @@ data _null_;
|
|
|
530
527
|
if rc=0 then call symputx('url',url,'l');
|
|
531
528
|
run;
|
|
532
529
|
|
|
533
|
-
%put ;%put ;%put ;%put ;%put ;%put ;
|
|
534
530
|
%put &sysmacroname: STP &name successfully created in &path;
|
|
535
|
-
%put ;%put ;%put ;
|
|
536
531
|
%put Check it out here:;
|
|
537
532
|
%put ;%put ;%put ;
|
|
538
533
|
%put &url?_PROGRAM=&path/&name;
|
|
539
|
-
%put ;%put ;%put
|
|
534
|
+
%put ;%put ;%put ;
|
|
540
535
|
|
|
541
536
|
%mend mm_createwebservice;
|
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; ';
|
|
@@ -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; ';
|