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?

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 7 replies
  • 1496 views
  • 2 likes
  • 4 in conversation