@lih wrote:
I have same problem. My date variable is 01JAN1960:01:47:52 (datetime20.). I tried datepart(date) and read day,month,year using substr, both not work, not sure why. Anybody has solution?
Important point: if something does not work, we don't know what you did. You need to show us your code, if there are errors in the log, show us the entire log for this DATA step; if it works but gives an answer you think is wrong, show us your code and show the wrong answer.
Wild guess:
You did not assign a format to the variable created by datepart(date), and it returns an answer of zero, which is the correct answer. You need to assign a DATE9. format to this variable to show the dates in "human readable" form which is 01JAN1960.
If that's not it, provide the information I asked for.
... View more