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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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