Problem when reading the decompressed flat file of ADADCU

Hi,
i am facing some problem while reading the decompressed flat file generated through the ADADCU utility.

the flat file has some values of multivalue field.

the length of the multivalue fiedl in the DDM is A78. while reading this flat file in NATURAL program, the very first occurance value of the multi value field is read correctly. the other occureances of fields are assigned to the other columns.
eg:
following is the strucure of the DDM.

1 AE ORDER-NBR A 8 F D
1 AF ITEM-NBR A 16 N D
M 1 BB COMMENTS A 78 N
1 AY LAST-UPD-PGM-ID A 8 N
1 AZ LAST-UPD-DATE-TIME T 12 N
1 BA LAST-UPD-USER-ID A 8 N

the multivalue field in DDM is
M COMMENTS(a78)
the value of this multi value field is.
Testing of comments1
Testing of comments2
testing of comments3.

these three occurences are there in the flat file. but while reading the flat file, i can read the first occurance. but the other two occureances are assinged to other fields(LAST-UPD-PGM-ID,LAST-UPD-DATE-TIME and LAST-UPD-USER-ID) in the DDM.

I am using the following structure variable in my NAtural program.
1 #REL
2 DATA A253
R 2 DATA /* BEGIN REDEFINE: DATA
3 ORDER-NBR A8
3 ITEM-NBR A16
3 COMMENTS A79
3 LAST-UPD-PGM-ID A8
3 LAST-UPD-DATE-TIME T
3 LAST-UPD-USER-ID A8
so can you please guide me how to resolve this problem.
regards,
Jawahar.A

Did you use the ADADCU-parameter RECORD_STRUCTURE?

The ouput-file of ADADCU is not a classical workfile with fixed record length. This is because of the multiple values. IIRC there is a one byte occurance counter just before the multiple field.

Next Question: Did you use MUPE_OCCURRENCES?

i did not use RECORD_STRUCTURE or MUPE_OCCURENCES parameter in ADADCU.

i just specified the NODCUFDT parameter. without changing my decompression program, is there any way to resolve my problem?

If you didn’t use RECORD-STRUCTURE your “flat file” has the standard format “ELENGTH_PREFIX”. That means:

  1. There’s no classical New-line separator. So you can’t use the usual way of reading a workfile.
  2. Each record is prefixed by a two byte length counter (=Length of record in byte)
  3. Each multiple field is prefixed by a one byte length counter (=number of occurences)

At the moment, I’m not able to write you the whole code, but I can give you a few tips:

  1. Use the ADADCU-parameter MUPE_OCCURENCES to get the maximum occurences of the multiple-field.
  2. Use the ADADCU-parameter FIELDS and specify a range for the multiple field (from 1 to the maximum occurence). Now every record has the same length.
  3. Find out your record length.
  4. Define your workfile as ‘unformatted’ so you can read bytewise
  5. Read the file into a Byte-Field. The field length should be the record length.
  6. Now you can redefine your Byte-Field.