View previous topic :: View next topic
|
Author |
Message |
ayswaryah
New User
Joined: 07 Jan 2006 Posts: 4
|
|
|
|
Hi all,
Is there any jcl to compare two datasets of different record length based on a particular key. My output dataset should contain only records that match.
Thanks. |
|
Back to top |
|
|
MGIndaco
Active User
Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
|
|
If you have DfSort "package" with PTF of Dec 2004 you can
search in this forum to retrieve information about the wonderful
world created by Mr Yaeger & Co. that with the power of ICETOOL and
the SPLICE function allow you to avoid program to do compare.
Anyway you must know if your key is unique or not.
The problem of different length doesn't really matter because using
INREC and OUTREC you will able to reformat your layout every time.
Make a search and if you cannot find what you are looking for post here a sample(with detail of lrecl recfm etc.) and you will see that you will have a solution.
I hope in this. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Please post an example of the records in each input file showing the relevent fields, and the records you expect for output. If input file1 can have duplicates within it, show that in your example. Likewise for input file2. Also, what is the RECFM and LRECL of your input files. |
|
Back to top |
|
|
ayswaryah
New User
Joined: 07 Jan 2006 Posts: 4
|
|
|
|
Hi all,
Thanks for your reply.
My input file contains no dupilcate records.
File1
key field
01 2005-12-31 01800123456 ------------------
02 2005-12-31 09600234567 ------------------
03 2005-12-31 06400345678 ------------------
File2
01 bcdefghij 01800123456 ---------------------------------
02 jhfdkfkgfj 09600234567 ---------------------------------
02 jhfdkfkgfj 04560012567 ---------------------------------
Output file
01 2005-12-31 01800123456 ------------------
01 abcdefghij 01800123456 ---------------------------------
02 2005-12-31 09600234567 ------------------
02 djsjjsjdjhd 09600234567 ---------------------------------
Can you please help me in this?
Thanks. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Your output doesn't match your input! The second and fourth records of your output are not in either of your input files. Please correct your example. And also explain which fields you are actually comparing on. Is it fields 1 and 3 of the two input files or something else? And what is the RECFM and LRECL of each input file (this is the second time I've asked)? |
|
Back to top |
|
|
ayswaryah
New User
Joined: 07 Jan 2006 Posts: 4
|
|
|
|
Hi,
File1
01 2005-12-31 01800123456 ------------------
02 2005-12-31 09600234567 ------------------
03 2005-12-31 06400345678 ------------------
RECFM = FB
LRECL = 100
File2
01 bcdefghij 01800123456 ---------------------------------
02 jhfdkfkgfj 09600234567 ---------------------------------
02 jhfdkfkgfj 04560012567 ---------------------------------
RECFM= FB
LRECL=420
Output file
01 2005-12-31 01800123456 ------------------
01 bcdefghij 01800123456 ---------------------------------
02 2005-12-31 09600234567 ------------------
02 jhfdkfkgfj 09600234567 ---------------------------------
The input files are compared based on 3rd field.
Thanks. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Assuming the key starts in position 15 in both input files, here's a DFSORT/ICETOOL job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/100)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
// DD DSN=... input file2 (FB/420)
//OUT DD DSN=... output file (FB/420)
//TOOLIN DD *
* IN1->T1: Pad records to 420 bytes.
COPY FROM(IN1) TO(T1) USING(CTL1)
* T1/IN2->OUT: Select duplicates.
SELECT FROM(CON) TO(OUT) ON(15,11,CH) ALLDUPS
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1,100,420:X)
//
|
|
|
Back to top |
|
|
ayswaryah
New User
Joined: 07 Jan 2006 Posts: 4
|
|
|
|
Hi all,
Thanks a lot for your valuable help. |
|
Back to top |
|
|
|