With IFTHEN=WHEN I could achieve the below output easiy.
Sort Card:
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'A'),OVERLAY=(20:1,4))
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'A'),OVERLAY=(20:1,4))
Output:
ADDD ADDD
BBBB
ACCC ACCC
AAAA AAAA
DDDD
ACCC ACCC
BBBB
ACCC ACCC
AAAA AAAA
DDDD
ACCC ACCC
Input:
//SORTIN DD *
ADDD
BBBB
ACCC
AAAA
DDDD
ACCC
ADDD
BBBB
ACCC
AAAA
DDDD
ACCC
What would be the SORT card if I do not want to use IFTHEN=WHEN.
Thanks.