Chapter Contents

Previous

Next
FILE

FILE



Specifies the current output file for PUT statements

Valid: in a DATA step
UNIX specifics: file-specification and host-options


Syntax
See Also

Syntax

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

file-specification
can be any of the file specification forms discussed in Accessing an External File or Device .

options
can be any of the portable options for the FILE statement. See SAS Language Reference: Dictionary for a description of these options.

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

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

LRECL=
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.

MOD
indicates that data written to the file should be appended to the file.

NEW|OLD
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.

RECFM=
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).

UNBUF
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.


See Also


Chapter Contents

Previous

Next

Top of Page

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