/**** TIP000414 ****/

/***
What happens when you try to pass Macro special symbols such as 
% and & inside the values of macro variables when you want to 
treat them as normal alpha characters

When you deal with character data that can contain almost everything 
under the sun, you will probably encounter this someday down the line.
***/



45   data test;
46    Lookup_string = '100%ON';
47    call symput( 'Lookup', lookup_string);
48   run;
49

50   PROC SQL noprint;
51    Create table test as
52   Select *
53   From mylib.table_lookup
54    Where 0 < index( Master_String, "&Lookup" );

ERROR: Macro keyword ON is not yet implemented.

NOTE: Compressing data set WORK.TEST increased size by 100.00 percent.
      Compressed is 2 pages; un-compressed would require 1 pages.

NOTE: Table WORK.TEST created, with 1 rows and 6 columns.
55   Quit;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.07 seconds
      cpu time            0.07 seconds

 
The Fix for this problem is to use %SUPERQ
56
57
58   PROC SQL noprint;
59    Create table test as
60   Select *
61   From mylib.table_lookup
62    Where 0 < index( Master_String, "%superq(Lookup)" );
NOTE: Compressing data set WORK.TEST increased size by 100.00 percent.
      Compressed is 2 pages; un-compressed would require 1 pages.
NOTE: Table WORK.TEST created, with 1 rows and 6 columns.
63   Quit;

/*** end of tip 00414 ***/