When I run this DFSORT job:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
AAAA BBBB CCCC H 123456 DDDD
AAAA BBBB CCCC B 456789 DDDD
AAAA BBBB CCCC O 741258 DDDD
EEEE FFFF GGGG H 111222 HHHH
EEEE FFFF GGGG B 111777 HHHH
UUUU YYYY QQQQ O 789456 ZZZZ
//OUT DD SYSOUT=*
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(1,14,CH) KEEPNODUPS WITHEACH -
WITH(23,6) WITH(30,6) USING(CTL1)
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=(16,1,CH,EQ,C'H'),
BUILD=(1,15,16:18,6,37:28,4,80:X)),
IFTHEN=(WHEN=(16,1,CH,EQ,C'B'),
BUILD=(1,15,23:18,6,37:28,4)),
IFTHEN=(WHEN=(16,1,CH,EQ,C'O'),
BUILD=(1,15,30:18,6,37:28,4))
I get the following output:
AAAA BBBB CCCC 123456 456789 741258 DDDD
EEEE FFFF GGGG 111222 111777 HHHH
UUUU YYYY QQQQ 789456 ZZZZ
This corresponds to the output you said you wanted:
AAAA BBBB CCCC 123456 456789 741258 DDDD
EEEE FFFF GGGG 111222 111777 <space>HHHH
UUUU YYYYY QQQQ<space><space>789456 ZZZZ
If you are getting a different output, then there's something different between your job and my job that you're not telling me about. Perhaps the positions and lengths of your fields are NOT what I think they are? If you look at my example, you'll see how I assumed the data looked in //IN. If it doesn't look that way, then you have to tell me exactly how it does look. If you have additional data that isn't getting the output you want, then you need to show me that additional data.
Also, it would help if you posted the complete JES log for your run so I can see what you're doing exactly.