OK. Traditional way. SEQNUM for each record. On each record, further temporarily extend, with your unsequeezed message with the sequence number (use EDIT to get leading blanks, or test thoroughly with PREBLANK :-) ) and then SQZ. It's code and it's time.

There's an example by Arun Raj in the JCL part of the forum of editing the value on a TRAILER1.

Another way is a dummy trailer concatenated to your input. Again SEQNUM per reocrd. When the dummy trailer arrives, take the sequence, format the message and SQZ. Ditch the TRAILER1.

On the receiver, likely some *nix/*nux machine, possibily Windows something, if they already have code to take the filename and use the numeric as data, I really can't believe it is not the work of a moment to have that with leading zeros.