Hi. I tried this code to copy the file byte by byte. but result file being generated as blank file.
Approach I tried is:

data cars;
set sashelp.cars;
run;

%let l_workpath=&path;
libname va_rpt "&l_workpath";

data va_rpt.cars;
set cars;
run;

filename fileexp "&l_workpath/cars.sas7bdat";
data _null_;
fid = fopen ('fileexp');
filesize = finfo(fid, 'file size (bytes)');
put 'NOTE: ' filesize;
call symputx('contentln',filesize);
byte_range= filesize-1;
call symputx('byte_range',byte_range);
rc= fclose (fid);
run;

filename in "&l_workpath/cars.sas7bdat";
filename out "&l_workpath/cars_part1.sas7bdat";
/* 196608 */
/* copy the file byte-for-byte */
data _null_;
length filein 8 fileid 8;
filein = fopen('in','I',1,'B');
fileid = fopen('out','O',1,'B');
rec = '20'x;
do i=196608 to 0 by -1;
rc = fget(filein,rec,1);
rc = fput(fileid, rec);
rc =fwrite(fileid);
end;
rc = fclose(filein);
rc = fclose(fileid);
run;

filename in clear;
filename out clear;

filename fileexp1 "&l_workpath/cars_part1.sas7bdat";
data _null_;
fid = fopen ('fileexp1');
filesize = finfo(fid, 'file size (bytes)');
put 'NOTE: ' filesize;
call symputx('contentln',filesize);
byte_range= filesize-1;
call symputx('byte_range',byte_range);
rc= fclose (fid);
run;