Appends the current record to the end of 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 | indicates that the record starts a new line. |
0 | skips one blank line before this new line. |
- | skips two blank lines before this new line. |
1 | specifies that the line starts a new page. |
+ | specifies that the line overstrikes a previous line. |
P | specifies that the line is a computer prompt. |
= | specifies that the line contains carriage control information. |
all else | specifies that the line record starts a new line. |
%let filrf=myfile;
%let rc=%sysfunc(filename(filrf,
physical-filename));
%let fid=%sysfunc(fopen(&filrf,a));
%if &fid > 0 %then
%do;
%let rc=%sysfunc(fput(&fid,
Data for the new record));
%let rc=%sysfunc(fappend(&fid));
%let rc=%sysfunc(fclose(&fid));
%end;
%else
%do;
/* unsuccessful open processing */
%end;