Skip to main content

HOW TO WRITE FILE DESCRIPTOR IN COBOL FOR VARIABLE LENGTH FILE?

  • March 23, 2018
  • 1 reply
  • 0 views

I have a file with with a record format VB, the Record length is 225, Block size 27998 . How do I declare this file in my Program. I am getting file status code 39. Please tell me a correct FD definition for this.


#Mainframe
#COBOL
#EnterpriseDeveloper
#dataset
#MFED

1 reply

  • Author
  • Rocketeer
  • 19312 replies
  • March 28, 2018

I have a file with with a record format VB, the Record length is 225, Block size 27998 . How do I declare this file in my Program. I am getting file status code 39. Please tell me a correct FD definition for this.


#Mainframe
#COBOL
#EnterpriseDeveloper
#dataset
#MFED

What COBOL product and version are you using? On what platform?

You mention a block size, which suggests that you're working with mainframe data, or with data that was migrated from the mainframe. In MF COBOL you can specify the block size, but as the documentation states it's documentary - it has no effect.

The record size is specified in a file definition with the RECORD clause. This is quite straightforward.

It would help to know what you're doing (where did the file come from, for example?), and what you've already tried.