BookmarkSubscribeRSS Feed
jplarios
Quartz | Level 8
Hi:
I am trying to create a drill down and a tip to display with a stored process and proc gplot , in particular. The thing is, the drill down should output differently depending on the which bar selected.
I was using the samples but I got lost when it was using a macro.

Any examples? thanks,
jp
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
I'm not sure which sample you were trying to follow, but generally you follow these steps (shown without any macro variables):

1) decide whether your drilldown is going to static HTML files or dynamically running a program. So, you need to figure out here what the URL is going to be that you need, something like:
[pre]
--- !!! --- DO NOT CLICK ON THESE EXAMPLE URLs --- !!! ---
http://www.server.com/maindir/drilldir/AsiaReg.HTML OR
http://www.google.com OR
http://yourserver.com:8080/SASStoredProcess/do?_program=/MyRepos/mypgm
[/pre]

2) next, you make a copy of your data which will contain a NEW variable to hold the correct drilldown URL (using hardcoded web sites). This is generally a DATA step program where you create a variable to be used in your SAS/GRAPH program. Your assignment statement would look something like this:
[pre]
drill=cats('HREF=','"http://www.google.com"');
OR
if region = 'Asia' then do;
drill=cats('HREF=','"http://www.server.com/maindir/drilldir/AsiaReg.html"');
end;
[/pre]

Note that the variable shown above is DRILL, but it could have been named FRED or WOMBAT or MYHTML.

3) Now, you use the variable created in #2, in an HTML= option in your SAS/GRAPH procedure
[pre]
proc gwhatever data=mydata;
action statement /
HTML=DRILL or HTML=FRED or HTML=WOMBAT or HTML=MYHTML
;
run; quit;
[/pre]

4) You may or may not need to create the files that will be drilled down to. For example, if your drilldown was to Asia.HTML, you'd need to create that file. But, if you were going to a hardcoded web site or you were going to dynamically execute a program when they clicked, then you would not need step 4.

The key is using the HTML= syntax, which tells SAS/GRAPH which dataset variable contains the drill-down information. In the links below, you will find some non-Stored Process examples that do not use macro variables or macro programs.

http://support.sas.com/kb/25/246.html
http://support.sas.com/kb/23/642.html
http://support.sas.com/kb/25/247.html

The place where folks use macro variables and macro programs in this process is when they need to generate differing URLs or use differing formats or execute differing programs based on some criteria in the data.

For more help with your drill down program, you might wish to work with SAS Tech Support. When you are drilling down dynamically using Stored Processes, you may find that you need to use some reserved macro variables in your URL, such as &_PROGRAM or &_URL:
http://support.sas.com/documentation/cdl/en/stpug/61271/HTML/default/a003152603.htm

cynthia
jplarios
Quartz | Level 8
You rock Cynthia!
Thanks for the breakdown!.

jp

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 832 views
  • 0 likes
  • 2 in conversation