28%macro ms_createfile(driveloc
34%ms_deletefile(&driveloc,mdebug=&mdebug)
36%local fname0 fname1 fname2 boundary fname statcd msg optval;
37%let fname0=%mf_getuniquefileref();
38%let fname1=%mf_getuniquefileref();
39%let fname2=%mf_getuniquefileref();
40%let boundary=%mf_getuniquename();
43%let optval=%sysfunc(getoption(bomfile));
47 file &fname0 termstr=crlf lrecl=32767;
48 infile &inref end=eof lrecl=32767;
51 put
'Content-Disposition: form-data; name="filePath"';
55 put
'Content-Disposition: form-data; name="file"; filename="ignore.sas"';
56 put
"Content-Type: text/plain";
68 file &fname1 lrecl=1000;
69 infile
"&_sasjs_tokenfile" lrecl=1000;
71 if _n_=1 then put
"Content-Type: multipart/form-data; boundary=&boundary";
75%
if &mdebug=1 %then %
do;
77 infile &fname0 lrecl=32767;
81 infile &fname1 lrecl=32767;
87proc http method=
'POST' in=&fname0 headerin=&fname1 out=&fname2
88 url=
"&_sasjs_apiserverurl/SASjsApi/drive/file";
89%
if &mdebug=1 %then %
do;
99 if _infile_=
'{"status":"success"}' then call symputx(
'statcd',1,
'l');
100 else call symputx(
'msg',_infile_,
'l');
105 ,mac=ms_createfile.sas