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

Need help to compare two files


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

New User


Joined: 31 Oct 2008
Posts: 35
Location: CANADA

PostPosted: Mon Jul 06, 2009 6:54 pm
Reply with quote

Hi,
I have two files. File1 is FB PS file and LRECL is 250 and File2 is also FB PS file and LRECL is 200.
The key value in file1 and file2 are placed in first 16 bytes (i.e. from column 1 to 16 and the type is 9(16)).
I want to compare file1 key with file2 key, if the key matches and if 20th position of file2 value is value “ ” i.e. blank then only file1 record should be written in output file.

Note: In output file I need only first 50,000 matching records.
Back to top
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Mon Jul 06, 2009 7:00 pm
Reply with quote

Did you write a cobol program....

search previous topic before posting.
ibmmainframes.com/viewtopic.php?t=41702&highlight=
Back to top
View user's profile Send private message
jaganmoni1

New User


Joined: 31 Oct 2008
Posts: 35
Location: CANADA

PostPosted: Mon Jul 06, 2009 7:02 pm
Reply with quote

Hi,

I am looking for solution with ICETOOL
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Jul 06, 2009 7:02 pm
Reply with quote

Quote:
if the key matches and if 20th position of file2 value is value “ ” i.e. blank then only file1 record should be written in output file.

And if pos 20 file 2 is not equal " " - what happens then

Can there be duplicate key values in either of the files.
Back to top
View user's profile Send private message
jaganmoni1

New User


Joined: 31 Oct 2008
Posts: 35
Location: CANADA

PostPosted: Mon Jul 06, 2009 7:06 pm
Reply with quote

Hi,

If not blank- Ignore the record even key matches.

There is no duplicate keys in any of the files.
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: Mon Jul 06, 2009 10:13 pm
Reply with quote

If I understand correctly what you want, then this DFSORT/ICETOOL job should do it:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/250)
//IN2 DD DSN=...  input file2 (FB/200)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/250)
//TOOLIN DD *
COPY FROM(IN1) TO(T1)
COPY FROM(IN2) TO(T1) USING(CTL1)
SELECT FROM(T1) TO(OUT) ON(1,16,CH) FIRSTDUP USING(CTL2)
/*
//CTL1CNTL DD *
  OMIT COND=(20,1,CH,NE,C' ')
  INREC OVERLAY=(250:X)
/*
//CTL2CNTL DD *
  OUTFIL FNAMES=OUT,ENDREC=50000
/*
Back to top
View user's profile Send private message
jaganmoni1

New User


Joined: 31 Oct 2008
Posts: 35
Location: CANADA

PostPosted: Tue Jul 07, 2009 5:21 pm
Reply with quote

Hi Frank,
Its working fine... Thanks a lot for your quick response
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 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 Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top