1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-01 15:00:04 +00:00

fix: enabling binary copy of files with encoding that does not match session encoding

This commit is contained in:
Allan Bowe
2022-06-25 21:32:21 +00:00
parent 756f00d88d
commit e1afbc02c4
2 changed files with 12 additions and 22 deletions

17
all.sas
View File

@@ -3529,18 +3529,13 @@ run;
/* copy the file byte-for-byte */ /* copy the file byte-for-byte */
data _null_; data _null_;
length filein 8 fileid 8; infile &inref;
filein = fopen("&inref",'I',1,'B'); file &outref;
fileid = fopen("&outref",&outmode,1,'B'); input sourcechar $char1. @@;
rec = '20'x; format sourcechar hex2.;
do while(fread(filein)=0); put sourcechar char1. @@;
rc = fget(filein,rec,1);
rc = fput(fileid, rec);
rc =fwrite(fileid);
end;
rc = fclose(filein);
rc = fclose(fileid);
run; run;
%if &inref = ____in %then %do; %if &inref = ____in %then %do;
filename &inref clear; filename &inref clear;
%end; %end;

View File

@@ -63,18 +63,13 @@
/* copy the file byte-for-byte */ /* copy the file byte-for-byte */
data _null_; data _null_;
length filein 8 fileid 8; infile &inref;
filein = fopen("&inref",'I',1,'B'); file &outref;
fileid = fopen("&outref",&outmode,1,'B'); input sourcechar $char1. @@;
rec = '20'x; format sourcechar hex2.;
do while(fread(filein)=0); put sourcechar char1. @@;
rc = fget(filein,rec,1);
rc = fput(fileid, rec);
rc =fwrite(fileid);
end;
rc = fclose(filein);
rc = fclose(fileid);
run; run;
%if &inref = ____in %then %do; %if &inref = ____in %then %do;
filename &inref clear; filename &inref clear;
%end; %end;