Error when opening a file in COBOL

Hello everyone,

I am experiecing an issue in my COBOL application.
My application produces an error when opening a file in COBOL.

This is the error:

There was an unsuccessful OPEN or CLOSE of file EINGABE in program -------- ath the relative location X'FFFFFFFFD0E14BB8'.  Neither FILE STATUS nor an ERROR declarative were specified. The status code was 90. From compile unit TQTEST01 at entry point TQTEST01 at statement 60 at compile unit
offset +000001F6 at entry offset +000001F6 at address 2F2001F6.       

This is my COBOL code:

IDENTIFICATION DIVISION.                                
PROGRAM-ID.     TQTEST01                                
ENVIRONMENT DIVISION.                                   
INPUT-OUTPUT SECTION.                                   
FILE-CONTROL.                                           
    SELECT INPUT-DATEI ASSIGN TO EINGABE                
    ORGANIZATION IS LINE SEQUENTIAL.                    
                                                         
DATA DIVISION.                                          
FILE SECTION.                                           
FD INPUT-DATEI.                                         
01 EINGELESENE-ZEILE PIC X(40).                         
                                                           
WORKING-STORAGE SECTION.                                
                                                        
01 BOERSENTABLE.                                        
  05 B-KENNUNGEN OCCURS 71 TIMES INDEXED BY B-IDX.      
    15 B-CODE PIC X(6).                                 
                                                        
01 IDX PIC 9(2).                                        
01 BOERSENCODE PIC X(6).                                
01 FORMATIERTE-ZEILE.                     
  05 SELEKTION-VOR-BOERSENCODE PIC X(33). 
  05 EINGELESENER-BOERSENCODE PIC X(7).   
                                          
01 BESTEHENDE-DATEI-EOF.                  
  05 BD-DATEISTATUS PIC X.                
   88 BD-EOF VALUE 'J'.                   
                                          
COPY LIBCOB.                              
                                          
PROCEDURE DIVISION.                       
                                          
STEUERLOGIK SECTION.                      
    PERFORM F001-INITIALISIERUNG-SECTION. 
    PERFORM F002-ABGLEICH-SECTION.        
    PERFORM F003-DATEI-SCHLIESSEN-SECTION.
    GOBACK.                               
STEUERLOGIK-EX.                           
     EXIT.                                
                                          
F001-INITIALISIERUNG-SECTION. 
DISPLAY "A".                  
OPEN INPUT INPUT-DATEI.       
DISPLAY "B".                  
DISPLAY "C".                  
MOVE '.....' TO B-CODE (1).
     CONTINUE.            
F001-INITIALISIERUNG-EXIT.
     EXIT.                
F002-ABGLEICH-SECTION.                           
      ....                               
      CONTINUE.                                   
 F002-ABGLEICH-SECTION-EXIT.                      
      EXIT.                                       
                                                  
 F003-DATEI-SCHLIESSEN-SECTION.                   
      CLOSE INPUT-DATEI.                          
      CONTINUE.                                   
 F003-DATEI-SCHLIESSEN-EXIT.                      
      EXIT.                                       

Kind Regards

Hi, here are a few suggestions

  1. Code a file status field in your select statement to check the status code after opening the file. It will tell exact reason why the file is not opening.

Also change the name of the file without a dash sign in it. . It’s not needed.

  1. If you are running the code on zos no need to put organization is line sequential.

  2. Instead You may like to add Recordimg mode is F
    And record contains 40 characters in the FD.

  3. The entire code is following the cobol 74 which is no more in use. Suggest follow cobol 85 norms to make your program more easier to understand and easy to debug.

  4. For example we don’t use stuffs like Goback , exit and or a period on every lines of cobol code. Full stop to be put only on the last line of the paragraph. Similarly you must not use full stops as scope terminators.

  5. also broadly display what’s the intent of this program. The objective is not documented.

Hope that helps.
Else contact me on
Prasaduday60@gmail.com
Happy to help

Kapitanuday