BookmarkSubscribeRSS Feed
user24feb
Barite | Level 11

Hello,

I'm playing around a little and it is obviously my first fedsql try.

If this program works:

Libname sqlserv ODBC Schema=DBO DSN=sassql;

Proc SQL NoPrint;
  Create Table Test_A As
    Select Year_Month_Key, Sum(Sales_Group) As Sales_Group
    From sqlserv.vFact_Sales_Planning
    Where Year_Month_Key>=201401
    Group By Year_Month_Key
    Order By Year_Month_Key;
Quit;

why do I get the following error with fedsql:

Libname sqlserv ODBC Schema=DBO DSN=sassql;

Proc FedSQL NoPrint;
  Create Table Test_A As
    Select Year_Month_Key, Sum(Sales_Group) As Sales_Group
    From sqlserv.vFact_Sales_Planning
    Where Year_Month_Key>=201401
    Group By Year_Month_Key
    Order By Year_Month_Key;
Quit;

Log:

ERROR: Table "SQLSERV.VFACT_SALES_PLANNING" does not exist or cannot be accessed

ERROR: ERROR: [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name

       'Planning_Datamart.DOMXXXXX\XXX.VFACT_SALES_PLANNING'.

?

Thanks&kind regards

1 REPLY 1
SylviaPowell
SAS Employee

PROC FEDSQL uses data source connection options from the LIBNAME statement; it does not use LIBNAME options.  Try using the data source connection options documented in SAS/ACCESS to ODBC LIBNAME statement specifics: http://support.sas.com/documentation/cdl/en/acreldb/68028/HTML/default/viewer.htm#p0bu3zsz1a08ton1ms...

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1622 views
  • 0 likes
  • 2 in conversation