Hello everyone,
i would appreciate your help as i'm stuck.
i want to calculate a study period by using "beginning of the study" variables (2 variables: month and year ) and the "end of the study variables" ( month and year). i tried concantenating the month and year period for begginning and end of the study but i dont know how else to go about it
example of what i want : if beginning date (ddmmyy) is 01082010 and end date is 01072011(ddmmyy), i want a new variable titled "study_period" which will have a value of 12 (i.e 12 months since the difference in the dates is a year).
these date variables ic reated using catt function is character
thank you
DATA TRIAL;
Set TCR.DUMMY4;
Col_beg = catt(1,FirstRxDtSEERMonth,FirstRxDtSEERYear);
/** these are the variables for the beginning of the study; i added 1 as the first day of the month, followed by the time in month, and then in year**/
Col_end = catt(1,datelastcontmonth,datelastcontyear);
/** these are the variables for the end of the study; i added 1 as the first day of the month, followed by the time in month, and then in year**/
Run;
PROC PRINT DATA = TRIAL (OBS = 10);
VAR COL_beg col_end;
RUN;
DATA TRIAL2;
Set Trial;
date_beg = input(col_beg,ddmmyy10.); /**trying to convert to date format but didnt work**/
date_end = input(col_end,ddmmyy10.); /*log error: Invalid argument to function INPUT at line 49 column 12.*/
run;
run;
sas output