After you create a scheme data set, apply it to an input variable to transform its
values. You can apply a
scheme with the APPLY statement in the DQSCHEME procedure, as described in
APPLY Statement. You can also use the DQSCHEMEAPPLY function or CALL routine.
Use the DQSCHEMEAPPLY CALL routine if you want to return the number
of transformations that occurred during the application of the scheme.
See
DQSCHEMEAPPLY CALL Routine for additional information.
The scheme data set consists of the DATA and STANDARD variables. The DATA variable
contains
the input character values that were used to create the scheme. The STANDARD variable
contains the
transformation values. All of the DATA values in a given cluster have the same STANDARD value. The
STANDARD values are the values that were the most
common values in each cluster when the scheme was created.
When you apply a scheme to a SAS DATA set, an input value is transformed when it
matches a DATA value in
the scheme. The transformation replaces the input value with the
transformation value.
The lookup method determines how the input value is matched to the DATA values in
the scheme. The SCHEME_LOOKUP option or argument specifies that the
match must be exact, although case is insensitive. Alternatively, the match can consist
of a match between the match codes of the input value and the match codes of the DATA
values. When a match occurs, any adjacent blank spaces in the transformation value
are replaced with single blank spaces. Then the value is written into the output
data set.
If no match is found for an input value, that exact value is written into the output
data set.
Specify the MODE argument or the MODE= option to apply schemes in one of two modes:
PHRASE or ELEMENT. Applying a scheme by phrase compares the entire input value (or
the
match code of the entire value) to the values (or match codes) in the scheme. Phrase is the
default scheme apply mode.
When you apply a scheme by element, each element in the input value (or match code
of each element) is compared to the values (or match codes) in the scheme. Applying
schemes by element enables you to change one or more
elements in an input value, without changing any of the other elements in that value.
The file format of a scheme is important when that scheme is applied. In the z/OS operating
environment, schemes must be created and applied in SAS format. Schemes
that are stored in a PDS in QKB scheme file format
can be applied. Schemes in QKB scheme file format
can be converted to SAS format using the CONVERT statement in the
DQSCHEME procedure.
Note: Schemes in QKB scheme file format cannot be created
or displayed in the z/OS operating environment.