BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
NewUsrStat
Lapis Lazuli | Level 10

Hi guys, 

suppose an individual is born at 01JUN2013, how is it possible to determine at which year he will become 60? 

 

Thank you very much!

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Two ways starting with a SAS date value.

 

data example;
   dob='01JUN2013'd;
   age60 = intnx('year',dob,60,'s');
   yrage60 = year(age60);
   format dob age60 date9.;
run;
/* or */
data example2;
   dob='01JUN2013'd; 
   yrage60 = year(dob)+60;
   format dob date9.;
run;

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

You don't even need to do this in SAS, you can do this in your head.

 

Add 60 to the birth year

 

2013+60=2073

 

But maybe that gives you an idea about how to do it in SAS

--
Paige Miller
ballardw
Super User

Two ways starting with a SAS date value.

 

data example;
   dob='01JUN2013'd;
   age60 = intnx('year',dob,60,'s');
   yrage60 = year(age60);
   format dob age60 date9.;
run;
/* or */
data example2;
   dob='01JUN2013'd; 
   yrage60 = year(dob)+60;
   format dob date9.;
run;

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 791 views
  • 1 like
  • 3 in conversation