Chapter Contents

Previous

Next
SAS Companion for the CMS Environment

Specifying the Physical Attributes of a File

You can specify values for file characteristics in the options argument in the FILE, FILENAME, and INFILE statements. Note that you do not need to specify file characteristics when you are concatenating files, since the existing characteristics of the files are used.

The following section explains which values are used if you specify file characteristics for the same file in multiple places.


Order of Precedence for Input

If you use a fileref to reference a file for input, any values that you specify for file characteristics in the INFILE statement take precedence over any that you have specified in a FILENAME statement or in a CMS FILEDEF command. Any values that you specify for file characteristics in a FILENAME statement or CMS FILEDEF command take precedence over the file characteristics of the existing file. If you do not specify any values for file characteristics, then the values for the existing file are used.


Order of Precedence for Output

If you use a fileref to reference a file for output, any values that you specify for file characteristics in the FILE statement take precedence over any that you have specified in a FILENAME statement or in a CMS FILEDEF command. If you do not specify any values for file characteristics when you are appending to an existing file, the values for the existing file are used. If you do not specify any values for file characteristics when you are writing to a new file, the defaults are used. Default file characteristics are shown in FILENAME.


Options

The following file characteristics can be specified in the options argument in a FILE, FILENAME, or INFILE statement. All options use a keyword=value format, and multiple options are separated by blank spaces. For the FILE statement, note that options cannot be specified if you use FILE LOG, FILE PRINT, or FILE PIPE. For the FILENAME statement, note that if file characteristics are given in a statement that specifies several files to be concatenated, then all files must have the same attributes.

BLKSIZE=value
specifies the buffer size that is allocated to contain records. Valid values are 1 through 65535.

Records do not have to be blocked. However, because disk or tape activity is reduced when records are blocked, it is more efficient to use blocks. Blocking records is different when you use CMS Native I/O Services than it is when you use OS/390 Simulation Services.

For CMS Native I/O Services, the following apply:

For OS/390 Simulated I/O Services, the following apply:

DENSITY=value
specifies tape density in bits per inch. Valid values include 200, 556, 800, 1600, 6250, and 38K.

DISP=value
specifies the status (disposition) of the file. Acceptable values are
MOD specifies that output lines are to be written after any existing lines in the file.
OLD specifies that any output lines are to be written at the beginning of the file. This is the default. For CMS, this option is identical to the NEW option.
NEW specifies that any output lines are to be written at the beginning of the file. For CMS, this option is identical to the OLD option.

FILEVAR=variable
enables you to dynamically change input and output files in the middle of a DATA step.

LABEL=value
indicates the type of label processing for a tape file. LABOFF is the default. Valid values are

If SL, NL, or BLP is specified, then an additional label value n can be specified after the SL, NL, or BLP. The value of n indicates the file position in a multifile volume. The default value is 1.

LEAVE=YES
indicates that a multifile tape is not repositioned at open for LABOFF or BLP processing. For SL tapes, LEAVE=YES does not reposition before label processing. Omitting LEAVE or specifying LEAVE=NO causes a tape to be rewound and repositioned each time a file is opened. (See Working with SAS Files on Tape for details on tape processing.)

LRECL=value
specifies the logical record length in bytes. Valid values are 1 through 65,535.

RECFM=format
specifies the format of records in the file.

You can choose one of the following record formats:
F specifies fixed-length records, unblocked.
FB specifies fixed-length records, blocked.
V specifies variable-length records, unblocked.
VB specifies variable-length records, blocked.
U specifies undefined record format. For CMS disk files, this is the same as V.

You can use the following values in any of the previously listed formats except U.
A specifies that the first byte of each record is an ANSI printer control character and that the file is to be handled as a print file.
S specifies that the file contains spanned records (V), or that the file contains standard blocks (F). FS, FBS, VS, and VBS files must be assigned with a CMS FILEDEF command.

SYSPARM=value
passes an option string to a tape management system for standard label tapes. If you type a question mark (?) SAS prompts you for option settings.

TRACK=value
specifies the tape setting. Valid values are

VOLID=value
specifies the volume serial number to be verified in the tape. If the value contains any special characters, it must be enclosed in single quotes.

See the FILEDEF command entry in VM/ESA CMS Command Reference for more information about these options.

SAS does not interfere with FILEDEF options that are already specified. Therefore, TAPE options that are specified in the FILE, FILENAME, or INFILE statements that conflict with an existing FILEDEF to TAPE are ignored. See Working with SAS Files on Tape for more information.

If a variable-length file is opened for update (possibly in the DATA step) and if the replacement line is not the same length as the existing line, then the standard CMS file system action truncates the file at that point. No message is given. The next READ to that file returns an EOF message.


Chapter Contents

Previous

Next

Top of Page

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