Related to the question I asked (and got a great answer to!) a couple weeks ago - I am now trying to create a table of contents with html5, with fomatted values for the by group.
From an example on the SAS site and a small macro, I'm able to get pretty close to what I want - but, two problems:
1) while the links appear in the table of contents, they don't take me to the graph;
2) I would like to get the formatted values, instead of 1, 2, etc. - tried what I have in my (limited) bag of tricks (for example, call symput, but can only get that to work in a datastep, and my macro is inside a proc step), with no luck.
- any suggestions would be appreciated!
*not used in my code, but would like it;
proc format; value dfmt
1 = "South"
2 = "North";
%do i = 1 %to 2;
p "<h2><a href=#myreport&i'>&i</a><h2>";
input District PCT_PROF PCT_FR_LUNCH;
Tips = 'PCT PROF: '|| strip(put(PCT_PROF, percent10.))|| ' / PCT FR Lunch: '|| strip(put( PCT_FR_LUNCH, percent10.));
1 .5 .4
1 .7 .5
1 .9 .6
2 .2 .4
2 .2 .5
2 .2 .6
ods graphics / reset;
ods html5 path="." (url=none) file="test1.html" options(bitmap_mode="inline")
proc odstext contents='';
ods graphics / imagemap=on height=7in width=9in imagefmt=png;
Title "PCT Prof X FR Lunch";
proc sgplot data=test;
Scatter y = PCT_PROF x = PCT_FR_LUNCH /markerattrs=(symbol=circlefilled color=blue size = 😎 tip=(tips);
ods html5 close;
Use %SYSFUNC and PUTN/PUTC instead.
proc format ; value dfmt 1="South" 2="North"; run; %macro mult; %do i=1 %to 2; %put p "<h2><a href=#myreport&i'>%sysfunc(putn(&i, dfmt))</a><h2>"; %end; %mend; %mult;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.