Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us