I have a scheduled SAS program that updates a data set and then exports the new version to a CSV in a VA autoload folder using PROC EXPORT. The trouble is that there is a date field in the data, formatted as ddmmyy10, but the autoload is reading it as mmddyy10. I suppose this is more a programming issue to do with PROC IMPORT and the EFI, but is there a way to force the informat for autoload? I've tried ensuring that the locale is set to en_gb by adding the option to the appropriate config file on the LASR server but that's not making a difference.
Many thanks
Use an unambiguous format. Both yymmddd10. and e8601da10. produce dates formatted to ISO standards that leave no doubt.
For display in your reports, use nldates10. It will format the date according to the locale's customs.
What parts of the process can you control?
If you have a dataset with a data value in it and ask PROC EXPORT to create a CSV file it just writes the data using the format that is attached to the variable in the dataset you give it. So just change the format attached to the variable.
data for_export;
set have;
format mydatevar mmddyy10.;
run;
proc export data=for_export ...
Personally I try to never use either MMDDYY or DDMMYY formats for dates to avoid exactly that type of confusion. What happens in VA when you give it a CSV file with date strings in YMD order instead?
Use an unambiguous format. Both yymmddd10. and e8601da10. produce dates formatted to ISO standards that leave no doubt.
For display in your reports, use nldates10. It will format the date according to the locale's customs.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.