There is probably a better way to do this..if you know of one please tell me. This way looks pretty clunky to me:

%GLOBAL BP_DESC_VAR BP;
/* MAKE LIST */
PROC SQL;
CREATE TABLE BPS (BP CHAR(100));
QUIT;
PROC SQL;
INSERT INTO BPS(BP) VALUES (‘stuff 1’);
QUIT;
PROC SQL;
INSERT INTO BPS(BP) VALUES (‘stuff 2’);
QUIT;
proc sql noprint;
select BP
into :bp SEPARATED BY ‘,’
FROM BPS;
quit;
%MACRO LOOP_BPS;
%LET BP_DESC_VAR=”;
%LET I=1;
%LET BP_DESC_VAR=%QSCAN(%SUPERQ(BP),&I.,’,’);
%PUT &BP_DESC_VAR;

%DO %UNTIL(&BP_DESC_VAR EQ %NRSTR());
%LET I=%EVAL(&I+1);
%LET BP_DESC_VAR=%QSCAN(%SUPERQ(BP),&I.,’,’);
%PUT &BP_DESC_VAR;
%END;
%MEND;
%LOOP_BPS;

Leave a Reply

Your email address will not be published. Required fields are marked *