[EpiData-list] Complex if statements (was chk file with calculations ....)

epidata-list at lists.umanitoba.ca epidata-list at lists.umanitoba.ca
Tue Mar 4 14:22:45 CST 2008


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 
 

  




More information about the EpiData-list mailing list