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

To compare two datasets of different length


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

New User


Joined: 07 Jan 2006
Posts: 4

PostPosted: Wed Jan 25, 2006 8:08 am
Reply with quote

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
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Wed Jan 25, 2006 2:00 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Jan 25, 2006 9:49 pm
Reply with quote

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
View user's profile Send private message
ayswaryah

New User


Joined: 07 Jan 2006
Posts: 4

PostPosted: Fri Jan 27, 2006 1:39 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Fri Jan 27, 2006 10:04 pm
Reply with quote

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
View user's profile Send private message
ayswaryah

New User


Joined: 07 Jan 2006
Posts: 4

PostPosted: Sat Jan 28, 2006 9:16 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Sat Jan 28, 2006 9:26 pm
Reply with quote

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
View user's profile Send private message
ayswaryah

New User


Joined: 07 Jan 2006
Posts: 4

PostPosted: Mon Jan 30, 2006 5:41 pm
Reply with quote

Hi all,

Thanks a lot for your valuable help.
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Compare two files with a key and writ... SYNCSORT 3
Search our Forums:

Back to Top