Question

I am trying to figure out why my file definitions are incorrect. From what I can tell this is the same way that they were defined in my last program and all will be fixed block records

Code:

FILE-CONTROL.                                    
    SELECT INFILE1      ASSIGN TO UT-S-INPUT1.   
    SELECT INFILE2      ASSIGN TO UT-S-INPUT2.   
    SELECT OUTPUT-FILE1 ASSIGN TO UT-S-OUTPUT1.  
    SELECT OUTPUT-FILE2 ASSIGN TO UT-S-OUTPUT2.  
DATA DIVISION.                                   
FILE SECTION.                                    

FD INFILE1.                                      
       BLOCK CONTAINS 0 RECORDS                  
       RECORDING MODE IS F                       
       LABEL RECORDS ARE STANDARD.               
01 INF-LINE1.                                    
   05 STATE-1  PIC X(02).                        
   05 KEY-1    PIC X(10).                        
   05 TRANSID1 PIC X(10).                        
   05 FILLER   PIC X(58). 

FD INFILE2.                                 
       BLOCK CONTAINS 0 RECORDS             
       RECORDING MODE IS F                  
       LABEL RECORDS ARE STANDARD.          
01 INF-LINE2.                               
   05 KEY-2    PIC X(10).                   
   05 TRANSID2 PIC X(10).                   
   05 FILLER   PIC X(60).                   

FD OUTPUT-FILE1                             
       BLOCK CONTAINS 0 RECORDS             
       RECORDING MODE IS F                  
       LABEL RECORDS ARE STANDARD.          
01 OUTLINE1 PIC X(80).                      

FD OUTPUT-FILE2                             
       BLOCK CONTAINS 0 RECORDS             
       RECORDING MODE IS F                  
       LABEL RECORDS ARE STANDARD.          
01 OUTLINE2 PIC X(80).   

Error Code: Some of these error codes do not pertain to the file errors but I copied all of them and placed in this section.

 20  IGYGR1216-I   A "RECORDING MODE" of "F" was assumed for file "INFILE1".                                                     

 21  IGYDS1089-S   "BLOCK" was invalid.  Scanning was resumed at the next area "A" item, level-number, or the start of the next  
                   clause.                                                                                                       

                   Same message on line:     31                                                                                  

 30  IGYGR1216-I   A "RECORDING MODE" of "F" was assumed for file "INFILE2".                                                     

283  IGYPA3043-E   Data-item "INF-LINE1 (GROUP)" and record "INF-LINE1 (GROUP)" had overlapping storage.  Movement of data may   
                   not occur at execution time.                                                                                  

293  IGYPA3043-E   Data-item "INF-LINE2 (GROUP)" and record "INF-LINE2 (GROUP)" had overlapping storage.  Movement of data may   
                   not occur at execution time.                                                                                  

304  IGYPS2015-I   The paragraph or section prior to paragraph or section "X-COMP-FILE" did not contain any statements.          

321  IGYPS2121-S   "STUB4" was not defined as a data-name.  The statement was discarded.                                         
Was it helpful?

Solution

If you remove the period after the file name on our definition statement it should work without compiler errors.

Code:

FD INFILE1                                     
       BLOCK CONTAINS 0 RECORDS                  
       RECORDING MODE IS F                       
       LABEL RECORDS ARE STANDARD.               
01 INF-LINE1.                                    
   05 STATE-1  PIC X(02).                        
   05 KEY-1    PIC X(10).                        
   05 TRANSID1 PIC X(10).                        
   05 FILLER   PIC X(58). 

FD INFILE2                                 
       BLOCK CONTAINS 0 RECORDS             
       RECORDING MODE IS F                  
       LABEL RECORDS ARE STANDARD.          
01 INF-LINE2.                               
   05 KEY-2    PIC X(10).                   
   05 TRANSID2 PIC X(10).                   
   05 FILLER   PIC X(60).    

This is a common mistake that happens when you look at a green screen all day long. I would recompile this and see if the other errors go away. It is always a good idea to recompile a program and then start fresh. Do you print the compile listing to scan through every-now-and-then. I would I think. The compile listing gives you all of the memory locations and the size of each record. It is very handy.

Code:

    30  IGYGR1216-I   A "RECORDING MODE" of "F" was assumed for file "INFILE2". 

I am not certain on this error but I bet that you have the F a V for fixed block files. I would check this and if that is the case fix it. Do you start from scratch on programs or do you take a working program and then gut out what you do not need and then start working from that perspective. If this is the case you want to make certain that you have the recording mode set correctly for fixed block and variable block files.

     321  IGYPS2121-S   "STUB4" was not defined as a data-name.  The statement was discarded. 

The above error is simple that there is no working storage or variable named STUB4.

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top