BookmarkSubscribeRSS Feed
sree161
Calcite | Level 5

Hi,

 

I have installed SAS universal viewer and copied dll's from SAS home directory.

 

Iam using below code in ASP.NET application to read .xpt files and convert to SAS dataset.

 

 

 

 

using SAS.UV.Transport;

 

 

SAS.UV.Transport.TransportFile tf = new SAS.UV.Transport.TransportFile(@"D:\tildra-pss\adlb.xpt");

var x = tf.Datasets;

 

 

 

 

 

Please find the attached screenshots for the errors raised.

 

 

Thanks

5 REPLIES 5
ChrisHemedinger
Community Manager

I'm afraid we can't help you with this.  We do not support any APIs related to using components of the SAS Universal Viewer in this way.

 

You might be able to accomplish what you need directly with the SAS OLE DB Local Data Provider.  See the "cookbook" documentation and search for XPT.

 

And I have some examples in this OLE DB blog series.

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

The code appears to be from a blog post of mine in 2011. I have just updated it showing you how to fix the issue:

 

http://savian.blogspot.com/2011/02/sas-transport-files-and-net.html

 

https://github.com/savian-net
ChrisHemedinger
Community Manager

Thanks @AlanC .  Of course, SAS still doesn't officially support that use of piecemeal DLLs from a packaged product.  But, as my daughters like to say, you do you. 😉

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
AlanC
Barite | Level 11
Yeah, I know 😉

I took the time to figure it all out in binary but it was a very long week to get the floats figured out (it also got coded years after I put that blog post up).

I may release the binary code at some point but not w/o thinking about it a bit.


https://github.com/savian-net
HenningBW
Calcite | Level 5
You also need to include the file SAS.UV.Utility.dll

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