Chapter Contents

Previous

Next
INFILE

INFILE



Specifies an external file to read with an INPUT statement

Valid: in a DATA step
OS/390 specifics: file-specification, type, host-options


Syntax
Standard Options for the INFILE Statement under OS/390
Host Options for Retrieving Information about Data Sets
VTOC Options for the INFILE Statement under OS/390
Host Options for UNIX System Services Files and Pipes
See Also

Syntax

INFILE file-specification <DATALINES | CARDS> <type> <options>;

file-specification
identifies a file:

fileref
specifies the assigned fileref or the allocated DDname of the file. A fileref must conform to the rules for DDnames. That is, it can consist of one to eight letters, numbers, or the national characters $, @, and #. The first character must be either a letter or a national character.

fileref(member)
specifies a member of a partitioned data set, where the PDS or PDSE is specified by the assigned fileref or allocated DDname.

The value of the FILEEXT= system option can affect the way SAS interprets PDS and PDSE member names. See FILEEXT= for details.

'physical-filename'
specifies a physical file, which can be a member of a partitioned data set (PDS), an extended partitioned data set (PDSE), or a UNIX System Services file, using the following syntax:

  • a fully qualified data set name. For example:
    'myid.raw.datax'

  • a fully qualified data set name with a member in parentheses. For example:
    'sas.raw.data(mem1)'

  • a partially qualified data set name with a period preceding. For example:
    '.raw.data'

  • a partially qualified data set name with a period preceding and a member name in parentheses. For example:
    '.raw.data(mem1)'

  • for PDS members, a fully or partially qualified data set name with a wildcard name in parentheses. For example:
    '.raw.data(mem*)'
    '.raw.data(*mem1)'
    '.raw.data(*)'

  • a UNIX System Services file:
    '/u/userid/raw'
    or
    'HFS:raw'

  • a temporary data set name. For example:
    '&mytemp'

The value of the FILEEXT= system option can affect the way SAS interprets file specifications for PDS and PDSE files. See FILEEXT= for details.

See Specifying Physical Files for more information about partially qualified data set names.

DATALINES | CARDS
specifies that input data immediately follows a DATALINES or CARDS statement in your SAS program.

type
specifies the type of file. When you omit type, the default is a standard external file. Nonstandard (host-specific) file types that you can specify for OS/390 are as follows:

DLI
for IMS-DL/I databases. For information about IMS-DL/I options for the FILE statement, see SAS/ACCESS Interface to IMS-DL/I Software.

HFS
for files in UNIX System Services, see Accessing UNIX System Services Files .

PIPE
for files in UNIX System Services, open a pipe to issue UNIX System Services commands from within the statement. See Piping Data from SAS to an UNIX System Services Command .

IDMS
specifies that the file is a CA-IDMS file. For information about CA-IDMS options for the INFILE statement, see SAS/ACCESS Interface to CA-IDMS Software: Reference.

ISAM
specifies that the file is an ISAM file. See Accessing ISAM Files.

VSAM
specifies that the file is a VSAM file. See Accessing Nonstandard Files.

VTOC
specifies that the Volume Table of Contents (VTOC) is to be accessed.

options
are either portable or host-specific. See SAS Language Reference: Dictionary for information on portable options.

You can specify portable options in any order, using a blank space as a separator.

The host-options that you can specify depend on which type of external file is being accessed. See the following sections for details:

When specifying more than one option, use a blank space to separate each option.


Standard Options for the INFILE Statement under OS/390

The following standard options can be used with all standard external files under OS/390.

BLKSIZE=value | BLK=value
specifies the block size of the file. Block size is discussed in more detail in DCB Attribute Options.

CCHHR=variable
specifies a character variable to which the physical address (cylinder head record) of a record is returned. This applies to files on CKD disks only.

CLOSE=keyword
indicates how a tape volume is to be positioned at the end of the DATA step. Values for keyword are
REREAD positions the tape at the logical beginning of the data set.
LEAVE positions the tape at the logical end of the data set.
REWIND rewinds the tape to the physical beginning of the volume.
FREE dynamically deallocates the tape volume.
DISP is implied by the control language.

CSRC
specifies that you want to use the CSRCESRV services that are available with OS/390 to decompress data on input. The following example illustrates the use of this option:
data;
   infile myfile csrc;
   input;
run;

DCB=fileref
gives the fileref of an external file that was referenced in an earlier FILE or INFILE statement in the same DATA step. SAS uses that file's RECFM=, LRECL=, and BLKSIZE= information for the current file.

LINESIZE=width
works with LRECL to specify the maximum number of characters per line or record in print files, nonprint files, and the SAS log. Under OS/390, the range of acceptable values of LINESIZE= is 64 to 256. The default value of the LINESIZE= system option under OS/390 is 132. This default applies only to print files (with carriage returns) or to the SAS log. For nonprint files (without carriage returns), the value of LRECL= is used in place of the default value for LINESIZE=.

LRECL=value
specifies the logical record length of the file. The value specified depends on the access method and the device type. For more information, see the discussion of LRECL= in DCB Option Descriptions and in OS/390 JCL Reference.

RECFM=record-format
specifies the record format of the file. Valid values are
F fixed length records, unblocked.
V variable length records, unblocked.
FB fixed length records, blocked.
VB variable length records, blocked.
U undefined length records, unblocked.

The following values can be appended to the RECFM= values:
A the first byte of each record is an ANSI printer control character.
M specifies that the file is a machine control character file. SAS does not interpret machine-code control characters nor does it create them in output files. See OS/390 JCL Reference by IBM for more information.
S the file contains spanned records (V), or the file contains standard blocks (F).

The following value stands alone; no other values can be appended:
N indicates that the file is in binary format. The file is treated as a byte stream; that is, line boundaries are not recognized. This record format is specific to the SAS System.


Host Options for Retrieving Information about Data Sets

For information on options that enable you to retrieve information about a data set from operating environment control blocks, see Host Options for Retrieving Information about Data Sets.


VTOC Options for the INFILE Statement under OS/390

The following options are used only in INFILE statements that involve VTOC (Volume Table of Contents) access:

CCHHR=variable
defines a SAS character variable of length 5 whose value is set to the CCHHR of the last VTOC record that was read by SAS. The returned value is in hexadecimal format; it can be printed by using the $HEX10. SAS format.

CVAF
tells SAS to use the Common VTOC Access Facility (CVAF) of the IBM program product Data Facility/Device Support (DF/DS) for indexed VTOCs. If the VTOC is not indexed, or if your installation does not have CVAF, this option is ignored.

Note:   When you use CVAF and CCHHR=, values that are returned for Format-5 DSCB records are not valid, because indexed VTOCs do not have Format-5 DSCB records.  [cautionend]


Host Options for UNIX System Services Files and Pipes

Several options can be specified in the INFILE statement for files and pipes that are in the Hierarchical File System of UNIX System Services. For information about these options, see Host-Specific Options for UNIX System Services Files .

See Also


Chapter Contents

Previous

Next

Top of Page

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