BookmarkSubscribeRSS Feed

[SAS 활용 FAQ] SAS 함수를 이용해서 연령을 구하는 방법을 알려주세요.

Started ‎07-27-2021 by
Modified ‎07-27-2021 by
Views 482

다양한 방법이 있을 수 있습니다. 아래 샘플을 참고로 활용하시기 바랍니다.

아래 substr 함수 부분에 주민번호 앞자리를 삽입하여 확인하십시오.

 

data _null_;

birth = input(substr('010225',1,6), YYMMDD6.);

today = today();

age = int((today-birth)/365.25);

put birth=;

put today=;

put age=;

run;

Version history
Last update:
‎07-27-2021 12:55 AM
Updated by:
Contributors

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Article Labels
Article Tags