The INFORMAT statement
associates an informat with a variable. SAS uses the informat in any
subsequent INPUT statement to read values into the variable. For
example, in the following statements the INFORMAT statement associates
the DATE
w. informat with the
variables Birthdate and Interview:
informat Birthdate Interview date9.;
input @63 Birthdate Interview;
An informat that is
associated with an INFORMAT statement behaves like an informat that
you specify with a colon (:) format modifier in an INPUT statement.
For details about using
the colon (:) modifier, see INPUT Statement, List in SAS Statements: Reference. Therefore, SAS uses a modified list
input to read the variable so that
-
the
w value
in an informat does not determine column positions or input field
widths in an external file
-
the blanks that are embedded in
input data are treated as delimiters unless you change the DLM= or
DLMSTR= option in an INFILE statement
-
for character informats, the
w value
in an informat specifies the length of character variables
-
for numeric informats, the
w value
is ignored
-
for numeric informats, the
d value
in an informat behaves in the usual way for numeric informats.
If you have coded the
INPUT statement to use another style of input, such as formatted input
or column input, that style of input is not used when you use the
INFORMAT statement.
See INPUT Statement, List in SAS Statements: Reference for more information
about how to use modified list input to read data.
Note: Any time a text file originates
from anywhere other than the local encoding environment, it might
be necessary to specify the ENCODING= option in either ASCII or EBCDIC
environments. For example, when you read an EBCDIC text file on an
ASCII platform, it is recommended that you specify the ENCODING= option
in the FILENAME or INFILE statement. However, if you use the DSD and
the DLM= or DLMSTR= options in the FILENAME or INFILE statement, the
ENCODING= option is a requirement because these options require certain
characters in the session encoding (such as quotation marks, commas,
and blanks).The use of encoding-specific informats should be reserved
for use with true binary files. That is, they contain both character
and non-character fields.