data A; /* from YYYYMMDD to MM/DD/YYYY createing some data to work with*/ input dday; cards; 20150702 19550606 19750127 19991231 ; run; /* The dday var is now a character data type and they are alocated to the right in your table column (check table A) - You have to use the SAS char functions trim + left to remove the empthy spaces before you can use the SAS input function to transform the char date (dday) into a SAS date informat. After this you can put the date into any date format */ data R; set A; format y MMDDYY10.; x=input(trim(left(dday)),YYMMDD8.); y = x; put y; /* Display dates in the SAS log */ run;
... View more