Hello all,
I've been trying to get the following program working without much success. Essentially, I want to run a macro %do loop with a data step WHERE statement to produce a custom report. Here is the code (note the format fxx) :
option symbolgen mprint mlogic;
proc format;
value fxx 1 = 'Cold'
2 = 'Cool'
3 = 'Tepid'
4 = 'Warm'
5 = 'Hot';
option formdlim = ' ';
data one;
input x;
datalines;
1
2
2
3
5
;
%macro runit;
%do i = 1 %to 5;
proc print data = one;
where x = &i;
format x fxx.;
title "Data set ONE from Macro when index is put((&i),fxx.))";
run;
%end;
%mend runit;
%runit
What I want is each where case to procduce the title :
Data set ONE from Macro when index is tepid
Instead SAS either displays the actual character string 'put(3,fxx) 'or says it can't
find the put function.
I can get the macro to run if I use :
title 'Data set ONE with index &i - but then it displays just the number (e.g. 3), not the 'mapped' value (e.g. 'tepid').
I tried %sysfunc, %eval, and even writing a macro to translate the number on the title statement - without success.
Any ideas here ?
Barry Walton
Barry.Walton@millersville.edu
Any ideas here ?