Hi:
I agree with the comment that you are mixing data step concepts and macro concepts in a possibly inappropriate way.
The %PUT statement is intended to help you debug macro processing by writing macro variable values and/or text strings to the SAS log. It is really not intended to be used in the way you attempt in your program (conditionally). Consider these 2 LOG outputs from one program that uses %PUT and another that uses PUTLOG: (There is NO student named 'Zorro' in the sashelp.class file.):
[pre]
18961 *** 1) try %PUT;
18962 data _null_;
18963 set sashelp.class;
18964 if name = 'Alfred' then do;
18965 %put 'Alfred';
'Alfred'
18966 end;
18967 else if name = 'Zorro' then do;
18968 %put 'Zorro';
'Zorro'
18969 end;
18970 run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
18971
18972 *** 2) Use PUTLOG;
18973 data _null_;
18974 set sashelp.class;
18975 if name = 'Alfred' then do;
18976 putlog 'Alfred';
18977 end;
18978 else if name = 'Zorro' then do;
18979 putlog 'Zorro';
18980 end;
18981 run;
Alfred
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
[/pre]
Also, I generally find it unecessary to use quotes when setting macro variables (as in a %LET statement) because the inclusion of quotes for the macro variable value MIGHT work in your single instance, but then if you wanted to use &mm2 in a title statement, for example, then if you did this (and inadvertantly used double quotes):
%let mm2 = "01";
title "this is the report for the month &mm2";
you would get this in the log:
[pre]
18991 %let mm2 = "01";
SYMBOLGEN: Macro variable MM2 resolves to "01"
18992 title "this is the report for the month &mm2";
WARNING: The TITLE statement is ambiguous due to invalid options or unquoted text.
NOTE: Line generated by the macro variable "MM2".
1 "this is the report for the month "01"
-----------------------------------
49
NOTE 49-169: The meaning of an identifier after a quoted string may change in a future SAS release.
Inserting white space between a quoted string and the succeeding identifier is
recommended.
[/pre]
This code might work for you, depending on what the rest of your macro program is doing:
[pre]
%let mm2 = 01 ;
... ...
if "&mm2." in ('01','03','05','07','08','10','12') then do;
[/pre]
Here are some good papers that discuss macro basics and issues with quotes and how to use macro "quoting" functions:
http://www2.sas.com/proceedings/sugi29/243-29.pdf
http://www2.sas.com/proceedings/forum2007/152-2007.pdf
http://www2.sas.com/proceedings/sugi27/p067-27.pdf
http://ssc.utexas.edu/docs/sashelp/sugi/23/Coders/p81.pdf
cynthia