Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Sep 03, 2007 3:33 pm Post subject:
tempuser,
Try this untested DFSORT/ICETOOL code.
Code:
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
1
----+----1----+----2----+----3
A B C D
B B C D
2
C D G G
E F K R
G H L M
//OUT DD SYSOUT=*
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(89,8,CH) WITH(01,80) WITHALL -
USING(CTL1)
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:1,8,89:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(1,1,CH,EQ,C' '),
OVERLAY=(97:SEQNUM,8,ZD,
89:89,8,ZD,SUB,97,8,ZD,M11,LENGTH=8)),
IFTHEN=(WHEN=NONE,
OVERLAY=(89:SEQNUM,8,ZD))
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Sep 04, 2008 7:09 pm Post subject:
You can do this kind of thing more easily and efficiently with the new WHEN=GROUP function of DFSORT available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this:
Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1
A B C D
B B C D
2
C D G G
E F K R
G H L M
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,NE,C' '),
PUSH=(1:1,1))
OUTFIL OMIT=(15,1,CH,EQ,C' '),
BUILD=(1,19,/,1,14,23,5)
/*
For complete details on the WHEN=GROUP function and the other new functions available with PTF UK90013, see:
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum