I have one stored proces where Iet the user select boss and unit and then run a proc report.
On the proc report I have different links/URL in a data field where Iink to another Stored process. But how do I get the parameters transfered from the first stored process? and to be used in the URL???? I have tried to define it(marked with red) but it takes the text and not the macro value. Help ...
Thanks in advance.
***some code;
proc report data=ud1 ls=132 ps=58 nocenter missing nowd split=" "
style(report)=[just=right outputwidth=100% font_face=arial font_size=2 font_style=roman ]
style(column)=[just=left /*outputwidth=100%*/ font_face=arial font_size=2 font_style=roman BACKGROUND=WHITE]
style(summary)=[font_face=arial font_size=2 font_style=roman ]
style(header)=[foreground=#003366 font_face=arial font_size=2 font_style=roman ];
;
COLUMN unitname boss kpi KPI_beskrivelse resultat KPI_Kommentarer opdat;
define unitname/DISPLAY width=10 spacing=1 left "unitname" style(column)={just=left};
define boss/DISPLAY width=10 spacing=1 left "boss" style(column)={just=left};
define kpi/DISPLAY width=10 spacing=1 left "KPI" style(column)={just=left};
define KPI_bem/DISPLAY width=20 spacing=1 left "Bem" style(column)={just=left};
define result/DISPLAY width=20 spacing=1 left "result" style(column)={just=left};
define KPI_K/DISPLAY width=10 spacing=1 left "KPI K" style(column)={just=left};
define opdat/COMPUTED width=300 spacing=1 left "Opdatere" style(column)={just=left};
RBREAK BEFORE / SUMMARIZE SKIP OL UL ;
compute opdat/char length=300;
if kpi='YYYY'
then opdat=
'<A HREF="http://infbisas4wp.int.addom.dk/SASStoredProcess/do?_action=form,properties,execute,nobanner,newwind...&boss=boss&unit=unit">Opdatere</a>';
if kpi='XXXX'
then opdat=
'<A HREF="http://infbisas4wp.int.addom.dk/SASStoredProcess/do?_action=form,properties,execute,nobanner,newwind... statistik&boss=boss&unit=unit">Opdatere</a>';
endcomp;
run;
It should work. Check that the resulting string is not truncated which would explain why it doesn't appear as a link.
Increase the length if necessary.
Your code:
'<A HREF="http://infbisas4wp.int.addom.dk/SASStoredProcess/do?_action=form,properties,execute,nobanner,newwind...&boss=boss&unit=unit">Opdatere</a>';
is enclosed with single quotes, therefore macro variables are not resolved.
try next code:
"<A HREF=""http://infbisas4wp.int.addom.dk/SASStoredProcess/d
I have changed yhe single quotes to double and the inner quotes were doubled.
it says that there is an invalid value for
action: form,properties,execute,nobanner,newwindow/Data fra forretningen/Data til DWH/Enhedskontrakter/Enhedskontrakter_opdatere_STP1ny=/Data fra forretningen/Data til DWH/Enhedskontrakter/Enhedskontrakter_opdatereSTP2.
it moves in the right way. however the macro reference is still resolved in both the macro referencen &unit and its value. I need only the value to be resolved. Is there a hint?
it stills resolves both (reference and value)...
OK, I just tried on a small example and it behaves as you say.
Another option is to use url encoding and the urldecode function.
opdat=urldecode("<A HREF....%26boss=&boss.%26unit=&unit."">Opdatere</a>");
Your solution is close to be correct...the macro reference and value is correct but ..one little thing is that the url is not hidden into the text opdatere? is that possible?thanks in advance.
It should work. Check that the resulting string is not truncated which would explain why it doesn't appear as a link.
Increase the length if necessary.
it works....but i could be nice if the macro values could be trimmed? as there is extra space before the value....thanks for your input - it made the solutuon in the end.
%26boss=%trim(&boss.)
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.