Creates an informat for
reading and converting raw data values.
|To do this
||Use this option
|Specify the default length of the informat
|Specify a fuzz factor for matching values to a range
|Specify a maximum length for the informat
|Specify a minimum length for the informat
|Store values or ranges in the order that you define them
|Left-justify all input strings before they are compared to ranges
|Uppercase all input strings before they are compared to ranges
The following options are common to the INVALUE, PICTURE, and VALUE
statements and are described in Informat and Format Options :
- names the informat you are creating. The name must be a
SAS name up to seven characters long, not ending in a number. If you are
creating a character informat, use a dollar sign ($) as the first character,
with no more than six additional characters. A user-defined informat name
cannot be the same as an informat that is supplied by SAS. Refer to the informat
later by using the name followed by a period. However, do not put a period
after the informat name in the INVALUE statement.
||When SAS prints messages referring to a
user-written informat, the name is prefixed by an at sign (@). When the informat
is stored, the at sign is prefixed to the name you specify for the informat,
which is why you are limited to only seven characters in the name. You need
to use the at sign only when you are using the name in an EXCLUDE
or SELECT statement; do not prefix the name with an at sign when you are associating
the informat with a variable.
In addition, you can use the following options:
- left-justifies all input strings before they are compared
to the ranges.
- converts all raw data values to uppercase before they are
compared to the possible ranges. If you use UPCASE, make sure the values
or ranges you specify are in uppercase.
- specifies raw data and values that the raw data will become.
The value-range-set(s) can be one or more of the following:
The informat converts the raw data to the
values of informatted-value on the right side of the equal sign.
- is the value you want the raw data in value-or-range to become. Use one of the following forms for informatted-value:
- is a character string up to 200 characters long. Typically, character-string becomes the value of a character variable when you
use the informat to convert raw data. Use character-string
for informatted-value only when you are creating a character
informat. If you omit the single quotation marks around character-string, the INVALUE statement assumes the quotation marks are there.
For hex literals, you can use up to 199
typed characters, or up to 98
represented characters at 2 hex characters per represented character.
- is a number that becomes the informatted value. Typically, number becomes the value of a numeric variable when you use the informat
to convert raw data. Use number for informatted-value
when you are creating a numeric informat. The maximum for number
depends on the host operating environment.
- treats data values in the designated range as invalid data.
SAS assigns a missing value to the variable, prints the data line in the
SAS log, and issues a warning message.
- prevents the informat from converting the raw data as any
other value. For example, the following GROUP. informat converts values 01
through 20 and assigns the numbers 1 through 20 as the result. All other
values are assigned a missing value.
invalue group 01-20= _same_
- is an informat that is supplied by SAS or a user-defined
informat. The informat you are creating uses the existing informat to convert
the raw data that match value-or-range on the left side of the
equals sign. If you use an existing informat, enclose the informat name in
square brackets, for example, [date9.] or with parentheses and vertical bars,
for example, (|date9.|). Do not enclose the name of the existing informat
in single quotation marks.
- See Specifying Values or Ranges .
- The $GENDER. character informat converts the raw data values
invalue $gender 'F'='1'
The dollar sign prefix indicates that the informat converts character
- When you are creating numeric informats, you can specify character
strings or numbers for value-or-range. For example, the TRIAL.
informat converts any character string that sorts between
M to the number 1 and
any character string that sorts between
Z to the number 2. The informat treats the unquoted range
1-3000 as a numeric range, which includes all numeric values between
1 and 3000:
invalue trial 'A'-'M'=1
If you use a numeric informat to convert character strings that do not
correspond to any values or ranges, you receive an error message.
- The CHECK. informat uses _ERROR_ and _SAME_ to convert values
of 1 through 4 and 99. All other values are invalid:
invalue check 1-4=_same_
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.