Convert SAS Transport file to csv

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

Convert SAS Transport file to csv

 Hello,

 

I am doing a research project, and ran into some SAS macros. Most are txt file which I can read, except for 1.

Could someone help convert the attached SAS transport file so I can read it in Excel.

[The original file was just "C2211L4P" (no extension). I had to add .txt so I could upload to this post.]

I tried the SAS General Viewer, which didn't read it either.

 

Here are the directions that came with the file. 

 

Code for converting coefficients transport file to SAS file:

filename inc  "C:\user defined location of the transport file\C2211L4P";

libname incoef  "C:\user defined location of the sas coefficients file";

proc cimport data=incoef.hcccoefn infile=inc;

run;

 

Thank you 

Sam


Accepted Solutions
Solution
‎01-30-2017 07:39 PM
Super User
Posts: 19,851

Re: Convert SAS Transport file to csv

Then look at a proc export to export your data to a CSV file and you'll need to download the results.

 

FYI CSV are text files that happen to open in Excel by default. 

View solution in original post


All Replies
Super User
Posts: 11,343

Re: Convert SAS Transport file to csv

Follow those instructions. Then export the the resulting data set(s) to csv.

 

The SAS transport files may contain multiple data sets and possibly catalogs, the instruction program is showing you how to extract only the data of interest.

Occasional Contributor
Posts: 6

Re: Convert SAS Transport file to csv

Hi - 

I don't have SAS. And, just need to get this one file converted.

Or is there a tool that would convert the transport file into csv or txt for me?

Thanks

Sam

Super User
Posts: 19,851

Re: Convert SAS Transport file to csv

There are versions of SAS available for your usage, assuming you're a student. Your university should also provide a copy/access if they expect you to use SAS. 

 

http://www.sas.com/en_my/learn/analytics-u.html

Super User
Posts: 11,343

Re: Convert SAS Transport file to csv

You might find a third-party software that does a conversion BUT the caveat would be whether your dataset contains any features that were not available when the conversion was written.

 

I would suggest downloading SAS University Edition, which is free and then use the Proc cimport code.

Occasional Contributor
Posts: 6

Re: Convert SAS Transport file to csv

can I use the cloud version or is the download/install the best way?

 

I assume there is "command" area where I can do those commands?

Or if you can point me to a How-To or menu option, otherwise I may be hunting around more.

Obviously, I have no SAS experience.

Thanks again,

Sam

 

Super User
Posts: 19,851

Re: Convert SAS Transport file to csv

If you're going to use it once and only for this, I would probably sign up for the cloud version via SAS Academics on Demand. If you plan to use it in the future then download and set up. It's a big file (2GB). 

 

Basic tutorial video's are here:

http://support.sas.com/training/tutorial/

 

Occasional Contributor
Posts: 6

Re: Convert SAS Transport file to csv

We'll give it a go. Thank you all

Sam

Occasional Contributor
Posts: 6

Re: Convert SAS Transport file to csv

Hello,

 

Using the online version of SAS

I've been trying to run the following to convert the transport file.

I'm getting the error: ERROR: Physical file does not exist, /pbr/biconfig/940/Lev1/SASApp/c:\hcc\C2211L4P.

I've double-checked. Attached is my folder. Again, I don't know SAS at all.

 

filename inc "c:\hcc\C2211L4P";
libname incoef "c:\hcc";
proc cimport data=incoef.hcccoefn infile=inc;
run;

 

Two Qs

1) what do I need to do?

2) once converted, how do I convert to Excel csv?

 

Thanks again

Sam

Attachment
Super User
Posts: 19,851

Re: Convert SAS Transport file to csv

You need to upload the file to the server.

When referencing files on the server, right click on it under Servers pane, select properties and find the path. The path is not your C drive since you're using an online service rather than an installation.

Solution
‎01-30-2017 07:39 PM
Super User
Posts: 19,851

Re: Convert SAS Transport file to csv

Then look at a proc export to export your data to a CSV file and you'll need to download the results.

 

FYI CSV are text files that happen to open in Excel by default. 

Occasional Contributor
Posts: 6

Re: Convert SAS Transport file to csv

Thanks. Was able to convert & export. All set.
Sam

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 11 replies
  • 419 views
  • 4 likes
  • 3 in conversation