Thanks Michael for replying

Yes, I need to loop through each and every message inside the HL7 batch to do some batch validity check before splitting the message. I was also thinking to write a object script which will read the file line by line to do that validation. So , was checking how others have implemented the scenario where they have to process all the individual message