BookmarkSubscribeRSS Feed
AMUMOR_SAS
Obsidian | Level 7

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;

 

2 REPLIES 2
Jatin_Jim
Obsidian | Level 7

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

AMUMOR_SAS
Obsidian | Level 7

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-2024.png

📢

ANNOUNCEMENT

The early bird rate has been extended! Register by March 18 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

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