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
 

 

Find a One-to-many matching records using ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Find a One-to-many matching records using ICETOOL
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Sat Apr 10, 2010 8:57 pm    Post subject:
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

Site Director


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

PostPosted: Sun Apr 11, 2010 12:13 am    Post subject:
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 Moderator


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

PostPosted: Mon Apr 12, 2010 10:43 pm    Post subject:
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    Post subject: Reply to: Find a One-to-many matching records using ICETOOL
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 Moderator


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

PostPosted: Wed Apr 14, 2010 3:31 am    Post subject:
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    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 find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts Group elements using ICETOOL Learncoholic DFSORT/ICETOOL 2 Fri Apr 14, 2017 11:01 am


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