Applies a scheme and returns a transformed value and a transformation flag.
Valid in: | DATA step and SCL |
Requirements: | If specified, the locale must be loaded into memory as part of the locale list. |
Schemes using SAS format are required in the z/OS operating environment. |
specifies a character constant, variable, or expression that contains the value that is the input value to which the scheme is applied.
the character variable that receives the transformed input value.
the scheme that is applied to the input value. A SAS format scheme is a filename specification that includes a pathname and the SAS data set name enclosed in quotation marks.
Requirement | Lowercase letters. |
Note | In the z/OS operating environment, the normal naming conventions apply for the partitioned data set (PDS) that contains the scheme. |
identifies the format of the scheme. The valid formats are as follows:
the QKB scheme file format.
Default | BFD |
the SAS data format. See Schemes for more information.
specifies how the scheme is to be applied to the values of the input character variable. The default value of mode is the mode that is stored in the scheme. If a mode is not stored in the scheme, the default value of mode, is PHRASE.
compares the entire input character value to the entire length of each of the DATA values in the scheme. When the value of the scheme-lookup-method is USE_MATCHDEF, the match code values of the entire input value are compared to the match codes of DATA values in the scheme. A transformation occurs when a match is found between an element in the input value and a DATA value in the scheme.
compares each element in the input character value to each of the DATA values in the scheme. When the value of the scheme-lookup-method is USE_MATCHDEF, the match code of the entire input value is compared to the match codes of the scheme's DATA values. A transformation occurs when a match is found between an element in the input value and a DATA value in the scheme.
identifies the numeric variable that receives the returned number of transformations that were performed on the input value.
Interactions | If the value of mode is PHRASE and the input value is not transformed, then the value of the transform-count-variable is 0. |
If the input variable is transformed, the value of transform-count-variable is 1. | |
If the value of the mode is ELEMENT and the input value is not transformed, then the value of the transform-count-variable is 0. | |
The transformation count might appear to be inaccurate if the transformation value in the scheme is the same as the input value (or any element in the input value). |
specifies one of three mutually exclusive methods of applying the scheme. Valid values for scheme-lookup-method are as follows:
(default value) specifies that the input value is to be compared to the DATA values in the scheme without changing the input value in any way. The transformation value in the scheme is written into the output data set only when the input value exactly matches a DATA value in the scheme. Any adjacent blank spaces in the input value are replaced with single blank spaces before comparison.
specifies that capitalization is to be ignored when the input value is compared to the DATA values in the scheme. Any adjacent blank spaces in the input value are replaced with single blank spaces before comparison.
specifies that the match code of the input value is to be compared to the match code of the DATA values in the scheme. A transformation occurs when the two match codes are identical.
the name of the match definition. The definition must exist in the locale that is used to create match codes during the application of the scheme.
Interactions | If USE_MATCHDEF is specified and match-definition is not specified, the default match definition is stored in the scheme. |
The match-definition value is valid only when the value of the scheme-lookup-method is USE_MATCHDEF. | |
If USE_MATCHDEF is specified and a match-definition is not stored in the scheme, then a value is required for match-definition. |
specifies the amount of information in the match codes that are created during the application of the scheme. With higher sensitivity values, two values must be increasingly similar to create the same match code. At lower sensitivity values, two values receive the same match code despite their dissimilarities.
Default | 85 |
Range | 50 to 95 |
Interactions | Sensitivity is valid only when the value of the scheme-lookup-method is USE_MATCHDEF. |
If sensitivity is not in the scheme and USE_MATCHDEF is specified, the sensitivity value that is stored in the scheme is used. |
specifies a character constant, variable, or expression that contains the locale name.
Default | The default locale is the first locale in the locale list. If no value is specified, the default locale is used. |
Note | The locale is valid only when the value of the scheme-lookup-method is USE_MATCHDEF. |
/* Create the input data set. */ data suppliers; length company $ 50; input company $char50.; datalines; Ford Motor Company Walmart Inc. Federal Reserve Bank Walmart Ernest & Young TRW INC - Space Defense Wal-Mart Corp. The Jackson Data Corp. Ernest & Young Federal Reserve Bank 12th District Ernest and Young Jackson Data Corp. Farmers Insurance Group Kaiser Permantente Ernest and Young LLP TRW Space & Defense Ford Motor Jackson Data Corp Federal Reserve Bank Target ; run; /* Create the scheme. */ proc dqscheme data=suppliers nobfd; create matchdef='Organization (Scheme Build)' var=company scheme=work.myscheme locale='ENUSA'; run; /* Print the scheme. */ proc print data=work.myscheme; title 'Organization Scheme'; run; /* Apply the scheme and display the results. */ data suppliers; set suppliers; length outCompany $ 50; call dqSchemeApply(company, outCompany,'work.myscheme','nobfd', 'phrase', numTrans); put 'Before applying the scheme: ' company / 'After applying the scheme: ' outCompany / 'Transformation count: ' numTrans /; run;
Before applying the scheme: Jackson Data Corp After applying the scheme: Jackson Data Corp Transformation count: 1Instances such as these are not errors. In these cases the transformation value is the same as the input value.