gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1514 Posts in 501 Topics by 731 Members - Latest Member: agoodcave September 25, 2020, 02:29:57 PM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  Windows  |  eof() function
gfx
gfxgfx
 

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

agoodcave

  • 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
    7 CONTINUE 

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

forumadmin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 304
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       
              WRITE(6,5)
5             FORMAT(//,'** CONVRT FOUND NO DATA ON FILE INPTL **',//)
              CALL GOODBY('CONVRT')
       END IF

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

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