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
 

 

To compare two datasets of different length

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: To compare two datasets of different length
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    Post subject:
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 Moderator


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

PostPosted: Wed Jan 25, 2006 9:49 pm    Post subject:
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    Post subject: Re: To compare two datasets of different length
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 Moderator


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

PostPosted: Fri Jan 27, 2006 10:04 pm    Post subject:
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    Post subject: Re: To compare two datasets of different length
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 Moderator


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

PostPosted: Sat Jan 28, 2006 9:26 pm    Post subject:
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    Post subject: Re: To compare two datasets of different length
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    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 member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Length of Tape file Mohan Kothakota JCL & VSAM 9 Thu Apr 20, 2017 10:24 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm


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