BookmarkSubscribeRSS Feed
boey
Calcite | Level 5


I am having a problem of date output format when sending my list report to excel, the date format originally set in SAS EG has changed from DD/MM/YYYY to mixure of DD/MM/YYYY and MM/DD/YYYY. Any solution for this?

10 REPLIES 10
TomKari
Onyx | Level 15

How are you sending it to Excel?

Tom

Jagadishkatam
Amethyst | Level 16

Were the dates in numeric format or character format.

if numeric, please check the format of the dates. If the format is fixed across the column then there should not be any problem in exported file.

If the format is not fixed, then the excel generated will have mixed formats. Could you please assign the fixed format to the column of date and check.

Thanks,

Jag

Thanks,
Jag
boey
Calcite | Level 5

Date Format.JPG

table on the left side is SAS list report output; table on the right side is exported excel output.

I have already fixed the format in SAS EG with DDMMYYS.10 but when sending to excel, the column shows the mixed format (date and character).

Jagadishkatam
Amethyst | Level 16

Could you please change the format to ddmmyy10. ,

i believe DDMMYYS.10 is not a valid format.

Thanks,

Jag

Thanks,
Jag
boey
Calcite | Level 5

sorry, it is DDMMYYS10., it was just my typing error here.

kuridisanjeev
Quartz | Level 8

Yes,

as Jag said ,format name should be DDMMYYS10. instead of DDMMYYS.10

Thanks,

Sanjeev.K

TomKari
Onyx | Level 15

Yes, I've been able to replicate your problem. I'm guessing it's because SAS is sending the formatted value in the "dd/mm/yyyy" format, e.g. 01/02/2014, for Feb 1 2014, to excel. I've bumped into this a few times...any time excel sees "99/99/9999", it assumes mm/dd/yyyy as long as the first number isn't greater than 12.

I'm not sure of your requirements, but I was able to get the transfer to work by putting a format of date9. on my date column in the List Report task. This sends it to excel in an unambiguous 01feb2014 format, which excel recognizes. From there, you can format it in excel.

Tom

boey
Calcite | Level 5

It helps! Thanks Tom!

Boey

NaveenSrinivasan
Calcite | Level 5

Hi,

I'd like suggest you to

1. apply your desired format whether dd/mm/yyyy or mm/dd/yyyy by modifying the code using the format statement that should be written to the output datset.  Safely, this should resolve.

2. Verify the results by checking with filter.

3. Then export to excel

I am guessing  there might be an issue in permanently associating(storing) your desired Date format in the descriptor portion of the output dataset, which you are trying to export to excel.

HTH,

Naveen

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
  • 10 replies
  • 1597 views
  • 1 like
  • 5 in conversation