Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
482 views
in Technique[技术] by (71.8m points)

cobol - "RECORDING" WAS INVALID. A "RECORDING MODE" OF "V" WAS ASSUMED FOR FILE

Hi I have written a COBOL program where I am using a file, but while defining file definition it is giving me error, please tell me what to do.

       FILE-CONTROL.                
                                    
           SELECT CONTROL0-FILE     
                  ASSIGN TO CONTR.  
                                    
           SELECT APCO-FILE         
                  ASSIGN TO APCOOUT.
                                    
       FD  APCO-FILE.                                                  
I   A "RECORDING MODE" OF "V" WAS ASSUMED FOR FILE "APCO-FILE".   //ERR MSG        
           RECORDING MODE IS V                                         
S   "RECORDING" WAS INVALID.  SCANNING WAS RESUMED AT THE NEXT AREA "A" //ERR MSG
       ITEM, LEVEL-NUMBER, OR THE START OF THE                         //ERR MSG
           RECORD CONTAINS 30 TO 300                                   
           BLOCK CONTAINS 6152 CHARACTERS                              
           LABEL RECORDS STANDARD.                                     
                                                                       
       01  APCOIN-REC-1             PIC X(30).                         
       01  APCOIN-REC               PIC X(300).                        
question from:https://stackoverflow.com/questions/65626099/recording-was-invalid-a-recording-mode-of-v-was-assumed-for-file

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The problem is the . after APCO-FILE, it ends the file definition

       FD  APCO-FILE.                                                  
           RECORDING MODE IS V                                         
           RECORD CONTAINS 30 TO 300                                   
           BLOCK CONTAINS 6152 CHARACTERS                              
           LABEL RECORDS STANDARD.

Change to

       FD  APCO-FILE                                                  
           RECORDING MODE IS V                                         
           RECORD CONTAINS 30 TO 300                                   
           BLOCK CONTAINS 6152 CHARACTERS                              
           LABEL RECORDS STANDARD.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...