Hi,

I need to process a variable length record which is in [Length][Data][Length][Data].... format. Can someone please suggest a way to do it in Cobol. Example of data is:

X'00166B4B6B6B4B6B6B4B6B6B4B6B6B4B6B6B4B6B6B4B6B4B00216B4B6B6B4B6B6B4B6B6B4B6B6B4B6B6B4B6B6B4B6B.....

So, the basic theme is read the length which is X'16' = 22 then read 22 bytes of data, then length X'21' = 34, then read 34 bytes of data and so on.

It can be done easily in BAL, but wan't to have any suggestions to do it in COBOL.

I know, the data can be read using reference mod if, I can get to process length correctly. I am basically facing problem reading and converting the length part to decimal.

Thanks in Advance,

Anand.