Help using Base SAS procedures

connection to DB

Reply
N/A
Posts: 1

connection to DB

Hi

I use this code but I don't understand what it really does. It was written by someone in windows enviroment and now we changed to solaris(UNIX). I am not very clear with solaris(UNIX) syntax. Can someone explain to me what it says:

proc sql;
connect to sqlsvr as BDMIS (datasrc="BDMIS" user=sasuser password=XXXXXXX);
create table temp4.FACT_BASE as
select * from BDMIS
(SELECT * FROM FACT_BASE
WHERE &wherefmt);
quit;

ERROR: Invalid option name SELECT.
ERROR: Some options for file WORK.BDMIS were not processed because of errors or warnings noted above.
Trusted Advisor
Posts: 2,113

Re: connection to DB

I think that your error is that you are missing a "connection to" clause in the first select statement. Without it, SAS thinks that BDMIS is a SAS dataset in the WORK library. I would have expected this to have failed the same way on Windows.

proc sql;
connect to sqlsvr as BDMIS (datasrc="BDMIS" user=sasuser password=XXXXXXX);
create table temp4.FACT_BASE as
select * from connection to BDMIS
(SELECT * FROM FACT_BASE
WHERE &wherefmt);
quit;

The database specific syntax is described in the SAS Access documentation. This code uses the "pass thru" syntax for SQL.

Did you get an error on the "connect to" statement? If so, you may have a bigger problem. Microsoft SQLserver is only supported via the ODBC connectivity in SAS 8.2 and above. So a simple copy of the program to Solaris will not get you running. You will also need the SAS/Access to ODBC product for Solaris and the appropriate system connections to get to the SQLserver database. [If you are connecting to the Sybase product, you may be OK.]
Ask a Question
Discussion stats
  • 1 reply
  • 113 views
  • 0 likes
  • 2 in conversation