DATA Step, Macro, Functions and more

Creating SAS .XPT file

Reply
New Contributor
Posts: 4

Creating SAS .XPT file

I am working with a 3rd party vendor who is requesting data sets in a SAS .XPT file. I am a web developer using C# and I have no experience with SAS. 

 

Is it possible to create a .XPT file from scratch using a text writer?

 

 

Super User
Posts: 11,343

Re: Creating SAS .XPT file

Posted in reply to mmccarver

I would assume that you have access to SAS in some form. Use of Proc Cport would be every so much easier.

You can either export all of the data sets in a library in to a single file

proc cport data=sashelp.class file='c:\folder\class.xpt';

run;

would create a transport file for the data set sashelp.class.

You can export all of the datasets in a library also

 

proc cport library=libname file='c:\folder\library.xpt' memtype=data;

run;

New Contributor
Posts: 4

Re: Creating SAS .XPT file

Thank you for responding. 

 

I have no access to SAS. To be honest, this is the first time I've ever had to work with it. Typically, clients ask for CSV files as a method of data transferring but they are asking for .XPT files. 

 

Could I even create a .XPT file without SAS? 

 

 

Respected Advisor
Posts: 3,799

Re: Creating SAS .XPT file

Posted in reply to mmccarver

mmccarver wrote:

Thank you for responding. 

 

I have no access to SAS. To be honest, this is the first time I've ever had to work with it. Typically, clients ask for CSV files as a method of data transferring but they are asking for .XPT files. 

 

Could I even create a .XPT file without SAS? 

 

 


Yes you can create a file using a language other than SAS, that can be read by SAS with the SAS XPORT engine.  I believe this link will get you headed in the right direction.

 

http://support.sas.com/documentation/cdl/en/movefile/69975/HTML/default/viewer.htm#p0ld1i106e1xm7n16...

 

If you don't have SAS I'm not sure how you can test it, perhaps post it here and someone can try to read it for you.

Super User
Super User
Posts: 7,974

Re: Creating SAS .XPT file

Posted in reply to mmccarver

SAS V5 transport file format is open source.  For instance this doc might help:

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

 

That being said, XPts are old, and a real pain.  They are alos quite limited - variable label length and such like.

New Contributor
Posts: 4

Re: Creating SAS .XPT file

Thank you for your help. I think we are going to try to purchase a tool that can convert a .CSV file to a .XPT file. Could someone point me in the right direction? Learning SAS is outside the scope of what we develop.

 

The client wants

  • SAS Transport V6

 

With file extension .XPT

 

I would like to avoid the purchasing of something we don't need. 

Super User
Super User
Posts: 7,974

Re: Creating SAS .XPT file

[ Edited ]
Posted in reply to mmccarver

I don't know of any tool to do that.  Its should be relatively straight forward to write directly out as XPT though, the file format is well described:

http://support.sas.com/documentation/cdl/en/movefile/69975/HTML/default/viewer.htm#p0ld1i106e1xm7n16...

Even give you some class information to get started.

The one above is v8, but you can also find v6:

http://support.sas.com/kb/46/944.html

TS140 in the above doc.

Respected Advisor
Posts: 3,799

Re: Creating SAS .XPT file

Posted in reply to mmccarver

mmccarver wrote:

Thank you for your help. I think we are going to try to purchase a tool that can convert a .CSV file to a .XPT file. Could someone point me in the right direction? Learning SAS is outside the scope of what we develop.

 

The client wants

  • SAS Transport V6

 

With file extension .XPT

 

I would like to avoid the purchasing of something we don't need. 


 

I think this may work

http://www.stattransfer.com/

 

you can download a free trial.

Ask a Question
Discussion stats
  • 7 replies
  • 339 views
  • 0 likes
  • 4 in conversation