BookmarkSubscribeRSS Feed
LXL
Fluorite | Level 6 LXL
Fluorite | Level 6

Hello,everyone,who has a programming case for C++ to access the SAS dataset through ODBC ?, Could you send me one? Thank you every much.

4 REPLIES 4
ChrisHemedinger
Community Manager

From your previous questions, you shared that you are using Visual C++.  I'll assume that you have access to the various Windows developer frameworks: MFC and/or ATL.

 

Remember that accessing SAS via ODBC is supported only if your data is on a SAS/Share server or in a SAS SPDS environment.  You can't read a sas7bdat file directly -- for that, you use OLE DB.

 

Otherwise, use standard Visual C++ techniques for connecting to your SAS ODBC driver.  See this topic on MSDN for a start.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
LXL
Fluorite | Level 6 LXL
Fluorite | Level 6
Thank you, can not i access local SAS data through ODBC if i do not use SAS/Share server or SAS SPDS ?
ChrisHemedinger
Community Manager

No, see information about the SAS ODBC driver here, and its uses.

 

But what's wrong with using OLE DB? That's a standard approach that can work with Microsoft development tools.  And we have a special book of "recipes" for different data access scenarios.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
LXL
Fluorite | Level 6 LXL
Fluorite | Level 6
Thank you for your patience. I have tried to use ODBC to connect with SAS but i did not succeed. Do you mean that C++ is more likely to be successful in accessing SAS datasets through OLE DB? I am a novice,and I have read that SAS® 9.4 Providers for OLE DB: Cookbook, i think there is too little information and no case in this cookbook and on the internet ,could you give me more information about this? I look forward to your reply.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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