Hello
I'm doing an evaluation of SAS Enterprise Guide, to test if it can be used to teach Students and I ran into a problem when I try to replace a range of values.
The problem consists in both Versions EG3.0 and Learning Edition EG4.1. Perheps Im just doing it the wrong way, but I can't find a solution to it.
I've got an column "Age", which holds the very precise age of Patients, like (14.753424658). Now I have to make a new group column. Patients between the age 5 to 10 get a new value "Child", age 10 to 15 "Teenagers" and so on.
The code that the EG creates looks like this:
(CASE
WHEN 5 <= IMPW9568.Age AND IMPW9568.Age <= 10 THEN 'Child'
WHEN 10 <= IMPW9568.Age AND IMPW9568.Age <= 15 THEN 'Teen'
...
ELSE 'NA' END) AS Age_Group
As you may see the upper limit and the lower limit are overlapping <= 10 is the same as 10<=
But if I change my boundaries, so that they dont overlap:
(CASE
WHEN 5 <= IMPW9568.Age AND IMPW9568.Age <= 9 THEN 'Child'
WHEN 10 <= IMPW9568.Age AND IMPW9568.Age <= 14 THEN 'Teen'
...
ELSE 'NA' END) AS Age_Group
Then I'm getting NA (missings), since all the people between 9 and 10 (9.35367847) are left out.
Perheps it's not a bug, but a feature.
But its a problem for me. I could of course use very precise limits, like:
CASE
WHEN 5 <= IMPW9568.Age AND IMPW9568.Age <= 9.999999999 THEN 'Child'
WHEN 10 <= IMPW9568.Age AND IMPW9568.Age <= 14.999999999 THEN 'Teen'
...
ELSE 'NA' END) AS Age_Group
But perheps there is a better alternative?
SAS Analyst for example has an extra option to chose between a "<= x <" and "< x <=" logic. But a "<=" on both sides, as the EG creates it, just doesn't make much sense to me.
Thank you
Edit:
Perfect would be something like that:
(CASE
WHEN 5 <= IMPW9568.Age AND IMPW9568.Age < 10 THEN 'Child'
WHEN 10 <= IMPW9568.Age AND IMPW9568.Age < 15 THEN 'Teen'
...
ELSE 'NA' END) AS Age_Group
But creatable with EG.
Message was edited by: Tillmann Babik at Mar 26, 2007 6:03 AM
Message was edited by: Tillmann Babik at Mar 26, 2007 6:36 AM
Message was edited by: Tillmann Babik at Mar 26, 2007 6:40 AM