From: "Paul Hutson" prhutson@pharmacy.wisc.edu
Subject: [NMusers] 202 Fortran Error Message with LOG() 
Date:  Wed, June 22, 2005 5:43 pm

Dear NMUsers:
I am getting the following error with the CTL and data (abbreviated) appended below.

 AN ERROR WAS FOUND IN THE CONTROL STATEMENTS.
 
 AN ERROR WAS FOUND ON LINE  35 AT THE APPROXIMATE POSITION NOTED:
    LPRE=LOG(F)
            X
 THE CHARACTERS IN ERROR ARE: (
 202  FORTRAN SYNTAX IS INCORRECT OR INAPPROPRIATE IN THIS CONTEXT.

There is a bug listed for NMver 3 that lists error code 202, but it does not appear germane to my difficulty in ver5.  The program runs with no error message when I am not using the log-transformed DV.  I cannot find what the fault is in my code, and would greatly appreciate, as always, your inspection and advice.  I am running this on g77 with Wings for NONMEM 406.  Control file and data in csv follow.  (P.S.: I just got back from a few days off, so if it is an easy answer, my confusion was due to sun and dehydration.)
Thanks. Paul

$PROBLEM PR
 
$INPUT ID TIME AMT NL DV=LOG WGT SDS FSDS RCVR EVID

$DATA ..\PR6.CSV IGNORE=C
$SUBROUTINES ADVAN4


$PK
TVK=THETA(1); TYPICAL VALUE OF K
K=TVK*EXP(ETA(1))
TVV2=THETA(2)-FSDS*THETA(7); STEP FUNCTION EFFECT OF THETA(7)
V2=TVV2*EXP(ETA(2));      VC
K23=THETA(3);    CENTRAL=2,PERIPHERAL=3
K32=THETA(4);

KA1=THETA(5);   
KA2=THETA(6);   

TVKA=KA1+KA2*FSDS
KA=TVKA*EXP(ETA(3))

TVF2=1+SDS

F2=TVF2*EXP(ETA(4))

CL=V2*K
Q=V2*K23
AUC=AMT/CL
SC=V2


$ERROR
   EDV=EXP(DV)
   LPRE=LOG(F)
   WT=F
   IRES=F-EDV
   IWRE=IRES/WT

Y=LPRE+EPS(1)

$THETA  (0.001,0.06,.3);  K
$THETA  (.04,4,80);        V2
$THETA  (.001,0.06,1);    K23
$THETA  (.002,1.51,5);        K32
$THETA  (.001,.002,.01);            KA1
$THETA  (0.001,.1,100);          KA2
$THETA  (.00001,.5,5);    VSDS

$OMEGA  .13;        ETAK
$OMEGA  .225;       ETAV
$OMEGA   .2;        ETAKA
$OMEGA   .2;        ETAF


$SIGMA  .01;         SIG1

$ESTIMATION SIGDIGITS=3 MAXEVAL=9999 PRINT=10 POSTHOC NOABORT MSFO=PR81.msf


;DATA FILE PR6.CSV:

CID,TIME,AMT,CONC,DV,WGT,SDS,FSDS,RCVR,EVID
1,0,20,0.0001,-9.210340372,293,0,0,0,1
1,10,.,0.450835346,-0.796653093,293,0,0,0,0
1,20,.,0.474218331,-0.746087449,293,0,0,0,0
1,30,.,0.494363929,-0.704483335,293,0,0,0,0
1,60,.,0.590277778,-0.527162043,293,0,0,0,0
1,120,.,0.554716855,-0.589297467,293,0,0,0,0
1,180,.,0.494363929,-0.704483335,293,0,0,0,0
1,300,.,0.3687909,-0.997525462,293,0,0,0,0
2,0,20,0.0001,-9.210340372,293,0,0,0,1
2,10,.,0.454206924,-0.789202405,293,0,0,0,0
2,20,.,0.465931965,-0.763715653,293,0,0,0,0
2,30,.,0.517361111,-0.659014174,293,0,0,0,0
2,60,.,0.629025765,-0.463583061,293,0,0,0,0
2,120,.,0.543226651,-0.610228641,293,0,0,0,0
2,180,.,0.491059447,-0.711190085,293,0,0,0,0
2,300,.,0.327879,-1.115110641,293,0,0,0,0
3,0,20,0.0001,-9.210340372,295,0,0,0,1
3,10,.,0.525295223,-0.643794845,295,0,0,0,0
3,20,.,0.534822866,-0.625819678,295,0,0,0,0
3,30,.,0.549365942,-0.598990499,295,0,0,0,0
3,60,.,0.568454777,-0.564833517,295,0,0,0,0
3,120,.,0.511993425,-0.669443496,295,0,0,0,0
3,180,.,0.486664654,-0.720179989,295,0,0,0,0
3,300,.,0.3148957,-1.155513806,295,0,0,0,0
4,0,20,0.0001,-9.210340372,294,0,0,0,1
4,10,.,0.479938272,-0.734097783,294,0,0,0,0
4,20,.,0.650127483,-0.430586808,294,0,0,0,0
4,30,.,0.742351047,-0.297933039,294,0,0,0,0
4,60,.,0.749865808,-0.287861011,294,0,0,0,0
4,120,.,0.669249866,-0.401597797,294,0,0,0,0
4,180,.,0.5512,-0.595657559,294,0,0,0,0
4,300,.,0.404789786,-0.904387394,294,0,0,0,0
5,0,20,0.0001,-9.210340372,301,1,1,0,1
5,10,.,2.011423108,0.698842485,301,1,1,0,0
5,20,.,1.935050993,0.660133679,301,1,1,0,0
5,30,.,1.840596484,0.610089695,301,1,1,0,0
5,60,.,1.521168814,0.419478996,301,1,1,0,0
5,120,.,0.808541331,-0.212523481,301,1,1,0,0
5,180,.,0.648483629,-0.43311852,301,1,1,0,0
5,300,.,0.45677987,-0.783553689,301,1,1,0,0
6,0,20,0.0001,-9.210340372,303,1,1,0,1
6,10,.,1.257229603,0.228910572,303,1,1,0,0
6,20,.,1.244414251,0.218664938,303,1,1,0,0
6,30,.,1.216552603,0.196021124,303,1,1,0,0
6,60,.,1.111530462,0.10573786,303,1,1,0,0
6,120,.,0.68553744,-0.377552164,303,1,1,0,0
6,180,.,0.623725174,-0.472045434,303,1,1,0,0
6,300,.,0.38568967,-0.952722197,303,1,1,0,0
7,0,20,0.0001,-9.210340372,293,1,1,0,1
7,10,.,2.503119968,0.917537941,293,1,1,0,0
7,20,.,2.307232958,0.836048953,293,1,1,0,0
7,30,.,1.883034756,0.632884707,293,1,1,0,0
7,60,.,1.134645062,0.126319881,293,1,1,0,0
7,120,.,0.612587225,-0.490063939,293,1,1,0,0
7,180,.,0.523601047,-0.647025245,293,1,1,0,0
7,300,.,0.393456766,-0.932784088,293,1,1,0,0
8,0,20,0.0001,-9.210340372,302,1,1,0,1
8,10,.,2.235322732,0.804385617,302,1,1,0,0
8,20,.,2.164905395,0.772376663,302,1,1,0,0
8,30,.,1.654572598,0.503542727,302,1,1,0,0
8,60,.,1.509661836,0.411885676,302,1,1,0,0
8,120,.,0.863090446,-0.147235789,302,1,1,0,0
8,180,.,0.621645196,-0.475385773,302,1,1,0,0
8,300,.,0.378964,-0.970314065,302,1,1,0,0
_______________________________________________________

From: "Bhattaram, Atul" BhattaramA@cder.fda.gov
Subject: RE: [NMusers] 202 Fortran Error Message with LOG() 
Date:  Wed, June 22, 2005 6:06 pm

Hello Paul
 
The error message is due to DV=LOG in your control stream. I did run your
model and the model gives a floating error if you take replace DV=LOG by
DV in your control stream ($ INPUT). I think the floating error can be
resolved using the appropriate residual error model which will avoid LOG(0).
 
Venkatesh Atul Bhattaram 
Pharmacometrics 
DPE-1, OCPB 
CDER, FDA. 
_______________________________________________________

From: "Sam Liao" sliao@pharmaxresearch.com
Subject: Re: [NMusers] 202 Fortran Error Message with LOG() 
Date:  Wed, June 22, 2005 8:26 pm 

Hi Paul:
There is one more problem I found in your control file. Since the model 
used an additive error for the log-transformed data, WT should be 1 
instead of F.  It will cause an overfloat in your run.

Best regards,
Sam Liao
Pharmax Research
_______________________________________________________

From:  "Saik Urien" saik.urien@psl.ap-hop-paris.fr
Subject: Re: [NMusers] 202 Fortran Error Message with LOG() 
Date: Thu, June 23, 2005 9:01 am 

Paul
 
I have recently tried to fit LOG(DV) transformed values
this kind of coding was running well :

W = 1
LPR = F
LPRE=-3
IF (LPR.GT.0) LPRE=LOG(IPR) ; avoids LOG(<=0) errors
 
Y=LPRE+EPS(1)
 
Saik
_______________________________________________________

From: "Paul Hutson" prhutson@pharmacy.wisc.edu
Subject: Re: [NMusers] 202 Fortran Error Message with LOG() 
Date: Thu, June 23, 2005 1:02 pm 

My thanks to Atul, Sam and Saik for their suggestions.  Unfortunately,
even after correcting these errors in my code left over from non-transformed
fits, the 202 error occurs, with "THE CHARACTER IN ERROR ARE:" identified as
the first left parenthesis after the LOG, e.g.,  LOG"("   This is true even
for the $ERROR code suggested by Saik below.  Are there other suggestions?

Thanks
Paul
_______________________________________________________

From:  "Paul Hutson" prhutson@pharmacy.wisc.edu
Subject: Re: [NMusers] 202 Fortran Error Message with LOG()
Date: Thu, June 23, 2005 2:29 pm 

All:
Sam's suggestion was the fix.  The use of LOG as the DATA field name was
problematic.  When removed as Atul intended in his first note so that the
field for Log-transformed date is just "DV", the 202 error in the $ERROR
stream did not arise.  Thanks very much, and I'm sorry for the bother.

Paul
_______________________________________________________