Statements under UNIX |
Valid: | in a DATA step |
UNIX specifics: | valid values for encoding-value, file-specification, and host-options |
See: | INFILE Statement in SAS Language Reference: Dictionary |
Syntax | |
Details | |
See Also |
Syntax |
INFILE file-specification <ENCODING='encoding-value'> <options> <host-options>; |
can be any of the file specification forms that are discussed in the Accessing an External File or Device in UNIX Environments.
specifies the encoding to use when reading from the external file. The value for ENCODING= indicates that the external file has a different encoding from the current session encoding.
When you read data from an external file, SAS transcodes the data from the specified encoding to the session encoding.
For valid encoding values, see Encoding Values in SAS Language Elements in SAS National Language Support (NLS): Reference Guide.
are specific to UNIX environments. These options can be any of the following:
specifies the number of bytes that are physically read in one I/O operation. The default is 8K. The maximum is 1G-1.
controls the end of line or record delimiters in PC- and UNIX-formatted files. This option enables the sharing of UNIX- and PC-formatted files between the two hosts. The following are values for the TERMSTR= option:
Use TERMSTR=CRLF to read a file that was created on a PC. If the PC-formatted file was created using TERMSTR=LF, then the TERMSTR= option is unnecessary.
specifies the logical record length. Its meaning depends on the record format in effect (RECFM). The default is 256. The maximum length is 1G.
If RECFM=F, then the value for the LRECL= option determines the number of bytes to be read as one record.
If RECFM=N, then the value for the LRECL= option must be at least 256.
If RECFM=V, then the value for the LRECL= option determines the maximum record length. Records that are longer than the specified length are truncated.
specifies the record format. The following values are valid under UNIX:
Details |
The ENCODING= option is valid only when the INFILE statement includes a file specification that is not a reserved fileref. If the INFILE statement includes the ENCODING= argument and the reserved filerefs DATALINES or DATALINES4 as a file-specification, then SAS issues an error message. The ENCODING= value in the INFILE statement overrides the value of the ENCODING= system option.
See Also |
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.