BookmarkSubscribeRSS Feed
Quentin
Super User

Hi,

I have a few questions about best practices for creating stored processes run in SPWA that will call other stored processses, passing prompt values through the URL.

I had thought a reasonable standard (based on a tip from Tricia Aanderud and Angela Hall's 50 Keys to Learning SAS Stored Processes) would be to make a macro variable like:

%let htmlroot=http://&_srvname:&_srvport/SASStoredProcess/do?%nrstr(&_program)=&_metafolder;

So once I had &htmlroot defined (at the top of my program), and I wanted to have a link to another stored process in the  same metafolder, I would just code something like:

&htmlroot.MyStoredProcess%nrstr(&myprompt)=myvalue

And all seemed to be going well, until I ran across an oddity that in PROC REPORT  compute blocks, quoted macro variables become unquoted.  (see separate thread https://communities.sas.com/message/155209#155209 )   So &_program resolves even though it shouldn't, and everything breaks.

So then a kind respondent on SAS-L suggested I run the URL through URLENCODE(), which converts & to %26. But SPWA didn't like that.

I realized the docs suggest sometimes it is helpful to pass a URL through HTMLENCODE(), which converts & to &    But of course then when the compute block unqoutes &amp, SAS tries to resolve &amp and throws a warning.

I have things working now, but my questions are:

1.) When you have drill-down stored processes like this, do you call them like this, passing the prompt name-value pairs through the URL?

2.) If yes, do you encode your URLs through HTMLENCODE() or similar?

3.) If no, is there a simple alternative?  (I do live in fear of that day that one of my URLs exceeds the length limits of Internet Explorer)

(I'm sure *real* web developers have lots of alternatives to passing values through a URL, but I'm just a simple SAS guy writing basic web reports that will be called through SPWA, delivering streaming results.  Not yet ready to dive deeply into web development, although maybe that's where I'm headed?)

Thanks,

--Q.


BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.

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
  • 0 replies
  • 786 views
  • 0 likes
  • 1 in conversation