SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
romankuzmik
Calcite | Level 5

I am implementing "Record Layout for a SAS Version 8 or 9 Data Set in SAS Transport Format" specification in Java/Groovy to be able to export XPT files from our proprietary application. We have "Record Layout for a SAS Version 5 or 6 Data Set in SAS Transport Format" implemented already and it generates valid XPT files I can open with SAS Universal Viewer. But the one generated according to v8 specification won't open in SAS Universal Viewer. btw, we use latest 1.4.2 version.

 

Can anyone provide me with actually working V8 XPT with some dummy data so I can compare with my files to understand where I am doing a mistake in my implementation.

 

Thanks! I do not have an access to actual SAS system and thus unable to generate XPT myself.

11 REPLIES 11
Reeza
Super User
That would likely violate the SAS licenses, since it's proprietary. I would recommend instead consider using the haven package from python or a similar package from R instead.
Reeza
Super User

Or use a publicly available file so it doesn’t matter? 
https://www.cdc.gov/brfss/annual_data/annual_1990.htm

Tom
Super User Tom
Super User

That file is just using normal V5 transport format.

romankuzmik
Calcite | Level 5

yes, got an access to SAS system and just generated V8.

bit surprised no one here could of generate this file for me.

ChrisNZ
Tourmaline | Level 20

Glad it all worked out in the end.

While it does seem that the specs are public, people are cautious about all things involving legal liability.

We'd have asked an admin for their opinion if you still needed help.

Ksenia2
Calcite | Level 5

Hello! I have the same issue, I need a dummy XPORT file in v8 format to test our Java open source parser that is going to support reading XPORT files. I wasn't able to find any publicly available .v8xpt.xpt8, or .2xpt file on the Internet. I don't have access to any SAS system. I would be really grateful if somebody could share such file.

Ksenia2
Calcite | Level 5

Thank you, but looks like it's still in V5, not V8 format 😞 According to the format documentation:

 

"The first header record consists of the following character string, in ASCII:
HEADER RECORD*******LIBV8 HEADER RECORD!!!!!!!000000000000000000000000000000"

 

And in the attached file it is 

"HEADER RECORD*******LIBRARY HEADER RECORD!!!!!!!000000000000000000000000000000"

Tom
Super User Tom
Super User

A CPORT file is not an XPORT file.

 

To make a V5 XPORT file you can use the XPORT engine. But to make a V8 (or V9) XPORT file you have to use the SAS supplied macros (or write your own method).  Make sure when using the macro what type it generates, it might downgrade to V5 format automatically if your input dataset does not need any of the enhanced features.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 11 replies
  • 5242 views
  • 2 likes
  • 6 in conversation