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
 

 

Need help to compare two files

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

New User


Joined: 31 Oct 2008
Posts: 33
Location: CANADA

PostPosted: Mon Jul 06, 2009 6:54 pm    Post subject: Need help to compare two files
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    Post subject:
Reply with quote

Did you write a cobol program....

search previous topic before posting.
http://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: 33
Location: CANADA

PostPosted: Mon Jul 06, 2009 7:02 pm    Post subject: Reply to: Need help to compare two files
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: 8593
Location: Back in jolly old England

PostPosted: Mon Jul 06, 2009 7:02 pm    Post subject:
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: 33
Location: CANADA

PostPosted: Mon Jul 06, 2009 7:06 pm    Post subject: Reply to: Need help to compare two files
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 Moderator


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

PostPosted: Mon Jul 06, 2009 10:13 pm    Post subject:
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: 33
Location: CANADA

PostPosted: Tue Jul 07, 2009 5:21 pm    Post subject: Reply to: Need help to compare two files
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    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 compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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