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 .
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.
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.
Thank you , but it doesn't work.
I make a mistake. Now , it works. Thank you again.
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.
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;
Thank you.
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!
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.
Ready to level-up your skills? Choose your own adventure.