SAS Component Language Dictionary |
Appends the current record to the end of an external file
sysrc=FAPPEND(file-id<,cc>);
|
-
sysrc
-
contains the return code for the operation:
0 |
successful |
0 |
not successful |
Type:
Numeric
-
file-id
-
contains the identifier that was assigned
when the file was opened. If file-id is invalid,
the program halts.
Type: Numeric
-
cc
-
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 terminal prompt.
-
'='
-
specifies that the line contains carriage-control
information.
-
all else
-
specifies that the record starts a new line.
Type: Character
FAPPEND adds the record currently contained
in the File Date Buffer (FDB) to the end of an external file.
Operating Environment Information: z/OS
Records
cannot be appended to partitioned data sets. ![[cautionend]](../../../../common/64368/HTML/default/images/cautend.gif)
Use FAPPEND to append a record to a file:
/* Assign the fileref THEFILE to the physical */
/* filename that the user entered in the */
/* field FNAME and open it in append mode. */
rc=filename( 'thefile',fname);
fid=fopen('thefile','a');
if (fid>0) then
do;
/* Append a new record to the file. */
rc=fput(fid,'Data for the new record');
rc=fappend(fid);
rc=fclose(fid);
end;
else
do;
...other SCL statements...
end;
rc=filename('thefile",'');
DOPEN
FGET
FOPEN
FPUT
FWRITE
MOPEN
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.