BookmarkSubscribeRSS Feed
Xinqiao
Calcite | Level 5

I want to export the sas data to csv, but I met some issue for partial date with ---. when I open csv with excel, the #NAME? error will show. How to show the format left to CSV file?

 

CSV.PNG

7 REPLIES 7
Kurt_Bremser
Super User

Welcome to the SAS communities!

 

Please post your dataset and the code you used to export the dataset, so we can recreate your issue.

Post your dataset as a self-contained data step with datalines, so we do not need to make guesses about variable types and other attributes.

Post your code using the "little running man" button (8th icon right above the main posting window).

andreas_lds
Jade | Level 19

And what happens if you open the csv-file with a text editor like notepad++? Excel does strange things when reading files.

ballardw
Super User

And to examine the CSV as such with a text editor you cannot SAVE the file from Excel. That will change the values of cells.

Xinqiao
Calcite | Level 5

If I want to fix the error, I try to add a TAP before the partial date, and the date ---2020 will show as ---2020 in excel, but it is different with other complete date, the complete date 01-JAN-2020 will show as 01-JAN-20.

Xinqiao
Calcite | Level 5
Sorry, the TAP should be TAB
Xinqiao
Calcite | Level 5

It is normal when I open it with notepad++, so its the excel issue, we can't see a partial data as ---20 in excel if the date=---2020?

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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