Hello,
I have this code which invokes a Stored Process and call parameters dynamically from Proc Report. However, when I use parameters the Stored Process is not found. Without Parameters the Stored Process is found, but it makes no sence without parameters. That leaves me to this question:
How do I pass parameters during an invoking of a Stored Process form inside a Proc Report?
Regards Morten Fredrik Amundsen
%STPBEGIN;
ODS escapechar='^';
Title1 "^{style [font_size=14pt] ^{style [font_weight=Bold] ^{style [color=green] Overordnet Vareleveranse}}}";
Proc report data=Sashelp.Grunnlag_Overordnet nowd
style (header)=[background=aliceblue];
/*style (header) = [background=aliceblue]
style (column) = [font_size=1.5];*/
define dato_dt /display;
define Varemottaker /display;
define id /display;
compute Varemottaker;
NewVar = Catx('_',dato_dt,varemottaker,id,"&Valg.");
/*urlstring='https://www.google.no/?q='!!strip(dato_dt,varemottaker,id);*/
/*urlstring='https://www.google.no/?q='!!strip(NewVar);*/
urlstring='https://fdpsas001test.landkreditt.local/SASStoredProcess/do?_program=%2FLandkreditt+
Bank+Informasjonsplattform%2FRapportering%2FAdministrasjon%2FStored+Process
%2FUnder+arbeid%2FVareleveranse_StP_Overordnet_Print_Kunde/?q='!!strip(NewVar);
call define ('varemottaker','URL',urlstring);
endcomp;
Run;
%STPEND;
Hi!!!
You will have to create a Prompt and configure it in to your code property and also have to call that macros in your sas code with & in where clause or any other where you required to be produce on coditional basis.
Exp:
create prompt :
Prompt Name :Gender,
Its value will be "Male" , "Female"
Now I will write code for stored process and use this prompt in the code to get the resolt on coditional basis.
Proc print data=ABC;
where gender="&gender";
run;
!!!Instad of proc print you can use proc report in your case !!!
Now on this store process proerty you will have to add this prompt(Gender) so as an when you will call this stored process it will prompt you for the Gender value and once you will enter it will process accordingly.
Let me know if you requred more information for the same.
Regards;
Jim
Hi,
Thanks for the reply. 🙂
I think I found the solution my self during the weekend, se the code below. But I still have'nt found a solution for creating a "new window".
My be you can tell me where to include Target='_blank'?
Proc report data=work.Grunnlag_Overordnet nowd
style (header)=[background=aliceblue];
/* style (header) = [background=aliceblue]
style (column) = [font_size=1.5];*/
define dato_dt /display;
define Varemottaker /display;
/* define id /display;*/
define Leveranseaar /display;
compute Varemottaker;
/*urlstring='https://www.google.no/?q='!!strip(dato_dt,varemottaker,id);*/
urlstring = 'http://fdpsas001test.landkreditt.local/SASStoredProcess/do?_action=form%2Cproperties%2Cexecute%2Cnobanner%2Cnewwindow&_program=%2FLandkreditt+Bank+Informasjonsplattform%2FRapportering%2FAdministrasjon%2FStored+Process%2FUnder+arbeid%2FVareleveranse_StP_Print_Kansv&Dato='!!strip(dato_dt)!!'+&Levaar='!!"&Aar_Ifj."!!'+&Mottaker='!!strip(varemottaker)!!'+&valg=HTML';
call define ('varemottaker','URL',urlstring);
endcomp;
Run;
Regards
Morten Fredrik
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.