@sasjs/core 4.18.17 → 4.18.18
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/package.json +1 -1
- package/server/ms_createfile.sas +4 -1
- package/server/ms_deletefile.sas +14 -1
- package/server/ms_getfile.sas +14 -5
- package/server/ms_runstp.sas +3 -3
package/package.json
CHANGED
package/server/ms_createfile.sas
CHANGED
|
@@ -61,8 +61,11 @@ data _null_;
|
|
|
61
61
|
run;
|
|
62
62
|
|
|
63
63
|
data _null_;
|
|
64
|
-
file &fname1;
|
|
64
|
+
file &fname1 lrecl=1000;
|
|
65
|
+
infile "&_sasjs_tokenfile" lrecl=1000;
|
|
66
|
+
input;
|
|
65
67
|
put "Content-Type: multipart/form-data; boundary=&boundary";
|
|
68
|
+
put "Authorization: Bearer " _infile_;
|
|
66
69
|
run;
|
|
67
70
|
|
|
68
71
|
%if &mdebug=1 %then %do;
|
package/server/ms_deletefile.sas
CHANGED
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
@param [in] driveloc The full path to the file in SASjs Drive
|
|
18
18
|
@param [in] mdebug= (0) Set to 1 to enable DEBUG messages
|
|
19
19
|
|
|
20
|
+
<h4> SAS Macros </h4>
|
|
21
|
+
@li mf_getuniquefileref.sas
|
|
20
22
|
|
|
21
23
|
**/
|
|
22
24
|
|
|
@@ -24,12 +26,23 @@
|
|
|
24
26
|
,mdebug=0
|
|
25
27
|
);
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
%local headref;
|
|
30
|
+
%let headref=%mf_getuniquefileref();
|
|
31
|
+
|
|
32
|
+
data _null_;
|
|
33
|
+
file &headref lrecl=1000;
|
|
34
|
+
infile "&_sasjs_tokenfile" lrecl=1000;
|
|
35
|
+
input;
|
|
36
|
+
put "Authorization: Bearer " _infile_;
|
|
37
|
+
run;
|
|
38
|
+
|
|
39
|
+
proc http method='DELETE' headerin=&headref
|
|
28
40
|
url="&_sasjs_apiserverurl/SASjsApi/drive/file?_filePath=&driveloc";
|
|
29
41
|
%if &mdebug=1 %then %do;
|
|
30
42
|
debug level=2;
|
|
31
43
|
%end;
|
|
32
44
|
run;
|
|
33
45
|
|
|
46
|
+
filename &headref clear;
|
|
34
47
|
|
|
35
48
|
%mend ms_deletefile;
|
package/server/ms_getfile.sas
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Example:
|
|
7
7
|
|
|
8
|
-
%ms_getfile(/
|
|
8
|
+
%ms_getfile(/Public/app/dc/services/public/settings.sas, outref=myfile)
|
|
9
9
|
|
|
10
10
|
@param [in] driveloc The full path to the file in SASjs Drive
|
|
11
11
|
@param [out] outref= (msgetfil) The fileref to contain the file.
|
|
@@ -23,13 +23,21 @@
|
|
|
23
23
|
);
|
|
24
24
|
|
|
25
25
|
/* use the recfm in a separate fileref to avoid issues with subsequent reads */
|
|
26
|
-
%local binaryfref floc;
|
|
26
|
+
%local binaryfref floc headref;
|
|
27
27
|
%let binaryfref=%mf_getuniquefileref();
|
|
28
|
+
%let headref=%mf_getuniquefileref();
|
|
28
29
|
%let floc=%sysfunc(pathname(work))/%mf_getuniquename().txt;
|
|
29
|
-
filename &outref "&floc";
|
|
30
|
+
filename &outref "&floc" lrecl=32767;
|
|
30
31
|
filename &binaryfref "&floc" recfm=n;
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
data _null_;
|
|
34
|
+
file &headref lrecl=1000;
|
|
35
|
+
infile "&_sasjs_tokenfile" lrecl=1000;
|
|
36
|
+
input;
|
|
37
|
+
put "Authorization: Bearer " _infile_;
|
|
38
|
+
run;
|
|
39
|
+
|
|
40
|
+
proc http method='GET' out=&binaryfref headerin=&headref
|
|
33
41
|
url="&_sasjs_apiserverurl/SASjsApi/drive/file?_filePath=&driveloc";
|
|
34
42
|
%if &mdebug=1 %then %do;
|
|
35
43
|
debug level=2;
|
|
@@ -37,5 +45,6 @@ proc http method='GET' out=&binaryfref
|
|
|
37
45
|
run;
|
|
38
46
|
|
|
39
47
|
filename &binaryfref clear;
|
|
48
|
+
filename &headref clear;
|
|
40
49
|
|
|
41
|
-
%mend ms_getfile;
|
|
50
|
+
%mend ms_getfile;
|
package/server/ms_runstp.sas
CHANGED
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
)
|
|
44
44
|
|
|
45
45
|
data _null_;
|
|
46
|
-
file &fname1;
|
|
47
|
-
infile "&_sasjs_tokenfile";
|
|
46
|
+
file &fname1 lrecl=1000;
|
|
47
|
+
infile "&_sasjs_tokenfile" lrecl=1000;
|
|
48
48
|
input;
|
|
49
|
-
put 'Authorization: Bearer' _infile_;
|
|
49
|
+
put 'Authorization: Bearer ' _infile_;
|
|
50
50
|
run;
|
|
51
51
|
|
|
52
52
|
filename &outref temp;
|