As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Adding anchors for the graphs which were generated by using proc gchart procedure with BY statement

From sasCommunity
Jump to: navigation, search
This is a work in progress. The suggestions made in this article have not been tested. If you can help improve this article, please contribute.

Sometimes, may you want to add a summary table of variable analysis at the top of a series graphs in html, and then link you to the related analysis graphs when you click the variable name in the summary table. Here is an example by using #byval options in the proc gchart to help you implement it.

First, you need add some html tag string in a variable of your summary table, looks like this

           data work.&SummaryTable;
               length anchor $256;
               set  work.&SummaryTable;
               by name;	
               if first.name then 
                  do;
                    anchor="<a href=""#"||ktrim(name)||""" style= ""text-decoration:none"">"||ktrim(name)||"</a>";
                  end;
                  else anchor = name;
               drop name;
               rename anchor = Name;
             run;

then, add the anchor in your graph title.

           title2 "<a name=""#byval(name)""> #byval(name) Variable Distribution Chart</a>";
             proc gchart data=work.var_dist;
               vbar bin /
               sumvar=count
               clipref
               frame	discrete
               space=&space
               type=sum
               coutline=black
               raxis=&raxis
               maxis=&maxis;
               by name ;
             run; 
             quit;

Done, That's all what you want.