Hi all,
This is a new twist to a question I’d asked in this forum some time back.
Can someone please see why this macro is not working? I’m calculating ages of different family members over different years (this also helps me to account for newcoming members and those that expire).
I’m trying to calculate age of each person in the family at the end of the year. I don’t see the ages increasing each year. Any inputs?
(A=year, b=weeks)
%macro calc(a,b);
data set&a&b;
set set&a&b;
array person {9} person1-person9;
array age {9} age1-age9;
array age_person {9} age_person1-age_person9;
do i=1 to 9;
age=floor( (intck('month', PERSON, '31dec20&a'd) -(day('31dec20&a'd) < day(PERSON)))/12);
end;
run;
%mend;
%calc (12,52);
%calc (11,52);
Thanks,
Try changing your single quotes to double quotes and ending your macro var with a period.
Try changing your single quotes to double quotes and ending your macro var with a period.
Worked like a charm Thank you Reeza!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.