Sets the position of the column pointer in the File Data Buffer (FDB).
| Category: | External Files |
ERROR: Cannot increase record length in update mode.
%macro ptest;
%let filrf=myfile;
%let rc=%sysfunc(filename(filrf,test.txt));
%let fid=%sysfunc(fopen(&filrf,o));
%let rc=%sysfunc(fread(&fid));
%put &fid;
%if (&fid > 0) %then
%do;
%let dataline=This is some data.;
/* Position at column 12 in the FDB. */
%let rc=%sysfunc(fpos(&fid,12));
%put &rc one;
/* Put the data in the FDB. */
%let rc=%sysfunc(fput(&fid,&dataline));
%put &rc two;
%if (&rc ne 0) %then
%do;
%put %sysfunc(sysmsg());
%end;
%else %do;
/* Write the record. */
%let rc=%sysfunc(fwrite(&fid));
%if (&rc ne 0) %then
%do;
%put write fails &rc;
%end;
%end;
/* Close the file. */
%let rc=%sysfunc(fclose(&fid));
%end;
%let rc=%sysfunc(filename(filrf));
%mend;
%ptest;