01-05-2014 08:11 AM
DATA died1 (RENAME = (disdate=dthdate)) ;
MERGE ex.admissions (IN=dth KEEP = pt_id disdate hosp dest
WHERE = (dest=9))
ex.patients (IN=pts KEEP = id birthdate RENAME = (id=pt_id));
BY pt_id ;
IF dth AND pts ;
agedth = FLOOR((disdate-birthdate)/365.25) ;
DROP dest birthdate ;
I read this code in a paper.
I don't understand this line:" IF dth AND pts ;"
Is it the same as IF dth=1 AND pts=1?
01-05-2014 08:14 PM
This is an example of a SAS "Subsetting IF". It is shorthand for
If <expression is true> ; * continue ;
Else delete ;
An expression is true if it evaluates to any positive or negative number, excluding zero.
If the expression evaluates to zero or a missing value then it is false.
So the expression
If year ;
would include rows for all years except 0, and rows where year was null in the data.
Richard now back in NZ