Please login or register.

Login with username, password and session length
gfx gfx
1619 Posts in 535 Topics by 781 Members - Latest Member: chekyl43 January 27, 2023, 04:08:15 PM
gfx* Home | Help | Search | Login | Register | gfx
Absoft User Forum  |  Support  |  Windows  |  eof() function

Author Topic: eof() function  (Read 1823 times)


  • Newbie
  • *
  • Posts: 1
eof() function
« on: August 26, 2020, 06:34:00 PM »
I am trying to recompile an old mainframe program.  It uses EOF() function and it is giving me an error.  I need to see if there is an equivalent function.  This version may actually be an old UNIX port, I am not sure.

Here is the code section that is causing issues.  It is on line 10000 is where the compiler gives me an error.

      READ (35,880,END=10000) NSECT,NTLC                                         CDC451       652
880   FORMAT(BZ,/,2I5)                                                           CDC451       653
10000 IF (EOF(35)) 6,7,6                                                         CDC451       654
6     WRITE (6,5)                                                                CONVRT       129
    5 FORMAT(//,'** CONVRT FOUND NO DATA ON FILE INPTL **',//)                   CDC451       655
      CALL GOODBY('CONVRT')                                                      CDCMKRUN       2

The Error
The Conditional expression must be type integer, real or double precision


  • Administrator
  • Sr. Member
  • *****
  • Posts: 333
Re: eof() function
« Reply #1 on: August 27, 2020, 09:57:42 AM »
The EOF() function exists. It is a LOGICAL function returning .TRUE. if the specified unit number is in an end of file state and .FALSE. otherwise. The error is reported because the compiler requires that the expression in an arithmetic IF statement be of type INTEGER, REAL, or DOUBLE PRECISION.

A straight forward fix for the code you included is to replace the arithmetic IF statement with a logical IF statement: 

10000  IF ( EOF(35) ) THEN       
5             FORMAT(//,'** CONVRT FOUND NO DATA ON FILE INPTL **',//)
              CALL GOODBY('CONVRT')
       END IF

Absoft User Forum  |  Support  |  Windows  |  eof() function

gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!