Previous Page | Next Page

SAS Options and Variables for VSAM Processing

Standard SAS INFILE Options

External data sets can be standard or nonstandard. VSAM data sets are nonstandard external data sets. The following SAS INFILE statement options can be used with any external data set, including VSAM data sets:

BLKSIZE=value

specifies the block size of the input data set.

COLUMN=variable

defines a variable that SAS sets to the column location of the pointer.

DELIMITER=delimiters

specifies a delimiter other than a blank for list input.

DSD

changes the way delimiters are treated when using list input. This option enables you to read delimiters as characters within quoted strings.

END=variable

defines a variable, whose name you supply, that SAS sets to 1 when the current record is the last in the input data set. Until SAS processes the last record, the value of the END= variable is 0. You cannot use the END= option with direct access.

EOF=label

specifies a statement label as the object of a GO TO when the INFILE statement reaches end-of-file. When an INPUT statement attempts to read from a data set that has no more records, SAS moves execution to the statement label indicated. The EOF= option is ignored with direct access.

EOV=variable

specifies a variable, whose name you supply, that SAS sets to 1 when the first record in a data set in a series of concatenated data sets is read. The variable is set only after SAS encounters the next data set.

EXPANDTABS|NOEXPANDTABS

specifies whether to expand tab characters to the standard tab setting.

FILENAME=variable

defines a variable, whose name you supply, that SAS sets to the value of the physical name of the currently open input data set.

FILEVAR=variable

defines a variable whose name you supply and whose change in value causes the INFILE statement to close the current input data set and open a new one. The physical pathname of a VSAM file is defined with a DLBL command.

FIRSTOBS=record-number

indicates you want to begin reading the input data set at the record number that is specified rather than beginning with the first record.

FLOWOVER

specifies the action to be taken if the INPUT statement reads past the end of the current record. When FLOWOVER is in effect, SAS reads a new record, and the INPUT statement continues reading data from column one to the first blank in the new record.

_INFILE_=variable

names a variable that SAS uses to reference the contents of the current input buffer of this INFILE statement. Like automatic variables, the _INFILE_= variable is not written to the data set.

LENGTH=variable

defines a variable, whose name you supply, that SAS sets to the length of the current line.

LINE=variable

defines a variable, whose name you supply, that SAS sets to the line location of the INPUT or PUT pointer. The LINE= option cannot be used with direct access.

LINESIZE=value
LS=value

limits the record length available to the INPUT statement when you do not want to read the entire record. The LINESIZE= value specifies the maximum record length that is available to the SAS program. If a LINESIZE= value is not specified, the default is the maximum record length that was specified when the VSAM data set was defined.

If LINESIZE= is shorter than the VSAM maximum record length, the record is truncated to the specified LINESIZE= value.

If an INPUT statement attempts to read past the column that is specified by LINESIZE=, the action that is taken depends on which of the FLOWOVER, MISSOVER, and STOPOVER options is in effect. (By default, the MISSOVER option is in effect when VSAM data sets are read.)

If a PUT statement attempts to write a record longer than the value that is specified by LINESIZE=, the action that is taken depends on which of the FLOWOVER, MISSOVER, and STOPOVER options is in effect. (By default, the STOPOVER option is in effect when VSAM data sets are written.)

LRECL=value

specifies the logical record length of the file. If you do not specify an option, SAS chooses a value based on the operating environment's file characteristics.

MISSOVER

prevents a SAS program from going to a new input line if it does not find values in the current line for all the INPUT statement variables. When an INPUT statement reaches the end of the current record, values that are expected but not found are set to missing.

N=available-lines

specifies the number of lines you want available to the input pointer. The N= option cannot be used with direct access because, by definition, direct access gets only one line at a time.

OBS=record-number

specifies the record number of the last record you want to read from an input file that is being read sequentially. Counting begins at the value that is set in the FIRSTOBS= option, if specified.

PAD|NOPAD

specifies whether records that are read from an external data set are padded with blanks up to the length specified in the LRECL= option.

PRINT|NOPRINT

specifies whether the input data set contains carriage-control characters.

RECFM=record-format

specifies the record format of the input data set.

SCANOVER

specifies that the INPUT statement scan the input records until the character string that is specified in the @'character string' expression (on the INPUT statement) is found.

SHAREBUFFERS

specifies that the FILE statement and the INFILE statement share the same buffer.

START=variable

defines a variable whose name you supply and whose value is used as the first column number of the record that the _INFILE_ argument of the PUT statement is to write.

STOPOVER

stops processing the DATA step when an INPUT statement reaches the end of the current record without finding values for all variables in the statement.

When the STOPOVER option is specified and an input line does not contain the expected number of values, SAS sets _ERROR_ to 1, stops building the data set as if a STOP statement had executed, and prints the incomplete data line.

TRUNCOVER

overrides the default action of the INPUT statement when an input record is not as long as expected by the INPUT statement.

UNBUFFERED

tells SAS not to perform a buffered read.

For more information on standard and nonstandard SAS options, see the INFILE Statement.

Previous Page | Next Page | Top of Page