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

Hi,

I try to export my sasdata to the filetype: CSV UTF-8 (comma separated) (*.csv).

 

This is my code:

filename exp 'myoutlib\Testdata.csv' encoding="UTF-8";

Proc export Data=sashelp.class outfile= exp DBMS=dlm replace; DELIMITER=";";

run;

 

Best regards, Helle

 

 

 

1 ACCEPTED SOLUTION
8 REPLIES 8
Kurt_Bremser
Super User

@Helle42 wrote:
Thanks, but I have already tried that. Unfortunately, the file format is unicode.txt... 

 


unicode.txt is not a file format, it's a filename. Filenames are irrelevant with respect to contents, I can easily save a SAS program as garbage.frumpyfurious, the content would still be a SAS program. It's just that programs like the Windows Explorer would have a hard time finding the right software to open it.

 

Therefore it is correct to save a CSV file with a .csv extension. And those correct extensions also work better with current Excel versions, as Excel will complain if you let it open a file with a wrong extension (eg a .xls extension for a XML file created by ods tagsets.excelxp).

On top of that, MS Office will assign the .csv extension to MS Excel, so double-clicking works (which it does not do for .txt, as that is assigned to the default Editor)

RW9
Diamond | Level 26 RW9
Diamond | Level 26

CSV is not an Excel filetype.  CSV = text file with comma separated variables, with possible header row.  Just because Excel has a module which can read and parse CSV files, does not make them Excel files.

Helle42
Calcite | Level 5

Yes, correct, I just use EXCEL to check the filetype 🙂 Do you know how to export a SAS-file to the filetype: CSV UTF-8 (comma separated) (*.csv)?

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Forget Excel.  Please show what code you are running to create the file (and use sashelp.class or something so that we can run it also). 

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

have you tried using the export wizard?  there is only one csv type to choice from during the exporting.  You can save to export code created via the wizard and then edit that SAS export code to meet your needs.

CSV is not an Excel file nor an Excel dataset.  Excel is not a database, while many managers use the tool in that manner it is not a database.

Know your data, know your operating system.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 8 replies
  • 29026 views
  • 2 likes
  • 4 in conversation