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

Find a One-to-many matching records using ICETOOL


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

New User


Joined: 03 Jul 2007
Posts: 3
Location: VA 23294

PostPosted: Sat Apr 10, 2010 6:27 pm
Reply with quote

Quote:
I have to find a One-to-many matching records and write matched and unmatched into two different files using ICETOOL

I wrote below program. Am I doing correct way?
Could you please anyone review the code and give your comments.
Code:
//STEP001  EXEC PGM=ICETOOL                           
//*--------------------------------------------------------------------*
//* Duplicate record key file size LRECL=83; NO OF RECORDS 270 MILLIONS
//* Key at (17,10,PD)
//*--------------------------------------------------------------------*
//DUPFILE  DD DSN=ABC.DUP.RECORDS,       
//            DCB=BUFNO=64,                           
//            DISP=SHR                                 
//*--------------------------------------------------------------------*
//* Unique record key file size LRECL=83; NO OF RECORDS 10 MILLIONS
//* Key at (17,10,PD)
//*--------------------------------------------------------------------*
//UNQFILE DD DSN=ABC.UNQ.RECORDS,       
//            DCB=BUFNO=64,                           
//            DISP=SHR                                 
//T1       DD DSN=&&T1,                               
//            DISP=(MOD,PASS,DELETE),                 
//            SPACE=(CYL,(500,500),RLSE),
//            DCB=(RECFM=FB,LRECL=85,BUFNO=64),       
//            DATACLAS=SEQEXT,                         
//            UNIT=PERMDA                             
//UNMATCH  DD DSN=ABC.UNMATCH.RECORDS,       
//            DISP=(NEW,CATLG,DELETE),                 
//            SPACE=(CYL,(500,500),RLSE),
//            DCB=(RECFM=FB,LRECL=83,BUFNO=64),       
//            DATACLAS=SEQEXT,                         
//            UNIT=PERMDA                             
//MATCH    DD DSN=ABC.MATCH.RECORDS,       
//            DISP=(NEW,CATLG,DELETE),                 
//            SPACE=(CYL,(500,500),RLSE),
//            DCB=(RECFM=FB,LRECL=83,BUFNO=64),       
//            DATACLAS=SEQEXT,                         
//            UNIT=PERMDA     
//SYSOUT   DD SYSOUT=*                                 
//SYSPRINT DD SYSOUT=*                                           
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//TOOLIN   DD *                                                 
//TOOLIN   DD *                                                 
COPY FROM(UNQFILE) TO(T1) USING(CTL1)                           
COPY FROM(DUPFILE) TO(T1) USING(CTL2)                           
SPLICE FROM(T1) TO(UNMATCH) ON(17,10,PD)         -             
   KEEPNODUPS KEEPBASE WITHALL WITH(1,83) WITH(84,1) USING(CTL3)
//CTL1CNTL DD *                                                 
  INREC OVERLAY=(84:C'BB')                                     
/*                                                             
//CTL2CNTL DD *                                                 
  INREC OVERLAY=(84:C'TT')                                     
/*                                                             
//CTL3CNTL DD *                                                 
  OUTFIL FNAMES=UNMATCH,INCLUDE=(84,2,CH,EQ,C'TT'),             
    BUILD=(1,83)                                               
  OUTFIL FNAMES=MATCH,INCLUDE=(84,2,CH,EQ,C'TB'),               
    BUILD=(1,83)                                               
/*                                                               
Back to top
View user's profile Send private message
bhanu_meeduri

New User


Joined: 03 Jul 2007
Posts: 3
Location: VA 23294

PostPosted: Sat Apr 10, 2010 8:49 pm
Reply with quote

Am I doing an efficient way? Is there any simplest way to do same?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sat Apr 10, 2010 8:57 pm
Reply with quote

Jeez, give it time.....
It's Saturday morning here in the US, not a work day and before breakfast.....
By the way, does it work?
How long does it take for how many records?
As far as I know, it looks fairly standard, do you have in mind other ways to do this?
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: Sun Apr 11, 2010 12:13 am
Reply with quote

Hello,

If your system is using the most current ptf for dfsort, suggest you look at JOINKEYS.

If you are not sure of the ptf level of your sort, run this and post the informational output including all message id's:
Code:
//SORTSTEP EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY
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: Mon Apr 12, 2010 10:43 pm
Reply with quote

bhanu_meeduri,

I question why you need KEEPBASE, but then you haven't really told us what your input records look like or what your expected output should look like so it's difficult to comment.

As Dick said, a DFSORT JOINKEYS job might be more efficient but we don't know if you have JOINKEYS available, or again what exactly you're trying to do.
Back to top
View user's profile Send private message
bhanu_meeduri

New User


Joined: 03 Jul 2007
Posts: 3
Location: VA 23294

PostPosted: Wed Apr 14, 2010 2:29 am
Reply with quote

Quote:
What exactly I am doing was just I want to find maching records; both file formats are same *LRECL=83;
One file having unique records and other file having duplicates records on Key position (17,10 PD).

Read the Driver file (unique key file) and find the mathings in 2nd file ( dup. key file) write matchings in one file and not matchings into another file

I am not clear when should I use KEEPNODUPS and KEEPBASE when should not. and also I am not sure combination of usage.

I read the SPLICE operator allows to use KEEPBASE option to keep the base records as well as the spliced records. but I am not clear when can be used and not.



We do not have latest PTFs in production region and also there is a variation between Test and Prod regions. So I am not using JOINKEY Operator
Code:

*---Test Region ---PTF Info.---*
ICE751I 0 C5-K90013 C6-K90013 C7-K90000 C8-K42135 E9-K90013 C9-BASE   E5-K44563 E7-K44563

*---Prodction Region--PTF Info.--*
ICE751I 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E4-K90007 C9-BASE   E5-K35433 E7-K24705
[/quote]
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: Wed Apr 14, 2010 3:31 am
Reply with quote

Looking at your job again, you probably need KEEPBASE because you have duplicates in file2 that aren't in file1.

Since you don't have the DFSORT PTF for JOINKEYS, your job is probably as efficient as it will get.

Note that DFSORT will ignore your BUFNO value - it does its own optimized buffering.

Code:

//TOOLIN   DD *                                                 
//TOOLIN   DD *   


I assume you really only have ONE TOOLIN DD and this is a copy/paste error.

Code:

WITH(1,83) WITH(84,1)


You could just use WITH(1,84) although I doubt that will make a difference for performance.
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 Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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 To find whether record count are true... DFSORT/ICETOOL 6
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
Search our Forums:

Back to Top