03-25-2015 01:27 PM
03-25-2015 01:33 PM
Well well, Have i not understood your question clearly or could you explain better please. Are you trying to extract date from the top 5 obs in your sample and then add or minus with other dates?It's difficult to understand what you are trying to achieve. Please provide your sample(have) dataset and (want) dataset.
03-25-2015 02:09 PM
So if you have 2003 what date do you want to map that to?
Same for 2007/2008?
And if you have month & year what are you assuming the day is? Can you assume the first, last or should you assume middle of the month?
03-31-2015 03:36 AM
You are still way to vague.
Show exactly what kind of output you desire based on input data, and try to explain in more words why/how.
03-31-2015 08:50 AM
If first day of the month is OK, try this code. Jim
input dat $20.;
len=length(dat); monyr=' ';
if len=4 then do;
if len=8 then date=input(dat,monyy10.);
if len gt 8 then do;
mon=scan(dat,1); day=scan(dat,2); yr=scan(dat,3);
format date mmddyy10.;
proc print; run;
03-31-2015 09:02 AM
In clinical trials data processing there is "always" a document that provides information on how incomplete dates (or anything else) should be imputed. You should read that.
Perhaps something like this.
01-JUL-year when you have only the year.
15-mon-year when you have only month and year.
Sometimes the imputation is slightly different if the date is a start versus an end date.
The point is, the answer to the imputation is in the documentation for the analysis and you already have that.