Please see the above record.. and search the input record, if found the word pepsi in the input record, then write the record until pepsi to the output file.
Record length is 100 and it is fixed.
I don't see SORTing requirement here. However, what if the word 'pepsi' occurs twice (or more than that) in the input record, do you want to select part of record until first occurrence? Also, what if the word 'pepsi' is not at all present in the input record?
I am not sure if below is exactly what you asked for but see if it works for you...If this is not what you want, please explain the rules in detail.