Hello All,
In following code I am trying to resolve ZVAR(age)value directly from dataset just the way I am able
to do XVAR and YVAR by using them in dynamic statement.
Can someone help me to understand why ZVAR is not resolve from entry halign
proc template;
define statgraph regfit;
dynamic XVAR YVAR ZVAR;
mvar STUDY SYSDATE sex;
begingraph;
entrytitle "Scatter plot of " YVAR " = " XVAR;
entryfootnote halign=left STUDY halign=right SYSDATE;
layout overlay;
scatterplot X=XVAR Y=YVAR;
layout gridded / opaque=true backgroundcolor=CXECECEC border=false rows=4 columns=2 border=false autoalign=(topright topleft bottomright bottomleft);
/*- Line 1-2 -*/
entry halign=left "subject gender=zvar" ;
entry halign=left zvar;
endlayout;
endlayout;
endgraph;
end;
run;
%let study=CLASS dataset;
proc sgrender data=sashelp.class template=regfit;
dynamic xvar="height" yvar="weight" zvar="age";
where name='Alfred';
run;
Thank you.
It would help if show what you expect or want to appear in the Entry result in the graph.
Any text in quotes is going to be literal.
So when you use
entry halign=left "subject gender=zvar" ;
That is exactly what you get.
The combination of that line an the next:
entry halign=left "subject gender=zvar" ;
entry halign=left zvar;
uses the resolved value of ZVAR to create
"subject gender=zvar age"
because the resolved text of zvar is "age"
I can't really go much further as I have no clue what you are actually attempting to place into the entry.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.