Writes a record to an external file.
| Category: | External Files |
is a numeric variable that specifies the identifier that was assigned when the file was opened, generally by the FOPEN function.
is a character constant, variable, or expression that specifies a carriage-control character:
| blank | starts the record on a new line. |
| 0 | skips one blank line before a new line. |
| - | skips two blank lines before a new line. |
| 1 | starts the line on a new page. |
| + | overstrikes the line on a previous line. |
| P | interprets the line as a computer prompt. |
| = | interprets the line as carriage control information. |
| all else | starts the line record on a new line. |
%let filrf=myfile;
%let rc=%sysfunc(filename(filrf,
physical-filename));
%let fid=%sysfunc(fopen(&filrf,o,0,P));
%do i=1 %to 50;
%let rc=%sysfunc(fput(&fid,
%sysfunc(putn(&i,2.))));
%if (%sysfunc(fwrite(&fid,-)) ne 0) %then
%put %sysfunc(sysmsg());
%end;
%let rc=%sysfunc(fclose(&fid));