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

Fediverse reactions

Discover more from Srinimf

Subscribe now to keep reading and get access to the full archive.

Continue reading