BookmarkSubscribeRSS Feed
Dave25
Quartz | Level 8

I'm trying to create a table of contents, wiith amacro variable in one of the "nodes"  - have tried a LOTS of different things, but no success. Below is an example with stripped down code - i would like to have the "District" variable in the Table of Contents, but can get nothing but:

The SGPLOT Procedure...1

  SGPLOT-.........................1

The SGPLOT Procedur......2

  SGPLOT...........................2

 

Any sugggestions would be greatly appreaciated!

Dave

 


data a;
input id district $ value;
datalines;
1 A 1
2 B 1
3 C 1
;
ods pdf file = "C:\a\test.pdf" contents;
%macro x1;
%do k = 1 %to 3;
  data plot; set A (where = (id = &k));
    if _n_ = 1 then call symput("DST", strip(District));
	contents=&dst
 run;
title1 "&DST  -- Grade = &i";
proc sgplot;
scatter x=district y= value;
run;
%end;
%mend;

%x1;
ods pdf close;

 

 

3 REPLIES 3
DanH_sas
SAS Super FREQ

The DESCRIPTION option on the SGPLOT statement should give you the ability to customize the TOC entry.

Dave25
Quartz | Level 8

Thank you for the quick reply  - that was one of the many things i had tried, but couldn't get it to work - when i try adding it in (in the code, below) i get the same TOC (the "TEST" doesn't show up, just the "The SGPLOT Procedure" and "SGPLOT")

 

data a;
input id district $ value;
datalines;
1 A 1
2 B 1
3 C 1
;
ods pdf file = "C:\a\test.pdf" contents;
%macro x1;
%do k = 1 %to 3;
  data plot; set A (where = (id = &k));
    if _n_ = 1 then call symput("DST", strip(District));
 run;
title1 "&DST ";
proc sgplot DESCRIPTION= "TEST" ;
scatter x=district y= value;
run;
%end;
%mend;

%x1;
ods pdf close;

 

Springyboy
Fluorite | Level 6

Have you tried resetting your SAS Studio or SAS EG following these instructions?

 

You may also have an

options nolabel;

setting written somewhere in your code which may be causing an issue.

Hope this helps!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 3 replies
  • 748 views
  • 0 likes
  • 3 in conversation