BookmarkSubscribeRSS Feed
Jaime
Fluorite | Level 6
Hello all,
I am trying to use proc report to create a grid of counts. Each count is a link to another report for the corresponding grid elements.

Problem is the across variable is not passed in the hyperlink.
Below is what I am using.
proc report data=repo.No_Activity_018;
columns Inactive_Days_Bin person_id ,Plan N;
define Inactive_Days_Bin/ group 'Inactive Days Bin';
define Plan/across 'Plan';
define person_id/analysis N '';

compute person_id;
urlstring="do?_program=&stpname" || '&plan='||plan||'&bin='||Inactive_Days_Bin;
call define(_col_, 'URL', urlstring);
endcomp;
run;

Plan is the across variable.. But does not seem to be passed to the hyperlink.
1 REPLY 1
Cynthia_sas
Diamond | Level 26
Hi:
When PROC REPORT builds a report, it does not have visibility of the VALUES of the ACROSS variable (such as your values for PLAN). PROC REPORT is happiest building URLs when it can use ROW (GROUP or ORDER) values. You can, however, build hyperlinks, but you would have to do it conditionally...using absolute column names in a COMPUTE block:
[pre]
compute person_id;
urlstring3="do?_program=&stpname" || '&plan=Asia'||'&bin='||Inactive_Days_Bin;
call define('_c3_','URL',urlstring3);
urlstring4="do?_program=&stpname" || '&plan=Canada'||'&bin='||Inactive_Days_Bin;
call define('_c4_','URL',urlstring4);
endcomp;
[/pre]

This would work because you would know whether _c3_ absolute column was the Asia column or whether _c4_ was the Canada column.

cynthia

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 922 views
  • 0 likes
  • 2 in conversation