Complex if statements (was chk file with calculations ....)
4 Mar
2008
4 Mar
'08
9:22 p.m.
For the suggested chk file command:
IF N9SUICIDE = 3 or (N9SUICIDE = 2 AND TOTAL >= 16) or TOTAL > 42 THEN ATRISK="Y" ELSE ATRISK="N" ENDIF
I would always write:
IF ((N9SUICIDE = 3) or ((N9SUICIDE = 2) AND (TOTAL >= 16)) or (TOTAL > 42)) then
most likely this would/should also work:
IF (N9SUICIDE = 3) or ((N9SUICIDE = 2) AND (TOTAL >= 16)) or (TOTAL > 42) then
In other words: Always be very explicit with parenthesis.
Test and report please.
regards
Jens Lauritsen EpiData Association
6136
Age (days ago)
6136
Last active (days ago)
0 comments
1 participants
participants (1)
-
epidata-list@lists.umanitoba.ca