Your SAS programs, embedded in web apps and elsewhere

drill down and tips in STP

Reply
Regular Contributor
Posts: 163

drill down and tips in STP

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
SAS Super FREQ
Posts: 8,866

Re: drill down and tips in STP

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
Regular Contributor
Posts: 163

Re: drill down and tips in STP

Posted in reply to Cynthia_sas
You rock Cynthia!
Thanks for the breakdown!.

jp
Ask a Question
Discussion stats
  • 2 replies
  • 221 views
  • 0 likes
  • 2 in conversation