Your SAS programs, embedded in web apps and elsewhere

How to Modify SAS Datasets with jqGrid Edits?

Reply
New Contributor
Posts: 3

How to Modify SAS Datasets with jqGrid Edits?

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

Attachment
Attachment
Contributor
Posts: 39

Re: How to Modify SAS Datasets with jqGrid Edits?

Posted in reply to AaronEvans

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
Ask a Question
Discussion stats
  • 1 reply
  • 142 views
  • 1 like
  • 2 in conversation