1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-10 14:04:36 +00:00

fix: ms_createfile will now overwrite if existing

This commit is contained in:
munja
2022-04-28 11:17:25 +01:00
parent c83ea705a2
commit 099a5f7840

View File

@@ -21,6 +21,7 @@
@li mf_getuniquefileref.sas
@li mf_getuniquename.sas
@li mp_abort.sas
@li ms_deletefile.sas
**/
@@ -29,6 +30,9 @@
,mdebug=0
);
/* first, delete in case it exists */
%ms_deletefile(&driveloc,mdebug=&mdebug)
%local fname0 fname1 fname2 boundary fname statcd msg optval;
%let fname0=%mf_getuniquefileref();
%let fname1=%mf_getuniquefileref();
@@ -40,8 +44,8 @@
options nobomfile;
data _null_;
file &fname0 termstr=crlf;
infile &inref end=eof;
file &fname0 termstr=crlf lrecl=32767;
infile &inref end=eof lrecl=32767;
if _n_ = 1 then do;
put "--&boundary.";
put 'Content-Disposition: form-data; name="filePath"';
@@ -70,11 +74,11 @@ run;
%if &mdebug=1 %then %do;
data _null_;
infile &fname0;
infile &fname0 lrecl=32767;
input;
put _infile_;
data _null_;
infile &fname1;
infile &fname1 lrecl=32767;
input;
put _infile_;
run;