A number of interesting emails have been sent on this issue. 
The most interesting appears to have been sent only to me, so I will
copy it to all of you.
Erik is correct. The characters are read before the EOF condition
occurs.
I have tested this in the two platforms that I used for the original
test. 
I believe I can fix NMTRAN, at the points where it reads the control 
stream and data file, in a manner similar to what Eric suggests. 
Until the fix can be distributed, which may be some time if it is
non-trivial,
please use one of the workarounds that have been suggested, or just be 
careful that the last line of the control stream
and data file ends with a cr-lf.
Thank you all!!

On Wed, 23 May 2007 14:01:11 +0200, "Olofsen, E. (ANST)"
<[EMAIL PROTECTED]> said:
> Dear Alison,
> 
> I think the text is being read, even though an end-of-file (eof)
> condition occurs, but it is not printed. With
> 
>       program read 
>       character*10 text 
>       read (5,55,iostat=ios) text 
>       print *,text 
>       print *,ios
>    55 format (A10)  
>       stop
>       end
> 
> it is possible to use text and check later for an eof condition.
> 
> Could this be a solution?
> 
> Best regards,
> 
> Erik
> 
> 
> On Tue, 2007-05-22 at 14:41 -0700, Alison Boeckmann wrote:
> > This is not a bug in NM-TRAN. But I can see how it happens in
> > MS-DOS. Both wordpad and notepad (unlike ms-dos edit and unix vi) will
> > write a file whose last line does not terminate with cr/lf. Such a line
> > is invisible to the Fortran I/O libraries that are part of g77
> > (in the MS-DOS environment) and FORTRAN 77 5.0 (in the Solaris
> > environment).
> > 
> > I tested this in both MS-DOS and Solaris with a little fortran program
> > that branches to statement 10 when an end of file condition occurs.
> > 
> > 
> >       program read 
> >       character*10 text 
> >       read (5,55,end=10) text 
> >       print *,text 
> >    55 format (A10)  
> >       stop 
> >    10 print *,'nothing read' 
> >       end
> > 
> > I created a file named infile containing only "1234567890" with no cr/lf
> > using notepad. I copied it to Solaris using ftp. In both environments,
> > when the program is run with infile as input, it produces
> > the output "nothing read". E.g., in Solaris, 
> > 
> > % f77 read.for
> > read.for: 
> > MAIN read: 
> > % a.out<infile 
> > nothing read
> > 
> > I don't know how to overcome this problem. Changing the format from A10
> > to (say)
> > A1 or * does not help. It seems to me it is a bug (or maybe a design
> > feature?) in the Fortran I/O library.
> > 
> > 
> > On Tue, 22 May 2007 12:56:18 -0700, "Mark Sale - Next Level Solutions"
> > <[EMAIL PROTECTED]> said:
> > > Navin,  If you're not getting the table file you expect, if may be
> > > because NMtran (5 at least) seems to have a small bug that it will
> > > sometimes ignore the last line of a control file if there isn't a
> > > carriage return/line feed at the end.  Try just hitting Enter after
> > > the $TABLE  record and saving. WRT plots, two options are Xpose from
> > > the Upsala group (R/Splus, http://xpose.sourceforge.net) or an excel
> > > macro from Next Level Solutions (www.nextlevelsolns.com)
> > >
> > >
> > >
> > > Mark Sale MD Next Level Solutions, LLC www.NextLevelSolns.com
> > >
> > >
> > > > -------- Original Message -------- Subject: RE: [NMusers] No Fit
> > > > file From: "Bachman, William (MYD)" <[EMAIL PROTECTED]> Date: Tue,
> > > > May 22, 2007 2:48 pm To: "navin goyal" <[EMAIL PROTECTED]>,
> > > > "nmusers" <[email protected]>
> > > >
> > > > according to your code, your run should have created a file named
> > > > "drug3.sdtab".  this file contains a table with these columns "ID
> > > > TIME AMT MDV DV EVID CMT"  and DV PRED RES WRES.  You can import
> > > > this file into Excel.  You will have to manually create the graphs
> > > > unless you have a macro that can do it.
> > > >
> > > > ________________________________
> > > >
> > > > From: [EMAIL PROTECTED] [mailto:owner-
> > > > [EMAIL PROTECTED] On Behalf Of navin goyal Sent: Tuesday, May
> > > > 22, 2007 2:20 PM To: nmusers Subject: [NMusers] No Fit file
> > > >
> > > >
> > > > Hello everybody, I am trying to run a control stream for my data
> > > > using NONMEM 6. I get the output file with the objective function
> > > > and other estimates. The problem is that I do not get the fit
> > > > file that can be opened in excel. I guess I am missing out
> > > > something in the control stream, but just cannot figure it out.
> > > > Any suggestions would be appreciated The last part in the control
> > > > stream is posted below
> > > >
> > > >
> > > > $ESTIMATION METHOD=1 MAXEVAL=9999 PRINT=5 POSTHOC $COVARIANCE
> > > >
> > > > $TABLE ID TIME AMT MDV DV EVID CMT NOPRINT ONEHEADER
> > > > FILE=drug3.sdtab
> > > >
> > > > thanks a lot
> > > >
> > > > Navin
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > ___________________________________________________________________-
> > > > ____________________________________________________________________
> > > >
> > > >
> > > >
> > > >
> > > > This e-mail transmission may contain confidential or legally
> > > > privileged information that is intended only for the individual or
> > > > entity named in the e-mail address. If you are not the intended
> > > > recipient, you are hereby notified that any disclosure, copying,
> > > > distribution, or reliance upon the contents of this e-mail is
> > > > strictly prohibited. If you have received this e-mail transmission
> > > > in error, please reply to the sender, so that ICON can arrange for
> > > > proper delivery, and then please delete the message.  Thank You.
> > >
-- 
  Alison Boeckmann
  [EMAIL PROTECTED]

Reply via email to