BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sarahsasuser
Quartz | Level 8

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);

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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

3 REPLIES 3
Cynthia_sas
SAS Super FREQ

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;

sarahsasuser
Quartz | Level 8

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

sarahsasuser
Quartz | Level 8

Hi Cynthia,

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

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 897 views
  • 0 likes
  • 2 in conversation