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

Compare 2 files using DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 199
Location: india

PostPosted: Mon Feb 25, 2008 7:58 pm
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
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: 2146
Location: At my coffee table

PostPosted: Tue Feb 26, 2008 7:23 pm
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
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
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 Developer


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

PostPosted: Tue Feb 26, 2008 10:01 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top