09-26-2013 08:29 AM
I am a little out of practice, I'd like to macro the following code so it will go through each unique 'pcpid' seperatley (from 1 %to end?) and put the pcpid on the graph as a label. I'm thinking a simple macro loop with symputx to macro the variable through the loop but I don't know how to do it. Any help will be appreciated:
title "PCPID = &pcpid";
proc gplot data=test;
symbol i=join v=circle h=2;
09-26-2013 10:21 AM
There are a number of writeups for how to do something like that. You might start with this one.
Personally for really simple problems I normally create a single macro variable with a space delimited list of values using PROC SQL and remember the number of values by saving the value of the automatic macro variable SQLOBS.
proc sql noprint;
select name into :names separated by ' '
%do i=1 %to &n ;
%let name=%scan(&names,&i,%str( ));
.... &name ....
Need further help from the community? Please ask a new question.