[comp.lang.fortran] Amdahl compiler - DEFINE FILE ?

KXM@PSUVM.BITNET (Kevin M. Morooney) (01/04/89)

I recently inherited some code which contains the following statements:

                DEFINE FILE 20(6, 2,E,J1)
                DEFINE FILE  8(9,12,E,J8)
                DEFINE FILE 19(9, 8,E,J4)

Correspondingly, there are these kinds of read/writes:

                WRITE(20'1, 1001)
                READ(19'3, 985)

I can make some guesses as to what is going on but I'd like to be sure.
I'm told the code was running on an Amdahl and I'm trying to get it up
on an IBM.  Any insight someone may have would be greatly appreciated.

Kevin Morooney
kxm@psuvm.psu.edu

johnl@ima.ima.isc.com (John R. Levine) (01/05/89)

In article <66377KXM@PSUVM> KXM@PSUVM.BITNET (Kevin M. Morooney) writes:
>I recently inherited some code which contains the following statements:
>                DEFINE FILE 20(6, 2,E,J1)
>
>                WRITE(20'1, 1001)

I haven't seen a define file since I was programming an 1130 over 20 years
ago.  The statement made it into IBM 360 Fortran by 1968, the date of the
manual I have, and is probably still there.  Anyway, here's what your
statements mean:

	20 - I/O unit number
	6  - number of records in the file
	2  - record size
	E  - format code, see below
	J1 - "associated variable" which after each READ, WRITE, or FIND
		contains the record number of the next record in the file

The format codes are E meaning that only formatted reads and writes are
allowed and the record size is given in bytes, L meaning that either
formatted or unformatted I/O is allowed and the record length is given
in bytes, and U meaning that only unformatted I/O is allowed and the record
length is given in words.  The define file statement is executable even though
all of the numbers must be integer constants and must be executed before
performing any I/O to the file.

In read and write statements, the record number to read or write is written
after the I/O unit number separated by an apostrophe.  The record number
can be an expression.  There is also a "find" statement:

	FIND(unit'recno)

which gives the system a hint about the next record number you expect to read.

-- 
John R. Levine, Segue Software, POB 349, Cambridge MA 02238, +1 617 492 3869
{ bbn | spdcc | decvax | harvard | yale }!ima!johnl, Levine@YALE.something
You're never too old to have a happy childhood.