Help using Base SAS procedures

Help with html drilldown links in proc report

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 104
Accepted Solution

Help with html drilldown links in proc report

I have a graph that drills down into tables, that then drill down into further tables. I can get the chart links to work, but cannot figure out how to link the 1st table info to the 2nd. I want to click on Building in table 1 and have that drill down into the appropriate building number in table 2.

Chart code:

/*  if (TSG="A1") then TSGG='HREF="TSGG1.htm"'; etc.*/

proc gchart data=chart;

hbar protocol/ sumvar=value group=TSG subgroup=step nozero sum sumlabel='Total Days' descending

maxis=axis1 raxis=axis2 gaxis=axis3 legend=legend1 html=TSGG html_legend=TSGG;

run; quit;

table 1 code:

%macro do_TSG(TSG);

    ods html file="&TSG..htm" path=odsout style=listing;

    title1 "Development Timeline Milestones for Building ";

  proc report data=report nowd split='/';

  where TSG="&TSG";

  columns  building TSG Group;

  define building/display "Building"

  define TSG/ display "TSG Group";

  ....

run;

%mend do_TSG;

%do_TSG (X1);

 

Table 2 code:

ODS HTML BODY='&Building..html' PATH=odsout;

%macro do_build(building);

   /* Open ODS HTML destination. Use the region name as the filename */

   ods html file="&building..htm" path=odsout style=listing;

  /* Set the axis label and title */

    title1 "Comments for Bulding &Building ";

  proc report data=comment nowd split='/';

  where Building="&Building";

  columns  building Date Comments;

  define building/ display "Building";

  define date/ display "Date";

  define Comments/ display "Comments";

run;

   /* Close the ODS HTML destination */

   ods html close;

%mend do_building;

%do_building (A11);


Accepted Solutions
Solution
‎05-14-2013 08:49 AM
SAS Super FREQ
Posts: 8,740

Re: Help with html drilldown links in proc report

Here's an example of a simple drilldown with PROC REPORT. Not "macroized", but it should help you figure out how to create drilldown links using PROC REPORT. This is just ONE way to make a drilldown link. You could use CALL DEFINE and the URL or URLBP arguments.

cynthia

** this technique is better if I do not care;

** what the drill down name is or if I am;

** letting it be generated automatically by ODS;

 

proc format;

  value $URLFMT 'Asia' = 'Reg1.html'

        'Canada' = 'Reg2.html'

  'Pacific' = 'Reg3.html';

run;

 

title; footnote;

ods html path='c:\temp' (url=none) file='Reg1.html'

    style=sasweb newfile=proc;

proc print data=sashelp.shoes(obs=15);

where region = 'Asia';

title 'Asia';

title2 link='main.html' 'Go Back to Report';

run;

 

proc print data=sashelp.shoes(obs=15);

where region = 'Canada';

title 'Canada';

title2 link='main.html' 'Go Back to Report';

run;

 

proc print data=sashelp.shoes(obs=15);

where region = 'Pacific';

title 'Pacific';

title2 link='main.html' 'Go Back to Report';

run;

ods html close;

  

ods html path='c:\temp' (url=none) file='main.html'

    style=sasweb;

proc report data=sashelp.shoes nowd;

title 'Report with URL in format';

title2 'File names are different from Region names';

where region in ('Asia', 'Canada', 'Pacific');

column region sales,(min mean max);

define region / group

       style(column)=Header{url=$URLFMT.};

define sales/ 'Sales';

run;

ods html close;

title; footnote;

View solution in original post


All Replies
Solution
‎05-14-2013 08:49 AM
SAS Super FREQ
Posts: 8,740

Re: Help with html drilldown links in proc report

Here's an example of a simple drilldown with PROC REPORT. Not "macroized", but it should help you figure out how to create drilldown links using PROC REPORT. This is just ONE way to make a drilldown link. You could use CALL DEFINE and the URL or URLBP arguments.

cynthia

** this technique is better if I do not care;

** what the drill down name is or if I am;

** letting it be generated automatically by ODS;

 

proc format;

  value $URLFMT 'Asia' = 'Reg1.html'

        'Canada' = 'Reg2.html'

  'Pacific' = 'Reg3.html';

run;

 

title; footnote;

ods html path='c:\temp' (url=none) file='Reg1.html'

    style=sasweb newfile=proc;

proc print data=sashelp.shoes(obs=15);

where region = 'Asia';

title 'Asia';

title2 link='main.html' 'Go Back to Report';

run;

 

proc print data=sashelp.shoes(obs=15);

where region = 'Canada';

title 'Canada';

title2 link='main.html' 'Go Back to Report';

run;

 

proc print data=sashelp.shoes(obs=15);

where region = 'Pacific';

title 'Pacific';

title2 link='main.html' 'Go Back to Report';

run;

ods html close;

  

ods html path='c:\temp' (url=none) file='main.html'

    style=sasweb;

proc report data=sashelp.shoes nowd;

title 'Report with URL in format';

title2 'File names are different from Region names';

where region in ('Asia', 'Canada', 'Pacific');

column region sales,(min mean max);

define region / group

       style(column)=Header{url=$URLFMT.};

define sales/ 'Sales';

run;

ods html close;

title; footnote;

Frequent Contributor
Posts: 104

Re: Help with html drilldown links in proc report

Thanks for the reply Cynthia. However, when I run it this way, I get an error for this line:

style(column)=Header{url=$URLFMT.};


ERROR 79-322: Expecting a (.

ERROR 76-322: Syntax error, statement will be ignored.

However, I'm not sure where to put the (. I've tried several iterations with no luck.

Thanks,

Sarah

Frequent Contributor
Posts: 104

Re: Help with html drilldown links in proc report

Hi Cynthia,

Please disregard my last comment. I was able to get this to work by appropriately using the formats. Thanks!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 323 views
  • 0 likes
  • 2 in conversation