BookmarkSubscribeRSS Feed
unnati
Obsidian | Level 7

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.

2 REPLIES 2
ballardw
Super User

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.

 

unnati
Obsidian | Level 7
I am trying to resolve value for age. For example subject age is 29 then i want that ZVAR to resolved into "29".

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1126 views
  • 0 likes
  • 2 in conversation