Chapter Contents




Writes the contents of the current window to an external file

UNIX specifics: valid file-specification



FILE <file-specification> <portable-options> <host-options>

can be any of the following:

are portable options for the FILE command. See SAS Language Reference: Dictionary for information about these options.

are specific to UNIX environments. These options can be any of the following:

specifies the number of bytes that are physically written in one I/O operation. The default is 8K. The maximum is 1G-1.

specifies the logical record length. Its meaning depends on the record format in effect (RECFM). The default is 256. The maximum length is 1G.

  • If RECFM=F, the value for the LRECL= option determines the length of each output record. The output record is truncated or padded with blanks to fit the specified size.

  • If RECFM=N, the value for the LRECL= option must be at least 256.

  • If RECFM=V, the value for the LRECL= option determines the maximum record length. Records that are longer than the specified length are divided into multiple records.

indicates that a new file is to be opened for output. If the file already exists, it is deleted and re-created. This is the default action.

specifies the record format. Values for the RECFM= option are
D default format (same as variable).
F fixed format. That is, each record has the same length. Do not use RECFM=F for external files that contain carriage-control characters.
N binary format. The file consists of a stream of bytes with no record boundaries.
P print format. The SAS System writes carriage-control characters.
V variable format. Each record ends in a newline character.
S370V variable S370 record format (V).
S370VB variable block S370 record format (VB).
S370VBS variable block with spanned records S370 record format (VBS).

tells the SAS System not to perform buffered writes to the file on any subsequent FILE statement. This option applies especially when writing to a data collection device.


If you do not enter a file-specification, then SAS uses the filename from the previous FILE or INCLUDE command. In this case, SAS first asks you if you want to overwrite the file. If you have not issued any FILE or INCLUDE commands, you receive an error message indicating that no default file exists.

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.