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

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!

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
  • 594 views
  • 0 likes
  • 2 in conversation