Glad you got it working.
I suspect the problem was actually in your SAS dataset, not in the process of exporting the data to Excel. Can you share how you exported the data to Excel?
My understanding is the yearcutoff option only has an effect when SAS encounters a two-digit value and is asked to interpret it as a four-digit year.
Once you have a date variable (or date-time variable), the data is stored as a number (number of days or seconds since 01Jan1960). So yearcutoff should not have any impact, as I understand it.
When I run below, the date-time is correctly exported to Excel, as I would expect:
options yearcutoff=1926 ;
data have ;
mydate="01Jan2026:12:54"dt ;
format mydate datetime. ;
run ;
proc export data=have outfile="Q:\junk\want.xlsx" dbms=xlsx replace;
run ;
My guess is if changing yearcutoff fixed the problem, that means somewhere in your code or data you have a two-digit year and you asked SAS to calculate a date-time from that value.
@ChrisHemedinger , is there really a case where the YEARCUTOFF value would effect the export process itself (assuming the exported data is a SAS date or date-time)?
... View more