/* this is the input data set */ data sasuser.example; input region $ 1-2 lake $ 5-13 pol_a1 pol_a2 pol_b1-pol_b4; cards; NE Carr 0.24 0.99 0.95 0.36 0.44 0.67 NE Duraleigh 0.34 0.01 0.48 0.58 0.12 0.56 NE Charlie 0.40 0.48 0.29 0.56 0.52 0.95 NE Farmer 0.60 0.65 0.25 0.20 0.30 0.64 NE Canyon 0.63 0.44 0.20 0.98 0.19 0.01 SE Morris 0.85 0.95 0.80 0.67 0.32 0.81 SE Golf 0.69 0.37 0.08 0.72 0.71 0.32 SE Falls 0.01 0.02 0.59 0.58 0.67 0.02 SE Pleasant 0.16 0.96 0.71 0.35 0.35 0.48 SE Juliette 0.82 0.35 0.09 0.03 0.59 0.90 SW Massey 1.01 0.77 0.45 0.32 0.55 0.66 SW Delta 0.84 1.05 0.90 0.09 0.64 0.03 SW Alumni 0.55 0.32 0.45 0.44 0.55 0.12 SW New Dam 0.80 0.70 0.31 0.98 1.00 0.22 SW Border 0.51 0.04 0.55 0.35 0.45 0.78 ; /* this is the PROC PMENU step that creates the pmenu */ proc pmenu cat=sasuser.pmenus; menu one; item 'Pmenu' menu=two; menu two; item 'End'; item 'Search' dialog=d1; item 'Where Clear'; dialog d1 '%%wbuild(%1,%2,@1,%3)'; text #1 @1 'Choose a region:'; radiobox default=1; rbutton #3 @5 'Northeast' substitute='NE'; rbutton #4 @5 'Southeast' substitute='SE'; rbutton #5 @5 'Southwest' substitute='SW'; text #7 @1 'Choose a contaminant:'; radiobox default=1; rbutton #9 @5 'Pollutant A' substitute='pol_a,2'; rbutton #10 @5 'Pollutant B' substitute='pol_b,4'; text #12 @1 'Enter Value for Search:'; text #12 @25 len=6; text #14 @1 'Choose a comparison criterion:'; radiobox default=1; rbutton #15 @5 'Greater Than or Equal To' substitute='GE'; rbutton #16 @5 'Less Than or Equal To' substitute='LE'; rbutton #17 @5 'Equal To' substitute='EQ'; quit; %macro wbuild(region,prefix,numvar,value,operator); %if &value ne %then %do; /* check to see if value is present */ where region="®ion" AND ( %do i=1 %to &numvar; &prefix.&i &operator &value /* If the values are character, */ /* enclose &value in double quotes. */ %if &i ne &numvar %then %do; /* if not on last variable, generate 'OR' */ OR %end; %end; ) %end; %mend wbuild;