BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Nigel_Pain
Lapis Lazuli | Level 10

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

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

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.

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

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?  

Kurt_Bremser
Super User

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.

Nigel_Pain
Lapis Lazuli | Level 10
Thanks Kurt. Obvious really!

sas-innovate-2024.png

 

Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

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.

Discussion stats
  • 3 replies
  • 523 views
  • 0 likes
  • 3 in conversation