You can use a DFSORT/ICETOOL job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes. You'll need z/OS DFSORT PTF UK90013 (July, 2008) to use the WITHANY function. If you don't have this PTF, ask your System Programmer to install it.
I think you want to the current version of my system, right?
this is part of message:
BLOCKSET TECHNIQUE IN CONTROL
RECORD TYPE IS F - DATA STARTS IN POSITION 1
C5-K26318 C6-K90007 C7-K90000 C8-K23476 E9-K90007 C9-BASE E5-K31980
BLOCKSET COPY TECHNIQUE SELECTED
VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES A
- CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 13:05 ON WED FE
WITHANY takes the values in 12, 14 and 16 no matter where they are in any of the duplicate records so it does what you want.
WITHEACH takes the value in 14 from the second duplicate record and the value in 16 from the third duplicate record. With a blank in 14 of every duplicate, you get a blank for the second value. We would have to do more coding to ensure that if 14 has all blanks, 16 is the second record.
WITHANY is much better for this kind of thing (that's why I added it to DFSORT). Ask your System Programmer to install z/OS DFSORT V1R5 PTF UK90013 (July, 2008) so you can use WITHANY. The PTF is free.