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
SAS Super FREQ
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 621 views
  • 0 likes
  • 2 in conversation