Architecting, installing and maintaining your SAS environment

Can anyone know how to integrate SAS with PHP?

Reply
Occasional Contributor
Posts: 15

Can anyone know how to integrate SAS with PHP?

Can anyone know how to integrate SAS with PHP?

Super User
Posts: 5,257

Re: Can anyone know how to integrate SAS with PHP?

Kind of open question.

If you could give some examples of your requirements, it would be simpler to point in the right direction.

Data never sleeps
Occasional Contributor
Posts: 15

Re: Can anyone know how to integrate SAS with PHP?

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.

Super User
Posts: 5,257

Re: Can anyone know how to integrate SAS with PHP?

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

Data never sleeps
Occasional Contributor
Posts: 15

Re: Can anyone know how to integrate SAS with PHP?

Ya.Thanks a lot. We are having license for SAS/SHARE.. But how can we use that to integrate with PHP?

Is there any kind of procedures to follow?

Super User
Posts: 5,257

Re: Can anyone know how to integrate SAS with PHP?

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

SAS ODBC Drivers

Data never sleeps
Occasional Contributor
Posts: 15

Re: Can anyone know how to integrate SAS with PHP?

Is there any possibility of accessing using "SAS/ACCESS Interface to ODBC"?

Super User
Posts: 5,257

Re: Can anyone know how to integrate SAS with PHP?

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

Data never sleeps
Occasional Contributor
Posts: 15

Re: Can anyone know how to integrate SAS with PHP?

We want to use SAS as our back end.

Occasional Contributor
Posts: 15

Re: Can anyone know how to integrate SAS with PHP?

Actually we want to run SAS codes inside the PHP to generate SAS DS. And we can reuse the new DS as well.

Super User
Posts: 5,257

Re: Can anyone know how to integrate SAS with PHP?

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.

Data never sleeps
Occasional Contributor
Posts: 7

Re: Can anyone know how to integrate SAS with PHP?

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.

Occasional Contributor
Posts: 15

Re: Can anyone know how to integrate SAS with PHP?

We have license version of SAS 9.3 so it may not lead any issues i think.

Occasional Contributor
Posts: 7

Re: Can anyone know how to integrate SAS with PHP?

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.


Super User
Super User
Posts: 6,500

Re: Can anyone know how to integrate SAS with PHP?

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.

http://chipmunkninja.com/Program-Execution-in-PHP%3A-exec-m@

Ask a Question
Discussion stats
  • 18 replies
  • 2214 views
  • 7 likes
  • 4 in conversation