I have a file with RECFM=FB, LRECL=26. The sample records are below.
ACCWTBT-DBACC001-X2ACCXRH-
ACCWTBT-DBACC001-X3ACCCRE-
ACCWTBT-DBACC001-X3ACCCRF-
ACCWTBT-DBACC001-X4ACCCRF-
ADPWTBT-DBADP001-TSADPCIP-
ADPWTBT-DBADP001-TSADPPNA-
ADPWTBT-DBADP001-X1ADPPNA-
AECWTBT-DBAECPRD-TSAECACB-
AECWTBT-DBAECPRD-TSAECCDC-
AECWTBT-DBAECPRD-TSAECCDS-
AECWTBT-DBAECPRD-TSAECCRF-
I have to look at the first seven bytes of the input file and then add a string at the end of the record after 26 bytes. In this example, lets say I need to add RWACC001 for the first 4 records as they have ACCWTBT as the first 7 bytes. Then the first 7 bytes changes to ADPWTBT. Hence the value at 27 position from 5th record has to be added as RWADP001 till 7th record. After that the value to be added is RWACE001. Can someone help me with a sort card for the same?
Expected output
ACCWTBT-DBACC001-X2ACCXRH-RWACC001
ACCWTBT-DBACC001-X3ACCCRE-RWACC001
ACCWTBT-DBACC001-X3ACCCRF-RWACC001
ACCWTBT-DBACC001-X4ACCCRF-RWACC001
ADPWTBT-DBADP001-TSADPCIP-RWADP001
ADPWTBT-DBADP001-TSADPPNA-RWADP001
ADPWTBT-DBADP001-X1ADPPNA-RWADP001
AECWTBT-DBAECPRD-TSAECACB-RWAEC001
AECWTBT-DBAECPRD-TSAECCDC-RWAEC001
AECWTBT-DBAECPRD-TSAECCDS-RWAEC001
AECWTBT-DBAECPRD-TSAECCRF-RWAEC001
Thanks
Prasanna G.