Problem writing a variable Length File (i.e. file has multiple records of different lengths:
i.e.
FILE-CONTROL.
SELECT Comp-File ASSIGN "./VbComp3.bin"
FILE STATUS IS TEST-STATUS.
DATA DIVISION.
FILE SECTION.
FD Comp-File.
01 header pic x(20).
01 Comp3Fields.
03 NumA pic --,---,---,---,---,--9.99.
03 sep0 pic x.
03 Num0 pic s99 comp-3.
03 sep1 pic x.
03 Num1 pic s9v99 comp-3.
03 sep2 pic x.
03 Num2 pic s9(02)v99 comp-3.
03 sep3 pic x.
03 Num3 pic s9(03)v99 comp-3.
03 sep4 pic x.
03 Num4 pic s9(04)v99 comp-3.
03 sep5 pic x.
03 Num5 pic s9(05)v99 comp-3.
03 sep6 pic x.
03 Num6 pic s9(06)v99 comp-3.
03 sep7 pic x.
----------------------------------------------------------------------------------------------------
I have written a lot of Cobol type IO Routines (IBM Mainframe, Fujitsu, Open Cobol) in java
so If you want some help let me know.
In the JRecord / Record-Editor Project's I have an AbstractByteReader / AbstractByteWriter class's.
The purpose of these classes is to Read / Write one logical line from the file as an array
of Bytes. I extend the Reader/Writer to provide a specific reader as required.
see http://record-editor.svn.sourceforge.net/viewvc/record-editor/Source/JRecord/src/net/sf/JRecord/ByteIO/
for all the readers/writes
For Example this class is used to read both Mainframe and open-Cobol VB files
For Mainframe new VbByteReader(false, true);
For Open Cobol new VbByteReader(false, false);
This class Writes Mainframe and Open Cobol VB Files
Mainframe new VbByteWriter();
Open Cobol VbByteWriter(false);
Example Program