Chapter Contents

Previous

Next
FILE

FILE



Writes the contents of the current window to an external file

Language element: command
OpenVMS specifics: valid values for file-specification


Syntax
Details
Examples
Example 1: Copying Text from a Window to a File
Example 2: Appending Text to an Existing External File
See Also

Syntax

FILE <filename> <option-list>

file-specification
can be any of the following:

option-list
specifies portable options for the FILE command. For more information about these options, see the FILE command in the SAS online Help.


Details

The FILE command writes the entire contents of the current window to an external file without removing text from the window.

You can also use a physical filename (enclosed in quotation marks) in place of the fileref.

CAUTION:
If you do not specify a filename, then the file from the previous FILE or INCLUDE command is used. In this case, a requestor window first asks if you are sure you want to overwrite the file.  [cautionend]

If you have not issued any FILE or INCLUDE commands, then an error message informs you that no default file exists. For a list of default file types used for the FILE command, see Default File Types.


Examples

Example 1: Copying Text from a Window to a File

Suppose you have previously specified the following FILENAME statement:

filename sasfile '[mydir]program1.sas';

Issuing the following FILE command on the PROGRAM EDITOR command line copies the text from the PROGRAM EDITOR window into the file PROGRAM1.SAS:

file sasfile

Example 2: Appending Text to an Existing External File

To append text to an existing external file, use the APPEND option in the FILE command. For example, you can issue the following command from the Program Editor window to append the contents to the file associated with the fileref MYFILE:

file myfile append

See Also


Chapter Contents

Previous

Next

Top of Page

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