Previous Page | Next Page

SAS Component Language Dictionary

FAPPEND



Appends the current record to the end of an external file
Category: External File

Syntax
Details
Example
See Also

Syntax

sysrc=FAPPEND(file-id<,cc>);

sysrc

contains the return code for the operation:

0

successful

[ne]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


Details

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]


Example

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",'');  


See Also

DOPEN

FGET

FOPEN

FPUT

FWRITE

MOPEN

Previous Page | Next Page | Top of Page