BookmarkSubscribeRSS Feed
Calcite | Level 5

Hi all,


I currently have a SAS Macro that runs based on the input of a certain date.


What I want is a simple HTML webpage where a button-click will send the content of a textbox with input (DD-MM-YYYY) and initiate the SAS Macro.


I already have the SAS Macro under control, however I do not have any experience in started the Macro from HTML and input the DATE to run the Macro.


I have searched far and wide for a simple solution to my simple problem. Is it simply impossible to do this in a simple way without being an expert in HTML/JAVASCRIPT ?


Best Regards



Btw. this is for a student project

Diamond | Level 26 RW9
Diamond | Level 26

It depends on a fair few things.  What is your setup?  SAS Web Report Studio does this kind of thing.  If your doing it yourself, then you would need some kind of server setup where in your web page you would have a button that generates the system call with your date parameter.  


The question is why your doing this, what is the purpose behind this?  Depending on the answer to that then you can proceed looking at solutions.  For instance, is this for someone who is not technical to run a report, if so then you need to check your licensing, your setup, access etc.  And look at software for that.  If its internal, then just put the date in a text file and read it in as part of your program.


Am afraid its not just as simple as a web page with a textbox, otherwise we'd all be doing it 🐵

Calcite | Level 5

I guess it is for external use (if, by internal you mean that only I should be able to use it), but I already made a login page leading to the page where I want the button.


The server setup where I would have a button on the web page with an input textbox. The buttton should generate the system call with the date parameter from the textbox.



Diamond | Level 26 RW9
Diamond | Level 26

Yes, see you hit a whole lot of issues there.  What do you mean a login page, is that tied to anything else.  Have you thought about data security, do you have the correct licensing to allow other people to be using SAS etc.  Not to mention the technical aspect of it, IT would need to admin this, provide a specific network are for results, logs and such like.  What type of outputs are coming back, are they in a displayable format in the web page, or will it be email etc.  I would really suggest that if this is something you want to follow, and have business need for you investigate with your IT group what is avaiable and was is required as there are plenty of web based reporting solutions out there and doing it yourself will be a big undertaking.

Calcite | Level 5

Maybe I asked my question in the wrong way. I simply want:


1) HTML page with submit button and date field

2) Javascript that activates "on click" and saves the input date

3) Javascript that activates a SAS Macro and inputs the date in the macro to run a certain scenario

4) Output as whatever in a folder on a shared drive


Do I run into the same problems?

Diamond | Level 26 RW9
Diamond | Level 26

Ah, you already have stored process, so that should make it easier.  Check out this paper:

Calcite | Level 5

I already have the HTML code with a button and a textfield with date entry and a javascript that takes the date as a variable.


What I wish for is a way to get the javascript to also start a SAS Script and insert the same date in the SAS Script. The SAS script should then run dependent on the date (for instance save whatever sold on date XXX to a seperate XML file)


I already have the SAS macro and the HTML page. I am just missing the javascript to control both :S



SAS is headed back to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team.

Interested in speaking? Content from our attendees is one of the reasons that makes SAS Innovate such a special event!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 2 in conversation