IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

2 file compare and o/p file with fields from both files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rz061m

New User


Joined: 03 Mar 2006
Posts: 48
Location: Chennai

PostPosted: Fri May 21, 2010 6:46 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri May 21, 2010 10:51 pm
Reply with quote

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
View user's profile Send private message
rz061m

New User


Joined: 03 Mar 2006
Posts: 48
Location: Chennai

PostPosted: Sat May 22, 2010 12:10 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat May 22, 2010 1:14 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top