An alternative solution is available for reference modification in COBOL. In reference modification, you can choose field length value up to your requirement. 

The disadvantage is other programmers does not know which field value you are moving. Since, from main string you are moving part of its value.

Example:myfield(2:1)

Alternative solution

You can use redefines in your Copy book with 88 Level fields with the fields you want in your program . This you can define in your COBOL copy book.

Then, directly you can use those fields in your program.

This question asked in COBOL screening test.

Advertisements