HP3000-L Archives

September 1998, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
in the middle of the pack <[log in to unmask]>
Reply To:
in the middle of the pack <[log in to unmask]>
Date:
Sat, 12 Sep 1998 15:22:44 GMT
Content-Type:
text/plain
Parts/Attachments:
text/plain (96 lines)
Since it is an old program, it must have been working before.  Perhaps it
would be helpful if you told us more about what happened between when the
program was working and when you started getting this error.

-----------------------


My background was with HP3000 "Classic Architecture", MPE V.  I don't know
what you mean by "Fortran 66".  I worked with an HP variation of Fortran IV
(called Fortran 3000 in that environment), so some of what I am posting
here is out of date.  (There could also be small gaps in my memory.)

In your statement, the variable IFILE would represent a Fortran Logical
Unit number, from 1 to 99.  If the program has no explicit constant
references to the file numbers in FORTRAN I/O statements (READ, WRITE,
BACKSPACE, REWIND ...) for the values which IFILE, an entry for values
which IFILE is permitted must be contained in a FILE parameter of the
$CONTROL statement.   (Some programmers are in the habit of covering it
all, with something $CONTROL FILE=1-99 .  (A range of files is permitted.))

If an explicit FOPEN is lacking, Fortran Logical Unit numbers can be linked
to specific files using a command, something like:

FILE FTN01=MYDATA.ACCTSRECV,OLD;ACC=IN
FILE FTN13=YOURDATA.ACCTSPYB,NEW;REC=64,8,F,BINARY;ACC=OUT

(for example).

(FTN is followed by a 2 digit number from 01 to 99).

These commands are usually placed in the JCL file.  I've seen some programs
which contain the FILE commands in the program, and executed via the
COMMAND intrinsic.

It is also possible that the file is opened in a subroutine, possibly a
library routine.

The Fortran Logical Unit Table (FLUT) links the FORTRAN unit number (from 1
to 99) with the MPE file number.  The FLUT can be bypassed, in your
example, if IFILE is negative.

   SYSTEM INTRINSIC  FOPEN

   IFILE = FOPEN ("EMPMASTER ", %2001L, %5L)
   IF (IFILE .EQ. 0) CALL OPENFAILED
   IFILE = - IFILE

The I in your example represents a request to read a specific record.  (To
read the first record, I would be 1.)

I'm at a loss to explain the "unformatted I/O" error.  FORTRAN does have
FORMAT statements, which may be optionally referred to in READ or WRITE
statements.  When a READ or WRITE does not reference a FORMAT statement, it
is said to be an "unformatted" read or write (also called a "binary" read
or write).   But, I am unfamiliar with what "formatted file" might be in
this context.  (A cartridge tape unit might have to be preformatted before
it could be used.)

You can get more information by temporarily adding the following to the
program, as debugging aids:

INTEGER*2  FNUM
....
then, just before the READ:

DISPLAY IFILE, I, FNUM (I)

You can also use the FFILEINFO or FGETINFO intrinsics.  To specify the file
number parameters, use FNUM(IFILE) if IFILE is from 1 to 99; or use
   - IFILE if IFILE is < 0.

It is also possible to trap the error yourself:

READ (IFILE @ I, END = xxx, ERR = yyy) KEYS

where 'xxx' and 'yyy' represent some statement labels.  There you can call
"FCHECK" and other system intrinsics to handle the errors yourself.

--
To avoid SPAM, the attached e-mail address is false.
-----------------------
Ron Horner <[log in to unmask]> wrote in article
<[log in to unmask]>...
> I know that not one programs in Fortran 66 anymore.  This is one of those
> updating the old program issues.  I'm looking at a read instruction that
> has this construct:
>
>      READ (IFILE@I) KEYS
>
> It seems that this is causing an i/o error 903: unformatted i/o attempted
> on formatted file.  I didn't see any open statements in the code, either.
>
> Help!!!
>
>

ATOM RSS1 RSS2