01-04-2013 06:50 AM
Let's say we have a variable
%let Group = AA BB CC DD;
I would like to produce GROUP_1, GROUP_2 , GROUP_3, GROUP_4.
To start with :
I had a count with of all the words in Group with Countw and I got 4.
Now, next, I tried within a macro
%do i = 1 %to &num_count;
Group_&i. = %qscan(%bquote(&group), &i.,',');
call symput("Group_&i." Group_&i.);
Am I doing right?
01-04-2013 07:24 AM
please try the below code, as per your if we consider &num_count eq to 4 then
do i = 1 to &num_count;
proc sql noprint;
select group into :grp separated by ',' from test;