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

Match records and merge two files using ICETOOL


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

New User


Joined: 12 Dec 2009
Posts: 3
Location: mumbai

PostPosted: Sun Dec 13, 2009 8:36 pm
Reply with quote

Hi All,

I have following requirement.

I have two files. File A (94 bytes , FB) and File B (188 bytes). These two files to be matched on key (80,15,ch,a), and then write the output with 94 bytes from File A and rest 94 bytes from File B (95:94). The output file would be of 188 bytes.

There are two matching records in file B wherein one matching record in file A. Hence Two records from file B should be written in output file with mathcing record from file A.

I tried 'join keys' function but it does not support in my system. Hence I looked at many example using Splice option to merge files. However Its giving me syntax error as key starts at 80.

Can someone help me out to get desired output with Splice option.

Thanks,
Smita Dalvi
Back to top
View user's profile Send private message
Senthilkumar k
Warnings : 1

New User


Joined: 07 May 2009
Posts: 51
Location: Chennai

PostPosted: Mon Dec 14, 2009 1:01 pm
Reply with quote

Please use search option in forum. I believe lot of examples are available for this.
Back to top
View user's profile Send private message
Lijo

New User


Joined: 24 Aug 2008
Posts: 41
Location: Cochin

PostPosted: Mon Dec 14, 2009 2:02 pm
Reply with quote

Please use this one:

Code:
S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=<FILEA>
//IN2 DD DSN=<FILEB>
//OUT12 DD DSN=<MATCH FILE>
//OUT1 DD DSN=<FILEA-FILEB>
//OUT2 DD DSN=<FILEB-FILEA>
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(5,5)),
//  DISP=(MOD,PASS)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT12) ON(80,15,CH) WITH(95,95) -
  WITHALL KEEPNODUPS USING(CTL3)
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(1,94,94X,189:C'11')
/*
//CTL2CNTL DD *
  OUTREC FIELDS=(1,188,189:C'22')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT12,INCLUDE=(189,2,CH,EQ,C'21'),OUTREC=(1,188)
  OUTFIL FNAMES=OUT1,INCLUDE=(189,2,CH,EQ,C'11'),OUTREC=(1,188)
  OUTFIL FNAMES=OUT2,INCLUDE=(189,2,CH,EQ,C'22'),OUTREC=(1,188)
/*
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: Tue Dec 15, 2009 4:24 am
Reply with quote

You need the Nov, 2009 PTF to use JOINKEYS in DFSORT. For details, see:

ibmmainframes.com//viewtopic.php?t=45147

Ask your System Programmer to install this PTF
Back to top
View user's profile Send private message
Smita Dalvi

New User


Joined: 12 Dec 2009
Posts: 3
Location: mumbai

PostPosted: Tue Dec 15, 2009 10:44 pm
Reply with quote

I tried this option. But it didnt give me desired output.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Dec 15, 2009 11:04 pm
Reply with quote

Show us the complete messages you are receiving.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Dec 15, 2009 11:05 pm
Reply with quote

Hello,

Quote:
I tried this option. But it didnt give me desired output.
Well, that certainly is unfortunate. . .

And that may be the best you will receive until you post something more useful than "it didn't work". . .

What happened? An abend, some error, partially correct output, completely incorrect output. . .?

Post some sample input and the exact output yuou want from that input. Post any info regarding the problem run.
Back to top
View user's profile Send private message
Smita Dalvi

New User


Joined: 12 Dec 2009
Posts: 3
Location: mumbai

PostPosted: Wed Dec 16, 2009 12:39 pm
Reply with quote

Sorry guys for not detailing the problem.

I am getting 3 records in matched output file from file A. However I want to write records from File B (all matched duplicate records).

Also the records are not appended with (95:94) bytes of matched record from file A.
Back to top
View user's profile Send private message
Lijo

New User


Joined: 24 Aug 2008
Posts: 41
Location: Cochin

PostPosted: Wed Dec 16, 2009 2:23 pm
Reply with quote

Have you used JCL provided above or JOINKEYS option? If its JOINKEYS, you need to post the JCL so that we can check it out.

If you've used above JCL,
Still you've not provided the input data and desired output data.

Quote:
I am getting 3 records in matched output file from file A.


You meant, you're getting 3 output records for each matched record between File A & B? How can we identify, how this records are coming without giving File A & B's data?

I would like to see the JCL used.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Dec 16, 2009 8:25 pm
Reply with quote

Hello,

Quote:
Sorry guys for not detailing the problem.
And you still have not.

What part of this was not clear?
Quote:
Post some sample input and the exact output you want from that input. Post any info regarding the problem run.

Post a small amount of the input used, the output wanted from that sample and the output that was actually written. Post the jcl and control statements.
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top