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

Hi All,

I'm having a trouble to keep my date format after exporting to csv.

I'm generating date using the following format yyyy-mm-dd but when i open the exported csv file it gives me : dd/mm/yyyy.

 

I'm using the SAS EG version 7.13 HF3   : Task/Data/Copy files feature to export.

 

so,please any help will be appreciated.

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

@korssane wrote:

Hi ,

Thanks for the quick reply .

I'm opening the file using Excel. 

the actual SAS format name of the variable(s) in the dataset

Type : Date 

length : 8

Format : YYMMDD10.

Informat is blank 

 

pls let me know if you need other info.

thanks

 

 


Did you try opening it in another application such as Notepad or Wordpad? If you use one of these then you'll likely see dates is yyyy-mm-dd appearance.

 

I repeat: Excel will change the appearance of values. One option is to not worry about it and just the column appearance in Excel using the format cells for the entire  column.

 

View solution in original post

4 REPLIES 4
ballardw
Super User

Did you open the result in Excel or a text editor? Excel is infamous for reformatting things.

 

You may have to tell  us the actual SAS format name of the variable(s) in the dataset if the above is not the case.

korssane
Calcite | Level 5

Hi ,

Thanks for the quick reply .

I'm opening the file using Excel. 

the actual SAS format name of the variable(s) in the dataset

Type : Date 

length : 8

Format : YYMMDD10.

Informat is blank 

 

pls let me know if you need other info.

thanks

 

 

ballardw
Super User

@korssane wrote:

Hi ,

Thanks for the quick reply .

I'm opening the file using Excel. 

the actual SAS format name of the variable(s) in the dataset

Type : Date 

length : 8

Format : YYMMDD10.

Informat is blank 

 

pls let me know if you need other info.

thanks

 

 


Did you try opening it in another application such as Notepad or Wordpad? If you use one of these then you'll likely see dates is yyyy-mm-dd appearance.

 

I repeat: Excel will change the appearance of values. One option is to not worry about it and just the column appearance in Excel using the format cells for the entire  column.

 

Kurt_Bremser
Super User

Excel is the culprit here. At least it recognized your dates as such.

Excel will format dates according to the Windows locale setting.

After opening the file, change the format for the column to the one you desire. Or change the system's date format setting.

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 4 replies
  • 3881 views
  • 5 likes
  • 3 in conversation