Date: Mon, 18 Dec 2006 10:35:11 -0500
Reply-To: Don Henderson <donaldjhenderson@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Don Henderson <donaldjhenderson@HOTMAIL.COM>
Subject: Re: Calling SAS Macro from HTML onClick() event
In-Reply-To: <200612181048.kBI4WTqN021849@mailgw.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"
We need more information about exactly what you are trying to do.
Since you code references the reserved fileref _webout, you are probably
using either the SAS/IntrNet Application Dispatcher or perhaps the Stored
Process server. But we can't assume that from the limited information you
have provided.
It also seems that your macro call is being executed when you are generating
the HTML based on how you have quoted it. Is that what you mean by your
comment that the macro is run even if the onClick never occurred?
If you are using the Application Server or the Stored Process server, you
need to review the documentation on how they allow you to have your users
access SAS functionality from a browser. If so your generated HTML needs
more fields defined so your web server knows what process to execute and so
that process knows where your SAS server is running. Putting the name of the
macro you want your SAS server to run in an onClick event simply won't work.
HTH,
Don Henderson
Author of the upcoming SAS Press book "Building Web Applications with
SAS/IntrNet(c): A Guide to the Application Dispatcher"
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
> Eivind Heioghaa
> Sent: Monday, December 18, 2006 5:48 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Calling SAS Macro from HTML onClick() event
>
> I'm trying to kick off a SAS macro from an HTML onClick event. The problem
> is that SAS reads the code, and finds the macro command wrapped up in
> HTML,
> and runs the macro even if the onClick event never occurred.
>
> The code I'm running:
> data _null_;
> file _webout;
> put "<INPUT TYPE=""BUTTON"" NAME=""runReportButton"" VALUE=""Run
> Report""
> onClick=(""%wrapper;"");>";
> run;
>
> How can I hide the macro command "%wrapper;" so that it's not triggered
> until the user actually clicks the button?
> I've tried having the onClick event trigger a JavaScript function, and
> hide
> the macro call there, but with no luck ...
>
> Anyone having run into this sort of problem before?