I forgot to remove some unnecessary stuff in step0100 as I was playing around to get everything done in a single step. But it is not possible to get everything done in single step, we can use the following job
Explanation of the control cards:
1.Sort the Timestamp field D and Bank name ascending
2.Now we have the max time stamp values at the top. we put a seqnum at pos 25 for every changing timestamp value using restart parm. We also put another seqnum at pos 33 for every changing bank name using the restart parm.
we use the seqnum at pos 25 to group the similar records of same timestamp with when=group statement. By doing this the max timestamp field records will have group id of 1 at pos 41 and these are the only records which we are interested in. so we write these records to another temp file named max rec which we will use in step0200 as input instead of spinning thru the entire file once again.
Now we create 3 symbols to get the records for the bank name in issued column. Pos33 which has the max seqnum will give you the bank name. So inorder to get the max record value we use reporting features and create 3 symbols.
TCNT will have the max value of a bank for that timestamp set.
STMP will have the max timestamp
Name will have the name of the bank that occurred max times in that set.
Now we use these symbols in step0200 which gives you the desired results