I am trying to use a string that is saved in a metadata file in order to dynamically create headers for PROC REPORT. I use this code snippet to create a small data set with all of the words to be used as column headers. data defines;
length word $100;
drop string;
DO UNTIL(word="");
count+1;
word=scan("&xcols", count, ".");
output;
end;
run; Next I run this code to get the min and max number to iterate through for the headers. PROC SQL noprint;
SELECT min(count), max(count)
INTO :xmin, :xmax
FROM defines;
quit; Then this is where I am getting stuck. I need to know how to define the columns correctly as well as display the correct column header. For example the first column header would be the first observation in the defines data set, second header would be the second obs in the data set and so on. I have also included the dummy data set creation here. data dummy; length F1-F10 $100; run; proc report data=dummy nowd
COLUMNS F1-F10;
%DO r=&xmin %TO &xmax;
DEFINE VVALUEX("F"||&r) DISPLAY "TEST";
%END;
run; I am open to a more efficient solution to this problem as well. Any feedback helps! Thanks
... View more