SEQNUM creates & inserts sequence numbers in the output record. The sequence numbers are assigned in the order in which…