@xyxu wrote:
If I use the text editor to inspect, it's really hard to distinguish dates with different formats, e.g., "1/3/2019" could be either "Jan 03, 2019" or "Mar 01, 2019". When I open the file in Excel, the date is either left-aligned or right-aligned, allowing me to guess which is the month and which is the day (by comparing with dates like "22/3/2019" that has the same alignment).
I am feeling insecure about getting this into SAS. How do we know we are getting the date right?
Looking at the file, it was obvious to me that the dates were in DMY order; the second group of numbers never exceeds 12. Using the data step I proposed, any date not in DMY order would cause a log message, so you have an automated check.
PS all this would be moot if people had the intelligence to use the ISO 8601 standardized YYYY-MM-DD date format when moving data.
... View more