I have a work file record I am trying to read. It is a variable length record archive of a database file over several years, so it cannot be loaded back in to Adabas easily. It contains 4 fixed fields: field1, field2, field3, field4 and 2 mu fields (field 5 p9(1:50) and field6 a4(1:50)). I’m having difficulty reading the record properly. I mostly get invalid data for numeric input field. There are no delimiters in the record. I can see a 1 byte mu-count fields in the dump of the file for field5 and field6
How do I read this as a variable length work file please. thank you
Kevin
Assuming field1 to field4 are fixed length and you don’t run into a shifted data issue here
right away you will do so as soon as field5 does not come with all 50 elements.
You will have to define the record as an array of B1 fields, “parse” the record,
find out how many field5 elements there are, move them to an array of P9
fields in the correct length and use that instead of the data out of the work file
record directly.
Then go on parsing as, assuming the record comes compressed, the field6 MU will
immediately follow field5, etc.
The format sounds like the output of the Adabas decompression routine. You should be able to read the file with the Adabas compression utility and load the resulting file with the Adabas load utility into a database file.
If this is an unload created with ADAULD then using ADACMP DECOMPRESS with that
unload file as the input to create a fixed length record (using the FORMAT option)
may be the easier route.