Date: Thu, 21 Dec 2006 08:15:42 -0500
Reply-To: Eivind Heioghaa <x47x@CODANMARINE.NO>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Eivind Heioghaa <x47x@CODANMARINE.NO>
Subject: Re: Calling SAS Macro from HTML onClick() event
Thanks for great input!!!
I've finally got the issue resolved :-)
Instead of using the onClick() event, I'm checking the value of the button.
Here's the recipe I ended up with:
/*1. Define global parameters*/
%global runReportButton runrep;
/*2. Set up the button*/
data _null_;
file _webout;
put "<INPUT TYPE=""SUBMIT"" NAME=""runReportButton"" VALUE=""Run"" >";
run;
/*3. Check the value of the button and peform action based on the findings*/
%macro runReport;
data _null_;
if length(compress("&runreportButton")) = 1 then call symput('runrep',0);
else call symput('runrep',1);
run;
%if &runrep = 1 %then %do;
%wrapper; /*The user pressed the button. Run the macro!*/
%end;
%mend runReport;
%runReport;