Your SAS programs, embedded in web apps and elsewhere

SPWA chaining stored processes

Posts: 1,396

SPWA chaining stored processes


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:


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 )   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?)



Ask a Question
Discussion stats
  • 0 replies
  • 1 in conversation