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
 

 

Match records and merge two files using ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Match records and merge two files using ICETOOL
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    Post subject:
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    Post subject: Reply to: Match records and merge two files using ICETOOL
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 Moderator


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

PostPosted: Tue Dec 15, 2009 4:24 am    Post subject:
Reply with quote

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

http://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    Post subject: Re: Reply to: Match records and merge two files using ICETOO
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    Post subject:
Reply with quote

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

Site Director


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

PostPosted: Tue Dec 15, 2009 11:05 pm    Post subject:
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    Post subject: Reply to: Match records and merge two files using ICETOOL
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    Post subject: Reply to: Match records and merge two files using ICETOOL
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

Site Director


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

PostPosted: Wed Dec 16, 2009 8:25 pm    Post subject:
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    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 Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm


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