I am trying to calculate age for Missing values as per the following step and getting syntax error. What am I doing wrong here : Varun PROC SQL;CREATE TABLE Employee2 ASSELECT DISTINCT t1.Table1,variable1, variable2, case when variable1 NE . and variable2 LT 18.then '17 & Young...
RefDate The date on which you want to calculate the person's age.Caveat:The current version of this macro produces an error when used on dates of birth that fall on leap days.This macro returns an expression usable from both datastep and SQL code. For example:data...
/* calculate the average */ mean = (new+old)/2 ; run ; proc print data = diffs; run; proc sql noprint ; select mean(diff)-2*std(diff), mean(diff)+2*std(diff) into :lower, :upper from diffs ; quit; proc sgplot data = diffs ; scatter x = mean y = diff; refline 0 &upp...
calculate age-specific person years Posted 11-22-2021 06:43 AM (1024 views) In my dataset, I have date of birth (dob), start date (sdate) and end/stop date (edate) and I would like to calculate age-specific person years. Ideally, a list of variables should be created that looks...
Re: Calculate current age Posted 11-20-2017 03:31 AM (1662 views) | In reply to senac255 Use the intck() function: data have; input clientid dob clstartdate; cards; 123 10435 18309 122 3982 19452 156 -13125 20065 189 11497 17875 192 10977 19912 201 3133 20391 ; run; data want...
Calculate age from two dates Posted 03-05-2022 08:32 AM (1869 views) Kindly see the below code data PKMERGE; set PKDAR; /*Derivation of age*/ age=intck('year',VSN1D, DOB1D, 'Continuous'); /*Check the age*/ run; The below log appears NOTE: Invalid numeric data, ATLSMP1T=...
Re: how to calculate age Posted 04-27-2021 02:27 PM (580 views) | In reply to hjjijkkl Try this data have; input id month day year; datalines; 1 1 27 1985 2 10 12 2002 3 5 20 1990 ; data want(drop = dob); set have; dob = mdy(month, day, year); age = int(yrdif...
I'm trying to calculate age based on the date they came for a visit (date0) and their date of birth (dob0) aget=(date0)-(dob0)/365.25; this calculated age is not working. Do I need to formate anything?0 Likes Reply 12 REPLIES ed...
- I have DOB and Hire Date for each employee. I need to provide SAS code to calculate the age at when they were hired? I'm wondering if I should be using intck('dtday', DOB, Hire_date)? Attached is a sample dataset I am working with. Thank you!Q3...
I'm trying to find age of customer by using a column which has Julian date as the date of birth. Below is my input, customer_dob = 92138 changed_dt = 17-05-1992 dob = intck('year',today,changed_dt); I want to know a way to get the changed_dt in the above format sto...