My apologies Reeza and Ksharp; I thought that I had posted a thanks prior to going underwater.
So, first of all: THANK YOU both. Answering posts in such forums is a very generous and nice thing to do. I do it when I can and will definitely be posting in this forum from the answering side when my skills and confidence allow.
Ksharp: I like the use of arrays, they will go a long way solving some of my reporting needs.
What would the code below look like in order to handle vars that are named a1_1 to a1_7?
Also, I would look to it looping through a1, a2, a3 and a4.
(a1_1, a1_2, a1_3, a1_4, a1_5, a1_6, a1_7, a2_1, a2_2, a2_3, a2_4, a2_5, a2_6, a2_7)
data want(keep= date var_name value flag month);
set have;
array v{*} var:;
do i=1 to dim(v);
var_name=vname(v{i});
value=v{i};
month=put(date,monname3.);
if value ge 3 then flag='Y';
else flag='N';
output;
end;
run;
... View more