Date: Mon, 18 Oct 2004 10:55:50 -0400
Reply-To: John Kramer <kramer@JIMMY.HARVARD.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: John Kramer <kramer@JIMMY.HARVARD.EDU>
Subject: Re: CGI- vs. JSP-solutions
On Sun, 17 Oct 2004 14:51:09 -0700, Jesper Sahner <jespersahner@HOTMAIL.COM>
>I have a basic question concerning CGI- vs. JSP-solutions with
>My picture is the following:
>When using CGI, a SAS-program is run on the server, and this
>SAS-program can be any program. If you are a skilled SAS-programmer
>this is good solution because all the complex programming is held
>within SAS. Furthermore SAS/ODS helps you with all the
>"HTML-trickery", but if needed you can build the HTML from scratch
>yourself in the SAS-program by writing to _webout. Unfortunately CGI
>is a rather slow technology.
>When using JSP (I am new to JSP!) you are making queries against
>SAS-data, but any kind of complex programming must be done in
>JSP/Java, which is not a good solution, if you are not familiar with
>JSP/Java. On the other hand JSP is a quick way of obtaining the
>results, so if your only purpose is queries against SAS-data without
>any complex programmming "on top", this solution is preferable.
>If this is the right picture, then my question is:
>Can the flexibility that the CGI-solution offers (meaning that ANY
>SAS-program can be executed) be used in the JSP-solution in the sense,
>that a SAS-program (not just a query) can be run "inside JSP" with a
>relatively quick response-time (quicker than a pure CGI-solution)?
In my opinion, JSPs/Java Servlets are better suited for generating web pages
than SAS is, unless all you want is to print out the results of SAS procs
(or data steps) using ODS, without any extra HTML. When you start having to
use put statements in you data steps to write out HTML tags to _webout, the
code can get a little bit messy in my opinion.
A hybrid JSP/Servlet/CGI(SAS/Intrnet) solution is certainly feasible. You
can create Java classes which connect to the SAS/Intrnet broker and return
the results of the SAS program which could be displayed in your JSP page.
One way to do this is with the URLConnection class.
As far as speed goes, I would think this would not be as fast as a pure Java
solution because you still have the overhead of the CGI SAS/Intrnet broker.
This may or may not be faster than a pure CGI solution (by which I am
assuming you mean a pure SAS solution), depending on the execution speed of
the SAS vs. Java.