Merge records using SPLICE
Posted: Mon Mar 11, 2013 8:11 pm
Hi,
I am trying to merge two recs from the same input file using SPLICE. My input is:
and my expected out put is:
but the output is coming as
My code is :
I am using this ICETOOL first time.. so cannot identify where is the issue here in this code..
Billy.. I checked your link as well..
dfsort-icetool-icegener/topic7483.html#p34164
and got what needs to be done.. but still its not working..
Can you please suggest me on this..
I am trying to merge two recs from the same input file using SPLICE. My input is:
9 WXXX-BAA-ID GROUP 3 1 19 19
12 WXXX-UAA-BAA-ID GROUP 4 1 19 19
15 WXXX-EAAAA-ID GROUP 5 1 16 16
18 WXXX-EAAAA-FAAA-IAAAAA 0001 0001
X(8) 6 1 8 8 0001 0002
18 WXXX-EAAAA-RAA-SAA-NAA 0002 0001
9(8) 7 9 16 8 0002 0002
15 WXXX-BAA-SAA-NAA S9(4) 8 17 19 3
12 WXXX-UAA-BAA-ID GROUP 4 1 19 19
15 WXXX-EAAAA-ID GROUP 5 1 16 16
18 WXXX-EAAAA-FAAA-IAAAAA 0001 0001
X(8) 6 1 8 8 0001 0002
18 WXXX-EAAAA-RAA-SAA-NAA 0002 0001
9(8) 7 9 16 8 0002 0002
15 WXXX-BAA-SAA-NAA S9(4) 8 17 19 3
and my expected out put is:
9 WXXX-BAA-ID GROUP 3 1 19 19
12 WXXX-UAA-BAA-ID GROUP 4 1 19 19
15 WXXX-EAAAA-ID GROUP 5 1 16 16
18 WXXX-EAAAA-FAAA-IAAAAA X(8) 6 1 8 8
18 WXXX-EAAAA-RAA-SAA-NAA 9(8) 7 9 16 8
15 WXXX-BAA-SAA-NAA S9(4) 8 17 19 3
12 WXXX-UAA-BAA-ID GROUP 4 1 19 19
15 WXXX-EAAAA-ID GROUP 5 1 16 16
18 WXXX-EAAAA-FAAA-IAAAAA X(8) 6 1 8 8
18 WXXX-EAAAA-RAA-SAA-NAA 9(8) 7 9 16 8
15 WXXX-BAA-SAA-NAA S9(4) 8 17 19 3
but the output is coming as
9 WXXX-BAA-ID GROUP 3 1 19 19
12 WXXX-UAA-BAA-ID GROUP 4 1 19 19
15 WXXX-EAAAA-ID GROUP 5 1 16 16
X(8) 6 1 8 8
9(8) 7 9 16 8
12 WXXX-UAA-BAA-ID GROUP 4 1 19 19
15 WXXX-EAAAA-ID GROUP 5 1 16 16
X(8) 6 1 8 8
9(8) 7 9 16 8
My code is :
//STEP003 EXEC PGM=ICETOOL
//INDD DD DISP=SHR,DSN=&&TEMP02
//OUTDD DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//TOOLIN DD *
SPLICE FROM(INDD) TO(OUTDD) ON(81,4,CH) WITHALL KEEPNODUPS -
WITH(1,39) WITH(40,40) USING(CTL1)
//CTL1CNTL DD *
OPTION COPY
INREC IFTHEN=(WHEN=(86,4,ZD,EQ,0001),OVERLAY=(01:01,39)),
IFTHEN=(WHEN=(86,4,ZD,EQ,0002),OVERLAY=(40:40,39))
OUTFIL BUILD=(1:1,39,40:40,40)
/*
//INDD DD DISP=SHR,DSN=&&TEMP02
//OUTDD DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//TOOLIN DD *
SPLICE FROM(INDD) TO(OUTDD) ON(81,4,CH) WITHALL KEEPNODUPS -
WITH(1,39) WITH(40,40) USING(CTL1)
//CTL1CNTL DD *
OPTION COPY
INREC IFTHEN=(WHEN=(86,4,ZD,EQ,0001),OVERLAY=(01:01,39)),
IFTHEN=(WHEN=(86,4,ZD,EQ,0002),OVERLAY=(40:40,39))
OUTFIL BUILD=(1:1,39,40:40,40)
/*
I am using this ICETOOL first time.. so cannot identify where is the issue here in this code..
Billy.. I checked your link as well..
dfsort-icetool-icegener/topic7483.html#p34164
and got what needs to be done.. but still its not working..
Can you please suggest me on this..