The FILE command has a different use than the FILE statement; the FILE command
writes
the current contents of a window to an
external file rather than merely specifying (for example, a destination for PUT statement output
in a DATA step).
For example, if you
want to save the contents of the
LOG window to an external
filename C:\SASLOGS\TODAY.LOG, you can issue the following FILE command from the
Command dialog box.
However, the
LOG window must be active:
file "c:\saslogs\today.log"
If you use the FILE
command to attempt to write to an already existing file, a dialog
box enables you to replace the existing file, append the contents
of the window to the existing file, or cancel your request.
If you issue the FILE command with no arguments, the contents of the window are written
to the file that is referenced in the last FILE command. This action is useful if
you are editing a program and want to save it often. However, the dialog box that
prompts you about replacing or appending appears only the first time you issue the
FILE command. Thereafter, unless you specify the filename in the FILE command, it
uses the parameters that you specified earlier (replace or
append) without prompting you.
Choosing
Save
As from the SAS main window File menu displays the
Save
As
dialog box. This dialog box performs the same function as the FILE
command, but it is more flexible in that it gives you more choices
and is more interactive than the FILE command. For more information,
see “Saving Files” in
Saving Files
and
Using the Program Editor.