I am attempting to create a macro that will iterate through the string values of a column.
Here is the data:
SUBJECT VISIT PARAMETER
001 Baseline param1
001 Visit 2 param1
001 Visit 3 param1
001 Baseline param2
001 Visit 2 param2
001 Visit 3 param2
002 Baseline param1
002 Visit 2 param1
002 Visit 3 param1
002 Baseline param2
002 Visit 2 param2
002 Visit 3 param2
Here is the macro I have as of now:
%macro want(numb, string);
DATA want&numb;
SET have;
IF parameter = &string;
RUN;
%mend want;
In its current form I have to input both the number and the string value in the PARAMETER column. I would like to modify the macro so that I can iterate through 30 parameters rather than the following:
%want(1, 'param1');
%want(2, 'param2');
...
%want(30, 'param30');
Any insight would be greatly appreciated.