BookmarkSubscribeRSS Feed
SaumyaPandey
Calcite | Level 5

Need to convert XPT file to Excel using Perl.

5 REPLIES 5
Kurt_Bremser
Super User

If you need help with perl, ask in a perl-specific forum.

 

For dealing with SAS transport formats, you need SAS and the XPORT library engine.

 

For more information and reference, look here: https://www.loc.gov/preservation/digital/formats/fdd/fdd000464.shtml

RW9
Diamond | Level 26 RW9
Diamond | Level 26

I need to unscrew this door, with a banana!

 

Do you see the point.

 

Perl is a method of processing string data.  XPT is a now open binary file source.   You need to be able to process the binary file and convert it into a usable format.  The simplest method of doing this is to use SAS base and the libname xpt engine, then you can dump the output into a CSV file - as you wouldn't want to go from one dreadful proprietary binary format to another one would you?

https://communities.sas.com/t5/Base-SAS-Programming/Convert-XPT-to-SAS-Datasets/td-p/97872

SaumyaPandey
Calcite | Level 5

@RW9 I am getting your point but there is a requirement needed to make a xpt to excel convertor using Perl.Is it possible?

I have seen libraries in R and Python that can do that,is there any module in Perl for the same?

RW9
Diamond | Level 26 RW9
Diamond | Level 26

I don't know, this is a SAS forum?

Try: 

https://www.perl.org/community.html

 

Do note however that XPT is ancient, and open source now.  If anything, people are moving away from that format.  Here is the technical layout of the file:

https://support.sas.com/techsup/technote/ts140.pdf

Kurt_Bremser
Super User

@SaumyaPandey wrote:

... requirement needed to make a xpt to excel convertor using Perl.


The XPT format is well documented, so if you have that requirement, roll your own module. That's the nice thing with open source. And let your customer pay fully for the development.

 

Otherwise follow Maxim 14 and use the right tool, which is SAS.

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

Discussion stats
  • 5 replies
  • 4010 views
  • 2 likes
  • 3 in conversation