using syncsort (1.3.2.1R), i would like to merge data from record type 2 with records type 5, which follows the type 2 record.
need to use data from type 2 record to be included for each type 5 record until the next type 2 record is encountered.
a record is created for every type 5 record.
sample input data follows:
2PGMRKPKKX C+XKF KKKKKKKKK+PP{
5:<:<G:<PQ-QQ2<<2 :<:<KXK::2222QK2<G2KXXKKQK-QKKKKKKKKKKP{
5:<:<G:<P<X2:QPXX :<:<KXK::2222QK2<G2KXXKKQK-QKKKKKKKK+PK{
2PGMRKPKKX LCXKF KKKKKKKKG<-QB
5:<:<G:<PXK-K+X<: :<:<KXK::2222::2<22KXXKKQ+XXKKKKKKKKG:K{
5:<:<G:<PXX2G<X:K :<:<KXK::2222::2<22KXXKKQ+XXKKKKKKKKG:K{
5:<:<G:<P22QQ<:-K :<:<KXK::2222::2<22KXXKKQ+XXKKKKKKKKG:K{
5:<:<G:<P2GG<X<GK :<:<KXK::2222::2<22KXXKKQ+XXKKKKKKKKP:QB
5:<:<G:<PGP:-:X+- :<:<KXK::2222::2<22KXXKKQ+XXKKKKKKKKG:K{
5:<:<G:<PG<KG+P-+ :<:<KXK::2222::2<22KXXKKQ+XXKKKKKKKKG:K{
5:<:<G:<PQQ--KQ:G :<:<KXK::2222::2<22KXXKKQ+XXKKKKKKKKG:K{
5:<:<G:<PQ-QQ2<<2 :<:<KXK::2222::2<22KXXKKQ+XXKKKKKKKKXPK{
5:<:<G:<PPXGQ<X+2 :<:<KXK::2222::2<22KXXKKQ+XXKKKKKKKKG:K{
5:<:<G:<P<XGKG<:K :<:<KXK::2222::2<22KXXKKQ+XXKKKKKKKKG:K{
2PGMRKPKKX LCPKF KKKKKKKKKG:K{
5:<:<G:<PG<<<XP:2 :<:<KXK::2222::2<22KXXKKQ+XXKKKKKKKKG:K{
2PGMRKPKKX LC+KF KKKKKKKKKPKK{
5:<:<G:<P2KK::PKK :<:<KXK::2222::2<22KXXKKQ+XXKKKKKKKKPKK{
2PGMRKPKKX OL+KF KKKKKKKKKXGK{
5:<:<G:<PQ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