08-16-2013 12:21 PM
I am trying to create a prompt that will allow users to pick a variable to summarize on a map. Since the variables will all have different ranges of values, I created a univariate that will group values to summarize by when the project is run. The problem I am having is converting the macro variables I create from the univariate into strings for a proc format statement (the proc format will be used to set the legend values of the map). For example, if &Quant_20 resolves to say 5%, I would like to format the first value of the proc format to read "< 5%" and the next string will be the value between &Quant_20 and &Quant_40.
I think the solution is some kind of %symfunc statement using cats() to join the strings, but either I can't get the double quotes correct or I am going down the wrong path. Below is some sample code. Any help is greatly appreciated!
proc univariate data=calcVar noprint;
pctlpts=0 to 100 by 20
call symput ('Quant_20',PY_20);
call symput ('Quant_40',PY_40);
call symput ('Quant_60',PY_60);
call symput ('Quant_80',PY_80);
%put &Quant_20 &Quant_40 &Quant_60 &Quant_80;
08-16-2013 12:24 PM
Proc format can take a dataset as inputs, rather than mucking around with macro variables. Look up cntlin= datasets and how to format your dataset.