BookmarkSubscribeRSS Feed
brodie
Calcite | Level 5

Hi there,

I wanted to try running some Base SAS code in SAS EG, but haven't figured out a code-based way to assign a LIBNAME to my OLE DB in EG like I can in Base SAS (EG 4.3). If I submit my usual

LIBNAME sqlsrv oledb init_string="Provider=<x>;

Integrated Security=<x>;Persist Security Info=<x>;

Initial Catalog=<x>;Data Source=<x>" schema=dbo;

code then EG cannot assign a LIBNAME ("Error trying to establish connection: Unable to initialize (CoInitializeEx)". I know I can access the data files using Open -> OLEDB, but I'd really like some code I can run rather than having to do the point and click (and type) method every time (no background code is generated by EG using the OPEN->OLEDB process).

Help please!

Brooke

.

3 REPLIES 3
TomKari
Onyx | Level 15

Hi, Brooke

I suspect the issue is the SAS server that you are using. When you use SAS with Display Manager (what you call Base SAS), the SAS code is running on your PC. When you use EG, you may be using a different machine (called a SAS server) to run your code. Because of that, the OLE connection information that is on your machine won't be available.

First, confirm that this is the case. At the top of your program window, you should see a "Selected Server:" dropbox. If the selection is "Local", you are using your computer, and the problem is something else, which we'll try to figure out. But if the selection is anything else, your code is being submitted to a remote server, and you'll have to either use the OLE connection that exists on that server, or get the administrator of the server to set one up.

I can assure you that what you are trying to do is possible. I've done it a bunch to a variety of databases.

Tom

brodie
Calcite | Level 5

Hi Tom,

It looks like I'm successfully connected to the Local server per the left hand task pane, so it's the "something else" that we're looking for.

Although awkward, I wondered if I couldn't just make a project template with the link to the OLEDB source already started, and then I can base future projects on that? Hopefully there's something more elegant than that.

Brooke

TomKari
Onyx | Level 15

My advice is to get your connection problem resolved; at this point, I would put in a case to SAS Technical Support. I've had to go through a number of these over the years, and they're very good. I'm sure it should work the way you want it to, so why bother with workarounds?

Tom

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1240 views
  • 0 likes
  • 2 in conversation