Desktop productivity for business analysts and programmers

Any way to change List Report's date output format?

Reply
Occasional Contributor
Posts: 9

Any way to change List Report's date output format?


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?

Trusted Advisor
Posts: 1,059

Re: Any way to change List Report's date output format?

How are you sending it to Excel?

Tom

Occasional Contributor
Posts: 9

Re: Any way to change List Report's date output format?

Send to Excel.jpg

Super User
Posts: 1,117

Re: Any way to change List Report's date output format?

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
Occasional Contributor
Posts: 9

Re: Any way to change List Report's date output format?

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

Super User
Posts: 1,117

Re: Any way to change List Report's date output format?

Could you please change the format to ddmmyy10. ,

i believe DDMMYYS.10 is not a valid format.

Thanks,

Jag

Thanks,
Jag
Occasional Contributor
Posts: 9

Re: Any way to change List Report's date output format?

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

Super Contributor
Posts: 276

Re: Any way to change List Report's date output format?

Yes,

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

Thanks,

Sanjeev.K

Trusted Advisor
Posts: 1,059

Re: Any way to change List Report's date output format?

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

Occasional Contributor
Posts: 9

Re: Any way to change List Report's date output format?

It helps! Thanks Tom!

Boey

Occasional Contributor
Posts: 18

Re: Any way to change List Report's date output format?

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

Ask a Question
Discussion stats
  • 10 replies
  • 527 views
  • 1 like
  • 5 in conversation