BookmarkSubscribeRSS Feed
RandoDando
Pyrite | Level 9

I am using SAS EG which is using SAS version 9.4.3.0.   How can I connect to a SalesForce database? I prefer to link to it so that I can explore the tables in SAS.  I was granted an Admin account to SF so that I can see all which is there.  Thanks

7 REPLIES 7
jimbarbour
Meteorite | Level 14

You would need to create a Libname.  Assuming that whatever database Salesforce uses is compatible with SAS and that you have the proper drivers and such, you should then be able to browse just as you would SAS datasets.

 

The first thing I would want to know is:  Do you have the proper SAS/Access licenses to read Salesforce?  Then we have to look at the drivers you have available to you.

 

Can you run the below code and post the SAS log?  Please use the indicated icon to post the log.

jimbarbour_0-1628178104801.png

 

PROC SETINIT;
RUN;

PROC PRODUCT_STATUS;
RUN;

 

Jim

RandoDando
Pyrite | Level 9
Product expiration dates:
---Base SAS Software                                                                                   
---SAS/STAT                                                                                             
---SAS/GRAPH                                                                                           
---SAS/ETS                                                                                              
---SAS/FSP                                                                                              
---SAS/AF                                                                                               
---SAS/IML                                                                                              
---SAS/ASSIST                                                                                           
---SAS/CONNECT                                                                                      


---SAS OLAP Server                                                                                  
---MDDB Server common products                                                      
---SAS Integration Technologies                                                            
---SAS/Secure 168-bit                                                                              
---SAS/Secure Windows                                                                          
---Unused OLAP Slot                                                                                
---SAS Enterprise Guide                                                                          
---SAS/ACCESS Interface to Oracle                                                        
---SAS/ACCESS Interface to PC Files                                                      
---SAS/ACCESS Interface to ODBC                                                         
---SAS/IML Studio                                                                                     
---SAS Workspace Server for Local Access                                           
---SAS Workspace Server for Enterprise Access                                  
---SAS/ACCESS Interface to Sybase IQ                                                  
---High Performance Suite                                                                      
---SAS Add-in for Microsoft Excel                                                          
---SAS Add-in for Microsoft Outlook                                                     
---SAS Add-in for Microsoft PowerPoint                                              
---SAS Add-in for Microsoft Word                                                         
---SAS Visual Analytics Services                                                             

40         
41         PROC PRODUCT_STATUS;
42         run;

For Base SAS Software ...
   Custom version information: 9.4_M3
   Image version information: 
For SAS/STAT ...
   Custom version information: 14.1
For SAS/GRAPH ...
   Custom version information: 9.4_M3
For SAS/ETS ...
   Custom version information: 14.1
For SAS/FSP ...
   Custom version information: 9.4_M3
For SAS/AF ...
   Custom version information: 9.4_M3
For SAS/IML ...
   Custom version information: 14.1
For SAS/ASSIST ...
   Custom version information: 9.4
   Image version information: 
For SAS/CONNECT ...
   Custom version information: 9.4_M3
For SAS OLAP Server ...
   Custom version information: 9.4
For SAS Integration Technologies ...
   Custom version information: 9.4_M3
For High Performance Suite ...
   Custom version information: 2.2_M4
For SAS/ACCESS Interface to Oracle ...
   Custom version information: 9.4_M3
For SAS/ACCESS Interface to PC Files ...
   Custom version information: 9.4_M3
For SAS/ACCESS Interface to ODBC ...
   Custom version information: 9.4_M3

Looks like the engine for SF isn't there.  Also tried the libname statement for SFORCE and got the error message that it couldn't find it.

 

Great.  Looks like it's going to be the 'old fashioned' way of importing raw.

jimbarbour
Meteorite | Level 14

Well, now, hold on.  There is still an option here.  I see that you do have ODBC.  We can use ODBC to connect -- if you have the driver on your SAS server.

 

When you ran SETINIT, which version of SAS did it say you have and what operating system?  I need these two pieces of information:

Current version: 9.04.01M6P111518
Operating System:   WX64_SV .

 

It looks like you're on a Windows system.  In Windows, we can use the ODBC Data Source Administrator to create a DSN for you to connect via.  Basically, this tells SAS what driver to use for a particular type of database.  In the screen shot below, you can see in the Driver column some of the drivers on my system.  We need to see if there is one for Salesforce on your system.  

jimbarbour_0-1628187507103.png

 

Jim

RandoDando
Pyrite | Level 9

I am working on an application server.  Wouldn't the driver have to be installed there? If so, then maybe a passthrough query would work.  I've performed those, but Oracle and Sybase are a far cry from SF.

jimbarbour
Meteorite | Level 14

@RandoDando wrote:

I am working on an application server.  Wouldn't the driver have to be installed there? 


The driver needs to be on the same machine as SAS.  It sounds like that is the case, but we won't know for sure until we look into the ODBC Data Source Administrator.

 


@RandoDando wrote:

maybe a passthrough query would work.  I've performed those, but Oracle and Sybase are a far cry from SF.


Oracle and Sybase are definitely different than Salesforce.  However, the nice thing about ODBC is that it does standardize the connection a bit, so there's that.  I'm willing to help if you'd like to try.  If not, then I think you'd have to export from SalesForce to csv or something and then import into SAS.  

 

If you'd like to try, I would like to know these two pieces of information from Proc SetInit:

Current version: 9.04.01M6P111518
Operating System:   WX64_SV .

 

Jim

RandoDando
Pyrite | Level 9
I have another idea. From my prior post above showing the available add-ins and drivers for my SAS server, would I be able to connect to MS Access? I don't see "Access" in the list specifically, but does having other Office products there include that?
jimbarbour
Meteorite | Level 14

@RandoDando wrote:
I have another idea. From my prior post above showing the available add-ins and drivers for my SAS server, would I be able to connect to MS Access? I don't see "Access" in the list specifically, but does having other Office products there include that?

Yes, you should be able to connect to Access.  If nothing else, you can do a Proc Import.

 

So, export from SF to Access and then read Access from SAS?

 

Jim

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 7 replies
  • 966 views
  • 0 likes
  • 2 in conversation