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;

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 6 replies
  • 958 views
  • 0 likes
  • 4 in conversation