Friends -
I was recently asked these questions at a BankOfAmerica Interview. The difficulty-level of the questions was average, but they were slightly off-beat, so I fell for it.
1. You've got a Variable-Blocked File. The data-format in the file looks as shown in the snap-shot below. The Fields are separated by a De-limiter '&&'. Each field-length is different. The lady asked me, how would write a COBOL Program to process the data in this file, parse each record and load it into separate columns of a DB2 Table. I was not quite able to figure out, how to separate the fields of the record. The closest I came to was UNSTRING. I would like to ask, if there is another, definite way to process such VB-Records in COBOL?
2. You've got a large copy-book of Length = 1000 Bytes. You would like to know quickly, the name of the column and length(bytes) at Offset-Position = 800. How would you go about it?
I answered, that you'd have to use a software tool like FILEAID. Or, one may also see the Data Division Map, under the Compile Listing. However, she(the interviewer) didn't sound too happy. Is there any other short way to work and browse Copy-Books.
Thank you very much.