There are two kinds of parameters in SAS Macros: Positional parameters and named parameters. It is possible to mix them, although generally speaking a bad idea.
Named parameters are like your var2=t. They must be specified explicitly by name in the call. This is actually a 'best practice' much of the time; it ensures you have the right parameters defined (how easy is it to forget the order of the parameters in a macro?).
Named parameters can be used in any order, and can be left out (whether or not they have a default value). For example,
%macro myprint(var1=,var2=t);
...
%mend;
That would set a default for var2, but not for var1; it still must either be provided, or it will evaluate to a blank (which may be okay or may not be).
Positional parameters are exactly what they sound like: parameters defined by the location in the macro definition. They must be provided in order (of course) and if they are left out they default to blank. They cannot be provided a default value. Positional parameters must precede named parameters - ie, you could not have done
%macro myprint(var2=t,var1);
as that would confuse things too much.
So in your case, if you want to keep the 1 named 1 positional, just remove that extra ',' when you don't provide var2.
%myprint(var1=store,var2=t);I would also suggest adding a semicolon after your macro definition and removing your var2 declaration..%macro myprint(var1,var2);Also, if var2 is always 't' then why make it a parameter? - scottvar2is not supplied to the macro call (which is allowed). - Joe