RANDOM VARIABLE IS DEFINED IN A NESTED IF STRUCTURE

From: Yanke_Yu Date: January 28, 2013 technical Source: mail-archive.com
Dear NONMEM users: Regarding the use of IF ELSE statement in NONMEM, can it be used in the $DES block in between the differential equations? e.g. in my control stream attached below in blue, OCCUPANCY was defined by A(3) and A(4), OCCUPANCY was further used to define INH using IF ELSE statement, and last, INH was used in the A(5) and A(6) differential equations. Can NONMEM do this? The error message I received attached below in red is " RANDOM VARIABLE IS DEFINED IN A NESTED IF STRUCTURE". Berkeley-Madonna can do such analysis, I just try to see whether it can also work in NONMEM. If NONMEM can do this, how can I revise the code? Thanks for the help! Best, Yanke $DES DADT(1) = -CL/V1*A(1)+Q*(A(2)/Vt-A(1)/V1)-kon*(A(1)/V1)*(A(3)/Nbs)+koff*A(4) DADT(2) = Q*(-A(2)/Vt+A(1)/V1)-CL/Vt*A(2) DADT(3) = -kL*A(3)-kon*(A(1)/V1)*(A(3)/Nbs)+koff*A(4)+PROD*A(6)*Nbs DADT(4) = -kAL*A(4)+kon*(A(1)/V1)*(A(3)/Nbs)-koff*A(4) OCCUPANCY = A(4)/(A(4)+A(3)) IF (OCCUPANCY.LE..3) THEN INH = 0 ELSEIF (OCCUPANCY.LE..9.AND.OCCUPANCY.GE..3) THEN INH = OCCUPANCY*5/3-0.5 ELSE INH = 1 ENDIF DADT(5) = Stc-kTC*A(5)-(1-INH)*ki*A(3)/Nbs*A(5)/V1 DADT(6) = (1-INH)*ki*A(3)/Nbs*A(5)/V1-kIC*A(6) AN ERROR WAS FOUND IN THE CONTROL STATEMENTS. AN ERROR WAS FOUND ON LINE 79 AT THE APPROXIMATE POSITION NOTED: ENDIF X 326 RANDOM VARIABLE IS DEFINED IN A NESTED IF STRUCTURE. [This e-mail message may contain privileged, confidential and/or proprietary information of Eisai. If you believe that it has been sent to you in error, please contact the sender immediately and delete the message including any attachments, without copying, using, or distributing any of the information contained therein. This e-mail message should not be interpreted to include a digital or electronic signature that can be used to authenticate an agreement, contract or other legal document, nor to reflect an intention to be bound to any legally-binding agreement or contract.]
Jan 28, 2013 Yanke_Yu RANDOM VARIABLE IS DEFINED IN A NESTED IF STRUCTURE
Jan 29, 2013 Nick Holford Re: RANDOM VARIABLE IS DEFINED IN A NESTED IF STRUCTURE