BookmarkSubscribeRSS Feed
fs_sas_newbie
Calcite | Level 5

Hello,

I apologize if this is not the correct discussion group for this question; it seemed like the best choice.

I have an application written in C# that has a requirement to create sas data files, specifically the sas7bdat format.  I'm trying to figure out what SAS integration options are available for doing so.

Notes:

  1. We do not own any SAS products but are not averse to buying them in order to satisfy our needs to produce sas7bdat files.
  2. If it is helpful, the data to be converted can be written to an intermediate format (e.g. a CSV file) prior to the conversion to the sas7bdat format.
  3. We'd prefer not to have generate/write SAS code to create the sas7bdat file.  In other words, ideally, through the purchase of some SAS product, we gain access to a C# DLL that is capable of taking some in-memory data structure or a reference to a data file (e.g. CSV) and creating a sas7bdat file.
  4. We currently have a working integration with StatTransfer but we are evaluating other options.

Thank you for your time.  If our needs are unclear, please ask us to clarify.

4 REPLIES 4
ChrisHemedinger
Community Manager

See some references here:

Peek at your data using VBScript, OLE DB, and the SAS local data provider - The SAS Dummy

Using Windows PowerShell to view your SAS data dictionary

These both use the SAS OLE DB data providers, which are available from support.sas.com.  However, their primary purpose is for reading and perhaps updates, not as much for creating new SAS7BDAT files.

Chris

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
TomKari
Onyx | Level 15

I'm not a C# guy, but one of my friends at Statistics Canada is!

Hope this helps you out.

Tom

http://support.sas.com/resources/papers/proceedings12/017-2012.pdf

Tom
Super User Tom
Super User

What is the aversion to writing SAS code, or really writing a SAS code generating module in your C program?

Code to create a SAS dataset from a CSV file is trivial to write, especially if you limit the types of inputs that you need to support.

jakarman
Barite | Level 11

The question is unclear in its goal.

If you want just to deliver a file that easily can be read by users running SAS.....

- The csv file approach could be sufficient. But do not use comma as delimeters  with a european relation using the decimal separators different.

- the transport-file could be sufficient although it is based on SAS-V6 .

  TS-DOC: TS-140 - THE RECORD LAYOUT OF A DATA SET IN SAS TRANSPORT (XPORT) FORMAT

  This is the only public available description of a typical SAS data-structure. The internal sas7bdat structure is only open to dedicated partners like syncsort

  This is pushing some pressure on release management of the SAS middleware (SAS system) as the structure of a sas7bdat is changing with SAS releases.

By the way,

-  you could involve your C# code from a running SAS-session   

   40562 - Defining a C function and calling it from the SAS® System

SAS has stopped with their C-offering, but you can still find a lot

  Introduction to the SAS/C C++ Development System : Overview of the SAS/C C++ Development System

The SAS/toolkit software is still mentioned. but I have not seen any updates since SAS v6   

---->-- ja karman --<-----

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!

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