I might try:
proc report data = rollmeds2 split='_';
columns value_set_item STudyPeriod: ;
define value_set/ group;
run;
If you haven't seen it before the Studyperiod: uses the colon indicate a list of variables whose names start with the text before the colon character.
Suggestion though, depending on how you created that data set. It is often quite easier to create such summaries from data that looks like
Valueset Date Value and use procedure options to create the summary values and the row/column headings.
For one thing your current data is somewhat susceptible to order changes because you have two entirely different types of values in a single variable. Another is that with an actual SAS date value if you want to combine different periods for a summary that can be done with similar code and just change a format.
... View more