Hi all,
Last week I attended the SAS UK forum and was blown away by the possibilities of stored processes (amongst other things).
It has got me thinking about being a possible solution to a business need we have to allow editing/updating of a SAS dataset. Essentially, I want to show some of the columns in a dataset to the user via the web browser in a table, allow data to be entered into a column and then save that back to the underlying dataset.
I have a fairly decent grasp of HTML, CSS and JavaScript to help in this.
So, am i proposing the impossible? Your advice would be greatly appreciated.
Thanks
Jim
SAS 9.4 M3
You can do this.
To dig further into this, show an example of the underlying dataset and the changes you want to make in it.
Thanks for coming back.
The dataset is pretty simple, about 800 obs, 20 variables with a primary key. I want users to populate 3 numeric variables, the rest are text, I will display around 10 of the text variables to assist users.
Ideally, I'd like to show the 13 variables in a table, have the 3 numeric columns editable and have a save button to commit the changes back to the underlying SAS dataset.
Regards
Jim
@Jim_O_CCCU wrote:
Bump - Hi Kurt, do you need more info?
Thanks
Jim
I'm out of office at the time, meaning also that I have no viable access to "my" server. Will come back to you.
@Kurt_Bremser I too need the same. can you please tell is there any way to editable table as an input and it has to create a report??
It's possible with JSP or html but I would like to know is that acheivable using STP??
Please guide..
The SAS Hot Editor @boemskats linked to looks very promising. Look into it.
Note that any solution will necessarily include a lot of HTML/Javascript etc programming for the frontend. Either in a webapp or by creating the HTML code within the SAS code of the STP. No way around that.
@boemskats Can you please give the steps to get it done.?? Ofcourse I visited you blog but still need some more info.. I am using SAS EG as editor, what are the steps and special permission has to be done to get the SAS Hot editor?
Hey @arunrami have you had a look at the instructions here?
https://github.com/boemska/sas-hot-editor#how-do-i-deploy-it
@boemskats YES , I did see that and it seemed I need to download the file and make some configuration changes , and that is not possible to make it in our server, Is there any other way to do it ?
It doesn't require any configuration changes at all, just the deployment of an .spk file into Metadata, and unzipping a .zip file somewhere in your web server.
What specifically are you limited by? If you let me know I may be able to suggest an alternative.
Nik
@boemskats Seriously , I dont understand how to deploy the web app.. as mentioned in below setps. so far I have added all required STP and H54S to the the meta data server . just not sure how to proceed further to build frontend 😞
and where should I put the all the html/json files , same meta data server???
The optimal way to deploy web applications is to put your static content (html, css, javascript) on the web server (eg htdocs) and keep the SAS processes (stored processes, job executions) as 'data only' providers.
However, it IS possible to package the frontend into a service as well, and thereby bypass the need to deploy (and configure) the static content to the SAS web server. This results in some overhead during the initial load of an application, but those static files do get cached for subsequent calls.
Such a "packaged" approach is available for Data Controller (https://datacontroller.io) and a free (demo) copy is available if you are interested. It lets you modify data in a web browser, safely - with numerous integrity checks. See documentation.
Alternatively, you will need to do the following:
* stream all your html from a 'startup' stored process
* put all your JS and CSS files into dedicated stps, and call them using the `src` attribute
* convert your images to base 64 and embed them in your files
* if your js / css files have lines over 32k (quite common, esp with base64 images) you'll need to store them in metadata (or on the file system) and stream them byte for byte
@arunrami alternatively if you're after a commercially supported solution to this problem (which it sounds like you are), I recommend you check out datacontroller.io as suggested by Allan. Built with the same tech, but with a workflow + change approval process built in.
@arunrami - if you read the deployment steps, it involves deploying the stored process and configuring the h54s macro location, and then copying the dist directory to htdocs after editing h54sconfig.json. You don't need to build anything.
If you've still got issues with deployment feel free to raise an issue on GitHub and I'll get someone to help you out 🙂
Nik
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.