proc sort data=ad1; by subjid; run; /* Count the number of unique values of SUBJECT. */ /* Also create macro variables containing the */ /* style values for each plot line. The line */ /* color is based on the treatment group. */ data _null_; set adqt1 end=eof; by subjid; if first.subjid then do; if grn=1 then color='firebrick'; else if grn=2 then color='biy'; else if grn=3 then color='big' ; else if grn=4 then color='bip'; count+1; call symput('gd'||trim(left(count)), 'style '|| 'GraphData' || trim(left(count)) || ' from GraphData' || trim(left(count)) || ' / ContrastColor=' || trim(left(color)) || ' linestyle=1;'); end; if eof then call symput('total',count); run; /* Define a macro that generates all style changes. */ %macro gdata; %do i=1 %to &total; &&gd&i %end; %mend gdata; /* Create the custom style. */ proc template; define style styles.mystyle2; parent=styles.default; %gdata; end; run; this is macro I am using for template.. Any suggestions ?
... View more