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
@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.
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.
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
@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.
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.
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.
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.