I have a character variable which contains dates like (string length is 30):
Mon Jul 24 02:48:17 -0700 2017
------------------------------ ruler
123456789012345678901234567890
1 2 3
How can I extract the usable(date,month,year) date and save it as numeric date. I know how to do it by using SUBSTR function and then concatenating everything together. But I want to know a easier and quick way. I tried using ANYDTDTE informat to read it, but got blank values. Let me know if there is any simpler way to read this date.
substr
. Do you have to deal with this sort of input many multiple times ? If so, you could place the code for conversion to SAS date value in a macro. If the existing code works and the date string value construct is not variant maybe just accept it and move on. Just be sure to give the assigned variable a date format. – Richard