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".

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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