An Idea Exchange for SAS software and services

Comments
by Super User
on ‎06-02-2015 06:22 AM

Well, there are two separate things here.  Firstly if you want dynamic variables in your graphs, the use Graph Template Language.  In that you can define variables and change them each render.

Secondly, how are you doing you lab plots.  The reason I ask is that it seems you trying to do all lab parameters in one sgplot.  I would suggest you generate a loop of parameters, assign each one a min/max, and any other options you may need per parameter and then generate an sgplot statement for each parameter:

e.g.

proc sql;

     create table LOOP as

     select     distinct PARAMCD,

                    case     when PARAMCD="WBC" then 45    

                                   ... end as UPPER,

                    case     when PARAMCD="WBC" then 5

                                   ... end as LOWER

     from      LB;

quit;

data _null_;

     set loop;

     call execute('data tmp; set lb; where paramcd="'||strip(paramcd)||'"; run;

                             proc sgplot ....;  run;');

run;

In the above way you can change the axis, labels, formats, type of graph, icons etc.

by Super Contributor
on ‎02-01-2017 05:48 AM

Hi, sorry I'm only getting back to this now. The BY Group processing way seemed easier at the time, and it's also possible to have your own titles using this method too. Thank you for this method though, I do need to learn more about using call execute!

 

Kriss Harris

Idea Statuses
Top Liked Authors