How do I chain stored processes together using only EG4.3?

524 views Asked by At

I'm creating an HTML based data dictionary using stored processes in EG4.3 running on 9.2 BI Suite on Unix.

We have had our middle tier web servers effectively turned off, so this STP can only be used inside EG itself.

Using a plethora of puts, I have created the HTML pages that I require in four stored processes:

  1. The main page, that takes as a prompt input, a wildcard for (for example) a column in question and returns in HTML a list of datasets where this column appears.

From this, the user can select a library, table or column to drill down into more details

  1. A stored process that returns in HTML a list of datasets in a selected library;
  2. A stored process that returns in HTML a list of columns in a selected table;
  3. A stored process that returns in HTML a more detailed listing of a columns attributes.

Sample of report

The first STP works great and I can see a nicely formatted listing of information, with library, dataset and column links.

My problem is as follows: When I click on a link, I would like that to run the requisite STP, and return the HTML page to the same Results tab that my initial report is in.

I've checked endless sas articles and can't find an answer.

Here is the code I'm using to generate a link to the other STP's (where chars[i] is an a-z value from a dataset):

/* Get the root session ID*/
hrefroot = symget('_THISSESSION') || '&_PROGRAM=/Shared Data/Team/stored_process/';

/* Get the next stp path (neither ?&_PROGRAM= nor the below seem to work)*/
hrefnextstp = "?_PROGRAM=/Shared Data/Team/stored_process/";

// build up the HTML using puts //
stpval="stpddlibrary";
stplink=cats('<A HREF="', hrefnextstp, stpval, '&amp;type=', chars[i], '">', chars[i],'</A>');
put stplink;

How, with the above in mind, can I chain together multiple stored processes using just EG?

There's no &_URL seen as though I'm not using the web, so that ruled that out.

I hope I've articulated that well..

1

There are 1 answers

0
Tim Cederquist On

The problem you are encountering is that the HTML page is trying to navigate to a web service to pull the next page. However, EG isn't able to function as a web server to respond the browsers request.

The stored process code is best used via the web mid-tier or the SAS MS Office plug-in. If those two tools are not available, you might consider moving the logic out of the SAS Stored Proc and into EG directly and use the response to drive a second flow in your eg project. If you are looking to drive a web page you can call sas via Java and the SAS IOM Bridge and talk to SAS the same way EG does but your UI in this case would be build in Java. Another suggestion, try using vbscript to drive EG via COM.

Here is a link to controlling EG via COM: http://www.sascommunity.org/wiki/Not_Just_for_Scheduling:_Doing_More_with_SAS_Enterprise_Guide_Automation

The code you provided would work well to build the url as serviced by the SAS Mid-Tier stored proc web service. Stored in a SAS Stored proc you can build the url to the mid-tier pointing at other stored procs using the SAS provided web interface for stored procs to see how the parameters and url is constructed.

If your mid-tier web service was online, you might also be able to call the stored procedure in your code. Calling it via proc http, here is an example from sas docs:

proc http in=in out=out url="http://localhost.com/rsm/rstool" method="post" ct="application/x-www-form-urlencoded"; run;