BookmarkSubscribeRSS Feed
Jim_O_CCCU
Fluorite | Level 6

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

18 REPLIES 18
Jim_O_CCCU
Fluorite | Level 6

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
Fluorite | Level 6
Bump - Hi Kurt, do you need more info?
Thanks

Jim
arunrami
Pyrite | Level 9

@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..

 

Kurt_Bremser
Super User

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.

arunrami
Pyrite | Level 9

@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?

boemskats
Lapis Lazuli | Level 10

Hey @arunrami have you had a look at the instructions here?

 

https://github.com/boemska/sas-hot-editor#how-do-i-deploy-it

 

 

arunrami
Pyrite | Level 9

@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 ?

boemskats
Lapis Lazuli | Level 10

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

arunrami
Pyrite | Level 9

@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???

AllanBowe
Barite | Level 11

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 

 

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs
boemskats
Lapis Lazuli | Level 10

@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.

boemskats
Lapis Lazuli | Level 10

@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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 18 replies
  • 2798 views
  • 6 likes
  • 5 in conversation