BookmarkSubscribeRSS Feed
AaronEvans
Calcite | Level 5

Hello,

 

I have a couple stored processes to fetch a SAS dataset and then display it on the web in a jqGrid object.  My jqGrid example allows for edits, adds, and deletes.  I'd like to pass these edits, adds, and deletes back to my SAS dataset.  Does anyone know how to accomplish this?

 

I suspect I may need to change the editurl option and use another stored process?

 

I hope to use the boemska tools once I get more admin privileges.

 

Thanks,

Aaron

2 REPLIES 2
VasilijNevlev
Quartz | Level 8

Hey Aaron, 

 
Without Boemksa
 
I would recommend to use www.datatables.net instead of jqGrid. The implementation is much easier. In any case, you use ajax to get or update your data. Ajax supports most of the main HTML verbs. The two most useful for you are POST/GET. The key difference between them is that the parameters provided in URL for GET method and in the body for POST method. 
 
As for implementation, you could use one or several stored procedures.  
For several stored procedures, you could have end points such as getData, deleteData, updateData that correspond to different stored procedures all of which execute the specific operation and have separate logic.
For single stored procedure, you could use a collection of marcros where a single get/post parameter triggers the required stored procedure.
For example imagine the folloing SAS code:
 
%MACRO getData; 
%MEND; 
%MACRO updateData;
%MEND;
%&service;
 
Now you just need to pass a service name to your stored procedure to trigger the part that you care about. For example, sas.myhost.com/SASSTPAPP?Program=myAppSTP&service=getData. This will pass parameter "service" and it will resolve the macro variable service in the code above the the macro that you want to run. 
 
With Boemska
 
The development method with Boemska is different. To begin with, I would recommend to get their excellent SAS Hot Editor working that you can find here: https://github.com/Boemska/sas-hot-editor Once you have this working, check their API documentation (https://github.com/Boemska/h54s#javascript-api-reference) and have a look how the editor is working. 
 
P.S. 
 
Sorry, I couldn't help you with jqGrid, trust me, this is not the best framework to use. 
 
Regards,
Vasilij 
 
=======================================
For more information about {An}alytium, visit https://www.analytium.co.uk
AllanBowe
Barite | Level 11

Hi Aaron,

 

If you're looking for a 'ready made' solution to what you describe, I would refer you to https://datacontroller.io

 

If you're looking for an 'admin not necessary' approach to building & deploying web apps, you can also consider the SASjs framework - specifically, the 'streaming app' capability.  This compiles a frontend into a series of STPs, obviating the need for a web server (and requisite access rights).

 

Happy to jump on a call to explain further.

 

/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

sas-innovate-2024.png

📢

ANNOUNCEMENT

The early bird rate has been extended! Register by March 18 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

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
  • 2 replies
  • 971 views
  • 1 like
  • 3 in conversation