BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tianerhu
Pyrite | Level 9

when i use 'proc export' to have a 'csv file' , why I have 'excel file' instead of 'txt file' every time?

Could you tell me how to get directly a 'txt file' ? Thank you .

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hi @tianerhu,

 

It's possible that on your computer Excel is set as the default program for .csv files so that their icons look similar to those of native Excel files. But if you right-click on a .csv file in the Windows Explorer and follow the dialog (Open with → Choose another app → ...) to change the default program to a text editor (e.g. Notepad), the appearance will change and you will be able to open a .csv file with the text editor by double-clicking it.

View solution in original post

6 REPLIES 6
FreelanceReinh
Jade | Level 19

Hi @tianerhu,

 

It's possible that on your computer Excel is set as the default program for .csv files so that their icons look similar to those of native Excel files. But if you right-click on a .csv file in the Windows Explorer and follow the dialog (Open with → Choose another app → ...) to change the default program to a text editor (e.g. Notepad), the appearance will change and you will be able to open a .csv file with the text editor by double-clicking it.

tianerhu
Pyrite | Level 9

I make a mistake. Now , it works. Thank you again.

ballardw
Super User

I suspect you are working on a Windows system that has associated the extension CSV for use with Excel, which is default when Excel is installed.

It is a Windows setting and nothing to do with SAS.

 

You can right click on files and select OPEN WITH to get a menu that says "choose another app" so you  can open the file in Notepad, Wordpad or some other application.

Or use the Windows tools to change the default application to open CSV files.

Tom
Super User Tom
Super User

What is the actual name of the file that you wrote?  What is telling you it is an "excel file"?  If you don't wnat it to call it that then just use a different extension when writing the file.  Call the file a .txt file instead of a .csv file.  Changing the name you use for the file will not change the content.

 

If you want to check the file after you have written it read it back in and check.

For example here is code to "export" to a CSV file and then read back in the first 10 lines from the file and show them in the SAS log.

proc export data=have out='want.csv' dbms=csv replace ;
run;
data _null_;
  infile 'want.csv' obs=10;
  input;
  put _infile_;
run;

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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