Good morning Mann_B,
That is a curious input file. I don't suppose there is any way as part of your task to make it a bit more normal, with only one "item" per physical record? It would make using it easier.
I think first if I do a bit of re-stating, you can tell me whether I got it, or where I went wrong.
You want to supply a file of requested fields to extract from your file. The request file is to indicate the item reference, the position of the field within the item, and the length of the field.
Since you don't mention trans-id, either all the trans-id are the same or item reference can appear in any trans id. It is not yet clear whether item reference always appears in the same places on the input record (ie all item reference data is the same length). If not, you'll need a method to "find" items.
Having found the item, you want to extract a field based on position (relative to start of item) and length. This is unusual, but it is your requirement. One problem you have is how to ensure the input data for the request is correct, otherwise you will end up with rubbish and, if you are unlucky, rubbish which looks OK,
Finally for now, you want to avoid reading the whole request file multiple times.
How many requests are you likely to process at once, as a maximum? If not too many, you can read your request file at one go, storing the data into a table in the cobol program. Then, process that table with each input record of your main file to find the data that you need. Your output file might not have the order you want, but it gives you a chance to put good information onto it and to sort it afterwards so that reading your output file is not such a huge job as extracting the data for it.
If you could "rationalise" your input file, you'll make your life much easier each time you use it.