|
View previous topic :: View next topic
|
| Author |
Message |
bhanu_meeduri
New User
Joined: 03 Jul 2007 Posts: 3 Location: VA 23294
|
|
|
|
| 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 |
|
 |
bhanu_meeduri
New User
Joined: 03 Jul 2007 Posts: 3 Location: VA 23294
|
|
|
|
| Am I doing an efficient way? Is there any simplest way to do same? |
|
| Back to top |
|
 |
CICS Guy
Senior Member

Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
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 |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
bhanu_meeduri
New User
Joined: 03 Jul 2007 Posts: 3 Location: VA 23294
|
|
|
|
| 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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|