Date: Wed, 2 Jul 2008 01:43:02 -0700
Reply-To: jshansen <selchauhansen@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: jshansen <selchauhansen@GMAIL.COM>
Organization: http://groups.google.com
Subject: Re: Data entry with STP
Content-Type: text/plain; charset=ISO-8859-1
On 1 Jul., 22:58, donaldjhender...@HOTMAIL.COM (Don Henderson) wrote:
> Xavier,
>
> Not sure I agree with your summary. Stored Processes can produce any type of
> output - and you are correct that the type of content to be generated
> depends on the client. That is the reason that SAS provides the STPBEGIN and
> STPEND macros for use in your Stored Processes. Those macro's generate the
> "appropriate" content based on the client (e.g., for Enterprise Guide, Work,
> Excel, a browser, etc.). By using these macros the Stored Process developer
> need not worry about what the client is for Stored Processes than can be
> invoked from multiple client types.
>
> In Jan's case we know he is generating HTML and that the client is the
> browser. Further the other clients don't have a analog to the concept of
> generating forms/links that can be clicked on to make a round trip to the
> browser. His code is creating all of the HTML, including the HEAD section.
> By using the STPBEGIN macro, ODS is generating the HEAD section which
> appears to be over-riding what he has put in his HEAD section.
>
> Hope this clarifies what I was trying to say.
>
> -donh
>
>
>
> > -----Original Message-----
> > From: SAS(r) Discussion [mailto:SA...@LISTSERV.UGA.EDU] On
> > Behalf Of xav
> > Sent: Tuesday, July 01, 2008 9:18 AM
> > To: SA...@LISTSERV.UGA.EDU
> > Subject: Re: Data entry with STP
>
> > You should read that documentation :
> >http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/inet
> > 2stp.html
> > (orhttp://tinyurl.com/69do59)
>
> > Stored Process are not providing HTML, it provides XML (Tagset
> > SASREPORT11 for example)
>
> > The reason is that the client controls the behaviour of the
> > Stored Process :
>
> > For a same STP inside Word it's RTF, inside Excel it can be
> > CSV or formatted etc..
>
> > Xavier
>
> > > Jan,
>
> > > Actually I am surprised this is working at all. The stpbegin/end
> > > macros typically cause a data step that writes to _webout
> > to fail with
> > > a "file contention" issue.
>
> > > Regardless, if you are generating all the HTML, including the HEAD
> > > section in your data step, remove the stpbegin/end macro calls. The
> > > extra HTML you are seeing is being produced by ODS because
> > of those macros.
>
> > > HTH,
> > > -donh
>
> > > > -----Original Message-----
> > > > From: SAS(r) Discussion [mailto:SA...@LISTSERV.UGA.EDU]
> > On Behalf Of
> > > > jshansen
> > > > Sent: Tuesday, July 01, 2008 3:37 AM
> > > > To: SA...@LISTSERV.UGA.EDU
> > > > Subject: Re: Data entry with STP
>
> > > > On 30 Jun., 18:00, donaldjhender...@HOTMAIL.COM (Don
> > Henderson) wrote:
> > > > > Jan,
>
> > > > > I typically use the URL portlet to add STPs to the portal
> > > > and have not
> > > > > seen this issue.
>
> > > > > Can you clarify how you are called your STPs? That might be the
> > > > > reason. I think some of the portlets may strip off the
> > head section.
>
> > > > > Regards,
> > > > > donh
>
> > > > > > -----Original Message-----
> > > > > > From: SAS(r) Discussion [mailto:SA...@LISTSERV.UGA.EDU]
> > > > On Behalf Of
> > > > > > jshansen
> > > > > > Sent: Monday, June 30, 2008 5:06 AM
> > > > > > To: SA...@LISTSERV.UGA.EDU
> > > > > > Subject: Data entry with STP
>
> > > > > > I have for years been creating data-entry systems using
> > > > SAS IntrNet,
> > > > > > and HTML-tags like <TEXTAREA> <INPUT> a.o.
> > > > > > No problems :-)
>
> > > > > > I also works with BI & STP's, BUT ....
>
> > > > > > I can not control the "start html-tags" like <body lang=DA
> > > > > > bgcolor="#E8EEB9">
>
> > > > > > I makes my IE, not passing our national danish
> > characters to SAS.
>
> > > > > > Is there a way in BI-portal to have total control over
> > > > the HTML sent
> > > > > > to _webout with a STP ?
>
> > > > > > Jan Selchau-Hansen- Skjul tekst i anførselstegn -
>
> > > > > - Vis tekst i anførselstegn -
>
> > > > Don,
>
> > > > The STP is called from another STP.
> > > > The calling STP is generating HTML with Proc Report and a "define
> > > > url". Like this:
>
> > > > if origin_system='SAS' then do;
> > > > pgm='?_program=/BIP%20Tree/Fonds/STP/failed_late_sas&id=' !!
> > > > trim(left(put(id,7.)));
> > > > call define(_col_,'URL',pgm);
> > > > end;
>
> > > > The URL looks like this:
> > > >http://atp-13pdmdapp03:9080/SASStoredProcess/do?_program=/BIP%
> > > > 20Tree/Fonds/STP/failed_late_sas&id=131389
>
> > > > The STP is defined in the Management Console with
> > "Streaming Output".
>
> > > > My STP looks like this:
> > > > *ProcessBody;
> > > > %stpbegin;
> > > > ods html close;
> > > > data _null_;
> > > > set failed;
> > > > file _webout;
> > > > put '<html><head>'
> > > > / '</head>'
> > > > / '<body lang=DA bgcolor="#E8EEB9">'
> > > > / '<table border="0" width="100%"><tr><td align="left">'
> > > > / '<FORM ACTION="/SASStoredProcess/do" method="post"
> > name="f1">'
> > > > / '<TABLE BORDER="0" CELLPADDING="0"><TR><td class="l
> > Data">Ret
> > > > evt. </td></tr>'
> > > > / '<INPUT TYPE="HIDDEN" NAME="_PROGRAM" VALUE="/BIP
> > > > Tree/Fonds/STP/ failed_late_reason_save">'
> > > > / '<INPUT TYPE="HIDDEN" NAME="reasonid" VALUE="'
> > "&reasonid" '">'
> > > > / '<tr><td><INPUT TYPE="submit" VALUE="Gem !"></td></tr>'
> > > > / '<td><TEXTAREA name="reason" rows="10" cols="50">' reason '</
> > > > TEXTAREA></td></tr>'
> > > > / ' </table></body></html>';
> > > > %stpend;
>
> > > > But the HTML generated to _webout looks like this:
> > > > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> > > > <html> <head> <meta name="Generator"
> > > > content="SAS Software, seewww.sas.com"
> > > > sasversion="9.1">
> > > > <meta http-equiv="Content-type" content="text/html"> <title>SAS
> > > > Output</title> <style type="text/css">
> > > > <!--
> > > > .ContentTitle
> > > > {
> > > > font-family: Arial, Helvetica, sans-serif;
> > > > font-size: small;
> > > > font-weight: normal;
> > > > font-style: italic;
> > > > color: #002288;
> > > > .....
> > > > +2000 lines of generated HTML-code.
> > > > + My 10 lines at the buttom.
>
> > > > Jan Selchau-Hansen- Skjul tekst i anførselstegn -
>
> - Vis tekst i anførselstegn -
Don,
Without using %STPBEGIN & %STPEND I get NO output at all.
With using these macro's I get my output, but with NO chance to
control my HEAD-section. And all the other "JUNK" that %STPBEGIN
generates ...
I have stripped down my STP, to this.
*ProcessBody;
* %stpbegin;
data _null_;
reason='This is a test';
file _webout;
put '<html><head></head>'
/ '<body lang=DA bgcolor="#E8EEB9">'
/ '<table border="0" width="100%"><tr><td align="left">'
/ '<FORM ACTION="/SASStoredProcess/do" method="post" name="f1">'
/ '<TABLE BORDER="0" CELLPADDING="0"><TR><td class="l Data">Ret
evt. </td></tr>'
/ '<INPUT TYPE="HIDDEN" NAME="_PROGRAM" VALUE="/BIP Tree/Fonds/STP/
failed_late_test">'
/ '<tr><td><INPUT TYPE="submit" VALUE="Gem !"></td></tr>'
/ '<td><TEXTAREA name="reason" rows="10" cols="50">' reason '</
TEXTAREA></td></tr>'
/ '</table></body></html>';
*%stpend;
Jan Selchau-Hansen
|