I have been exploring the best way to convert numeric dates in the form 19990125 (YYYYMMDD) to SAS date values.
So far, I have come up with the following solution:
For numeric dates in the form 20050101 (YYYYMMDD): input(put(TABLE.DATE_COL ,8.),YYMMDD10.)
For numeric dates in the form 200501 (YYYYMM): input(put(TABLE.DATE_COL ,6.)||'01',YYMMDD10.)
Does anyone know of a better/more efficient way of doing this? Many dates from oracle or db2 come in this format and as often as SAS imports data from these dbms, I would think there is a better way.
I believe SAS does a pretty good job in converting dates from a DBMS.
But if the dates in the DMBS are stored as characters - well: then you store them as well as characters in SAS or you tell SAS how to convert these characters.
Only because there are digits in this character columns doesn't make it numeric (anyway in most DBMS there are special types for dates).
But what about this:
put numdate yymmdds10.;
put numdate yymms7.;