Hello,
My task is to calculate CD4 changes in 9 month and 12 months from the first test.
I do have the first date of CD4 testing with a format 'date9.' But I do not know how to command SAS to search 'a range of date' (9 month and one year) from the first date of testing.
I appreciate for any help. Thanks in advance.
data want;
set have;
date_9month=intnx('month',first_date,9,'s');
date_12month=intnx('month',first_date,12,'s');
run;
data want;
set have;
date_9month=intnx('month',first_date,9,'s');
date_12month=intnx('month',first_date,12,'s');
run;
Linlin,
Thanks for you prompt help. I am going to run the code and will follow-up results.
Phan S.
Dear Linlin,
Pls. kindly see the output below. No data for date_9month or date_12month.
Your further suggestion, I would appreciate. Thanks.
Ps
first_ date_ date_
Obs SOKID cd4 cd4date CD4PERC 9month 12month
1 20 332 29MAY2006 36.0 . .
2 40 20 30JAN2003 2.0 . .
3 80 222 15JAN2004 17.0 . .
4 90 20 01DEC2003 2.0 . .
Hi Linlin,
I did it. Thanks!
Ps
first_ first_ date_ date_
Obs SOKID cd4 cd4date CD4PERC 9month 12month
1 20 332 29MAY2006 36.0 28FEB2007 29MAY2007
2 40 20 30JAN2003 2.0 30OCT2003 30JAN2004
3 80 222 15JAN2004 17.0 15OCT2004 15JAN2005
4 90 20 01DEC2003 2.0 01SEP2004 01DEC2004
5 100 580 21DEC1989 36.0 21SEP1990 21DEC1990
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.