View previous topic :: View next topic
|
Author |
Message |
rz061m
New User
Joined: 03 Mar 2006 Posts: 48 Location: Chennai
|
|
|
|
Hi,
I have 2 files as given below. I need to compare them based on the first 5 bytes and populate the output files using fields from both the file. Here both the files are 80 bytes in length and the File1 has duplicate in the Matching field.
How to get this in ICETOOL using SPLICE???
File 1:
12345 karthik
12345 karthik
23456 arun
34567 purushothaman
34567 purushothaman
File2:
12345 abc
23456 efg
34567 hij
Output file:
12345 karthik abc
12345 karthik abc
23456 arun efg
34567 purushothaman hij
34567 purushothaman hij
Thanks,
Karthik. P |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Please give the starting position, length and format of each relevant field.
Is the RECFM of the input files FB?
Also, run this job and show the //SYSOUT messages you receive, so I can see what level you're at:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DUMMY
//SYSIN DD *
OPTION COPY
/*
|
If you have the JOINKEYS PTF installed, it may be a better choice then SPLICE. |
|
Back to top |
|
|
rz061m
New User
Joined: 03 Mar 2006 Posts: 48 Location: Chennai
|
|
|
|
Hi Yager,
I verified few post and found the solution for this. I have posted below the code i used. Can you provide me the solution using JOINKEYS??
//IN1 DD *
12345 karthik
12345 karthik
23456 arun
34567 purushothaman
34567 purushothaman
//IN2 DD *
12345 abc
23456 efg
34567 hij
//OUT DD DSN=ABC.DEF,DISP=SHR
//T1 DD DSN=&&TEMP,MOD=(,PASS),.....
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//*
//TOOLIN DD * *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,05,CH) -
WITHALL WITH(1,20) WITH(79,1) USING(CTL3)
/*
//CTL1CNTL DD *
OUTREC OVERLAY(21:1,3,79:C'BB')
/*
//CTL2CNTL DD *
OUTREC OVERLAY(79:C'VV')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,INCLUDE=(2499,2,CH,EQ,C'VB'),
BUILD=(1,2500)
/* |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Your job doesn't make any sense. You're adding the ids (BB, VV) at 79-80, but then your INCLUDE operand has 2499.
If you would answer the questions in my previous post, I could show you how to do what you want correctly with ICETOOL and JOINKEYS.
It will also help if you'd learn to use ubb code tags so we could see what your data actually looks like. |
|
Back to top |
|
|
|