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
 

 

Compare 2 files using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
nirmal.poikaikumaran

New User


Joined: 29 Nov 2005
Posts: 66
Location: Bangalore

PostPosted: Mon Feb 25, 2008 6:44 pm    Post subject: Compare 2 files using DFSORT
Reply with quote

need to compare two files.

Here is my requirement:
I have two input files
input 1: length 80
input 2: length 268

I need to compare the (1,8,ch) of both the files. The first 8 characters in both the file are the keys (file 2 has duplicates allowed). For those keys available in file 1 I need to find a match in file 2. If match (duplicates should be included) is found I need to write into 3rd file.

Regarding duplicates, there will be duplicates only in file 2. I "do not" want to ignore the duplicates, because each line of duplicate is worth important data.
Back to top
View user's profile Send private message

rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 188
Location: india

PostPosted: Mon Feb 25, 2008 7:58 pm    Post subject:
Reply with quote

hi,

You can use the following DFSORT/ICETOOL code:

Code:
//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=... input file1 (keys in 1-8)
//IN2 DD DSN=... input file2 (FB/268) - keys in 1-8
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB/268)
//TOOLIN DD *
  COPY FROM(IN1) TO(T1) USING(CTL1)
  COPY FROM(IN2) TO(T1) USING(CTL2)
  SPLICE FROM(T1) TO(T2) ON(1,8,CH) -
  WITHALL WITH(1,269) WITH(271,8) USING(CTL3)
  SORT FROM(T2) TO(OUT) USING(CTL4)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(269:C'BB',271:8X)
/*
//CTL2CNTL DD *
  INREC OVERLAY=(269:C'AA',271:SEQNUM,8,ZD)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=T2,INCLUDE=(269,2,CH,EQ,C'AB')
/*
//CTL4CNTL DD *
  SORT FIELDS=(271,8,ZD,A)
  OUTREC BUILD=(1,268)
/*
Back to top
View user's profile Send private message
AnjaniK

New User


Joined: 26 Feb 2008
Posts: 2
Location: Hyderabad

PostPosted: Tue Feb 26, 2008 7:13 pm    Post subject: how to write this same code using SORT
Reply with quote

How to write the same code using DFSORT?
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: Tue Feb 26, 2008 7:23 pm    Post subject: Re: how to write this same code using SORT
Reply with quote

AnjaniK wrote:
How to write the same code using DFSORT?
Why do you ask? DFSORT and ICETOOL are literally one and the same......
Back to top
View user's profile Send private message
nirmal.poikaikumaran

New User


Joined: 29 Nov 2005
Posts: 66
Location: Bangalore

PostPosted: Tue Feb 26, 2008 7:26 pm    Post subject:
Reply with quote

hi rajatbagga

Thanks a lot... it worked well icon_smile.gif

Thanks
Back to top
View user's profile Send private message
AnjaniK

New User


Joined: 26 Feb 2008
Posts: 2
Location: Hyderabad

PostPosted: Tue Feb 26, 2008 7:40 pm    Post subject: Re: how to write this same code using SORT
Reply with quote

CICS Guy wrote:
AnjaniK wrote:
How to write the same code using DFSORT?
Why do you ask? DFSORT and ICETOOL are literally one and the same......


Sorry for being naive here. You see, they may share the same architecture, though the syntax would be different, right? I just wanted similar syntax for SORT.
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: Tue Feb 26, 2008 10:01 pm    Post subject:
Reply with quote

ICETOOL has been part of DFSORT since 1991 and is fully documented and supported. The ICETOOL operators add functions to DFSORT that can't be performed with just the DFSORT control statements. The ICETOOL operators have their own syntax but use DFSORT control statements as well. So when you ask for "similar syntax for SORT", you're asking a meaningless question. The solution here is to use ICETOOL operators, not just DFSORT control statements.
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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm


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