%let rc = %sysfunc(dosubl(%nrbquote(
proc sql noprint;
select distinct cats(‘&streamDelim newline;<input type="checkbox" name="product" value="’,strip(product),’">’
,strip(product)
)
into:checkBoxes separated by ‘<br>’
from sashelp.shoes;
quit;
)));
&checkboxes
Use DOSUBL to execute SQL code to select the distinct products and create a macro variable containing the HTML markup text to create a check box for each product. Note the use of the NEWLINE facility (available starting with SAS 9.3 TS1M3) that forces a line feed, thus preventing a line feed inside a tag and also making the HTML more readable. The set of check box tags is generated by the macro variable reference, &checkboxes.