How to Create VB file Using Varying Clause in COBOL

Here is a way to create VB files in COBOL using Varying clause.

VB Files in COBOL

FD  I-BACKUP-BILL-FILE
RECORDING MODE IS V
RECORD IS VARYING FROM 1 TO 14600 CHARACTERS
DEPENDING ON BP-REC-LENGTH.
01  I-BP-REC           PIC X(14600).
..

and, BP-REC-LENGTH can be defined as …..

01 BP-REC-LENGTH     PIC 9(4)  Value Zero Comp Sync.

For VB files the above code is simple and efficient.

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.