06-23-2015 11:17 AM
%macro eye (eye,dat, id);
data adae ;
The where condition(in red color) needs to be modified for each table.
Eg: where ethnicity="Hispanic"
your problem is that you want to pass a string with an equals sign in it
as a parameter.
change from special character (=) to mnemonic (eq)
%macro eye (eye=,dat=, id=,cond1=);
* ... where &cond1;
,cond1=ethnicity eq 'Hispanic');
06-23-2015 04:25 PM
Look at using the %quote(....) macro function to enclose your data-passed WHERE logic.
> suggested SAS.COM reference search argument: pass quotes macro invocation site:sas.com
06-23-2015 04:34 PM
Yes, I asked a similar question a few weeks ago and it seems to work fine. I didn't have to mask anything.
06-23-2015 06:45 PM
There is no need to change the parameter DEFINITIONS from positional to named, you can call position parameters by name.
You can also add () which should not impact the where clause.