Sample 26148: Using the RESOLVE function when a value contains an apostrophe
In order to use the RESOLVE function on a value that contains an apostrophe, one must use the QUOTE function to quote the value. To remove the quotes placed by the QUOTE function use the DEQUOTE function.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
%let dog=Golden Retriever;
data example;
input text $40.;
/* The RESOLVE function is used so that the ampersand within the */
/* value of text is treated as a macro variable. */
textResolved=dequote(resolve(quote(text)));
datalines;
John's &dog
My &dog is a female
That's Amy's &dog puppy
;
proc print;
run;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Obs text textResolved
1 John's &dog John's Golden Retriever
2 My &dog is a female My Golden Retriever is a female
3 That's Amy's &dog puppy That's Amy's Golden Retriever puppy
Illustrate the appropriate functions needed when passing an apostrophe to the RESOLVE function.
| Type: | Sample |
| Topic: | SAS Reference ==> Macro
|
| Date Modified: | 2007-04-28 03:02:51 |
| Date Created: | 2007-04-28 03:02:51 |
Operating System and Release Information
| SAS System | Base SAS | All | n/a | n/a |