In the only example of records with multiple order numbers, you show them as already sorted descending by date and time so the indicator you want would be in the first record with that key. Is that always the case or can the indicator you want NOT be in the first record with a key. For example, could you have:
1702272089 10/26/2009 12:10:36 456664552 D
1702272089 10/26/2009 11:10:36 456664652 B
1702272089 10/26/2009 13:10:36 456664554 B
so the last record is the one you want the indicator from? If you can have a set of records like this, what would you expect for the output records?
Also, what is the RECFM and LRECL of the input file, and what is the starting position, length and format of each input field?
I want to take only the latest information keyed in for an ordernum. hence I am taking the decision in the latest record.
I Need to do a sort on the order num Asc and order time desc, which will make sure that I ll get the latest business decsion on top. It wud be great if I can combine this sort also into the solution. In, simple, I need the latest Decsion( B or D) for an ordernnum, nomatter how many items are there under that ordernum! and this needs to be propagated to all items under that ordernum.