Previous Page | Next Page

Using External Files and Devices

Reading and Writing SAS Procedure Output Files under OpenVMS


Default Procedure Output File Format

FORTRAN is the default file format for SAS procedure output files. You can change the default for the entire session or for specific files by using the CC= system option. This option can be used in the FILENAME statement, in the FILENAME function, or as a system option.

Note:   The FILE command generates a nonprint file, whereas the PRINT command generates a print file.  [cautionend]

To specify the carriage-control format, use either the CC= external I/O statement option (see Host-Specific External I/O Statement Options in the FILENAME statement) or the CC= system option (see CC= System Option: OpenVMS). You can also use the FILECC system option to control how SAS treats the data in column 1 of a print file (see FILECC System Option: OpenVMS).

When you write to a print file with FORTRAN carriage control, SAS shifts all column specifications in the PUT statement one column to the right to accommodate the carriage-control characters in column 1.

A nonprint file that is written by SAS contains neither carriage-control characters nor titles. Whether you create a print or nonprint file, SAS provides default values for some characteristics of the file; these defaults are adequate in most cases. Default File Attributes for SAS Print and Nonprint Files lists the defaults for print and nonprint files.

Default File Attributes for SAS Print and Nonprint Files
Attribute Print File
(Batch)
Print File
(Interactive)
Nonprint File
Maximum record size 132 80 32,767
RECFM= V V V
CC= FORTRAN FORTRAN CR


Print Files Created by COM Files

When you run a SAS program from a COM file with the DCL command qualifier OUT= and also specify the SAS system option ALTLOG=SYS$OUTPUT, you must also use the CC= system option to correctly set the print-file format.

The default print-file format is FORTRAN. However, the DCL command qualifier OUT= creates a file containing variable-length and fixed-length control field (VFC) records. Unless you also specify either CC=FORTRAN or CC=CR in your SAS command, your output or listing will lack the first column of data.

The following is an example that generates the correct results:

These commands send the log to the SYS$OUTPUT destination, and a copy of the log (including the first column of data) is stored in the file OUT.LOG.

For more information about COM files, see Invoking SAS from a COM File, Command Procedures, and OpenVMS User's Manual.

Previous Page | Next Page | Top of Page