Hi All,
From the below data, I want to calculate age based on the condition like below
if age unit is year, then new_Age=age
if age unit is month, then new_age should be converted to year
if age and unit is blank, then value of new_age will be calculated by subtracting brthdtc from rficdtc .
When I write the logic, it is working but getting below message in log file. can you please help me what mistake I am doing
NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
Can you please help me how to proceed. Below is the sample of data
data test;
input pid age ageu $ rficdtc $19. brthdtc $10. ;
cards;
101 23 Year 2012-12-09T10:51:00 1987-07-19
102 230 Mon 1999-12-11 1987-07-19
103 113 Mon 1995-12-11 1992-07-19
104 . . 2016-12-09T10:51:00 1995-07-19
;
run;
proc sql;
create table test1 as
select pid, age, ageu,
put(input(substr(strip(rficdtc),1,10),yymmdd10.),yymmdd10.) as rficdtc,
strip(brthdtc) as brthdtc
from test;
quit;
data test2;
set test1;
if ageu='year' THEN NEW_AGE=AGE;
else if ageu='Mon' THEN NEW_AGE=round(AGE/12, 0.01);
else if ageu not in ('year', 'Mon') and RFICDTC ne '' and BRTHDTC ne '' then NEW_AGE=intck('year', RFICDTC, BRTHDTC);
else new_age=.;
run;
... View more