Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: 2 file compare and o/p file with fields from both files
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 Moderator


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

PostPosted: Fri May 21, 2010 10:51 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Sat May 22, 2010 1:14 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us