04-16-2013 03:52 AM
We want to access SAS datasets for data manipulations like creating new DS from raw datasets. And we want to write SAS codes inside the PHP to handle the DSs.
Is this is possible. If so, how?
Note: We are trying to create a web based application using this.
04-16-2013 04:26 AM
Not being a PHP-programmer, just trying to interpet web information...
One obviuos way is for you to talk to SAS via ODBC/JDBC. Unfortunately, your SAS installation needs to licensed to act as a ODBC Server (SAS/SHARE and SAS/SHARE*NET).
Another way to integrate with SAS is to use the API for IOM (Integrated Object Model). Check out the on line doc and resources to see whether this is feasible for you. i think this method requires a license for "SAS Integration Technologies".
04-16-2013 06:35 AM
You also need a license for SHARE*NET (it's just a license add on, not a real product that needs to be installed).
That will give you the possibility to access SAS via ODBC, hence giving you possibility to read and manipulate data via SQL.
The procedure is to have a SAS/SHARE server up and running, and then define it as a data source in your ODBC manager (which of course requires that you have the SAS ODBC driver installed on that host).
04-16-2013 08:31 AM
That's the other way around, that module is used by SAS for accessing other data sources.
A possible solution is to use any other ODBC database, and have your web app access that (and SAS can then access that data separately). But then the question is, what role has SAS in your application, other than a data store...?
04-16-2013 08:52 AM
Perhaps you could write some SAS Stored Process, which you could call from PHP (via http calls)....? ODBC won't let you run SAS specific code, just ANSI-like SQL.
04-16-2013 09:17 AM
I'd done something similar whereby SAS calls PHP via a URL fileref, but never with PHP controlling SAS.
Also, be aware that the terms of your SAS licence prohibit exposing of SAS functionality to a web-based environment, i.e. you are not allowed to take a HTML form submission containing SAS code, and pass it back to SAS for processing.
04-16-2013 09:38 AM
From the PHP snippet, it seems you're invoking SAS on a local machine. The licence will cover that machine only. Exposing SAS functionality via a web-based / PHP-processed form to multiple users is a breach of that single PC/user licence.
04-16-2013 09:03 AM
If SAS is installed on the same server that is running the PHP code then you can just call SAS the same as you would call any other operating system command. Not necessarily as interactive of using IOM, but probably a lot simpler to get started.