Moves data to the File Data Buffer (FDB) of an external file, starting at the FDB's current column position.
Category: | External Files |
%macro ptest; %let filrf=myfile; %let rc=%sysfunc(filename(filrf,test.txt)); %let fid=%sysfunc(fopen(&filrf,a)); %if &fid > 0 %then %do; %let rc=%sysfunc(fread(&fid)); %let mystring=This is some data.; %let rc=%sysfunc(fput(&fid,&mystring)); %let rc=%sysfunc(fwrite(&fid)); %let rc=%sysfunc(fclose(&fid)); %end; %else %put %sysfunc(sysmsg()); %let rc=%sysfunc(filename(filrf)); %put return code = &rc; %mend; %ptest;