Actually, there is a HUGE difference between:
temp_&yymm._seg&i as a macro variable reference (with the dot[.] ) and
temp_&yymm_seg&i without the dot [.] in the name.
Your code does NOT show the dot. I would suspect that you are getting messages something like this:
[pre]
WARNING: Apparent symbolic reference YYMM_SEG not resolved.
[/pre]
Or something similar if you do NOT have a single dot that shows the macro processor where one macro variable ends and the rest of the string begins. If you need to have a dot in a resolved macro variable name, such as you needed to build a dataset name from 2 macro variables, then you use 2 dots -- one dot for the delimiter and the second dot as part of the resolved value, like this:
[pre]
%let lib = perm;
%let myfile = cars;
proc print data=&lib.&myfile <---would be wrong
proc print data=&lib..&myfile <---would be correct
[/pre]
For more information about macro variable concatenation to build text strings from multiple macro variables, consult the macro documentation. In addition, this paper is a good introduction to macro processing concepts.
http://www2.sas.com/proceedings/sugi28/056-28.pdf
cynthia