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

Files compare thru dfsort


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

New User


Joined: 04 Jul 2005
Posts: 23

PostPosted: Tue Jan 24, 2006 11:28 pm
Reply with quote

I have 2 files of same layouts.
2 fields in each say item number and amount
I need to match the item numbers and when amounts of same items mismatch write the record in a file.

Please help!
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: Wed Jan 25, 2006 12:14 am
Reply with quote

Please show an example of the record in each input file with all relevent fields and what you expect for the output files, and explain the "rules". Also, what is the RECFM and LRECL of the input files?
Back to top
View user's profile Send private message
mandyzzzz

New User


Joined: 04 Jul 2005
Posts: 23

PostPosted: Wed Jan 25, 2006 11:46 am
Reply with quote

Both are FB of 80 bytes and same layout.
there are 2 fields item number and amount in both.

Code:

File1
----
Itemno.  amount
--------------------
1        100.00
4        321.98
3        134.87
41       123.98
18        11.23



Code:

File2
----
Itemno.  amount
--------------------
1        100.00
4        111.98
3        134.87
41       123.98
18        11.23



I want record corresponding to item number 4 on output file as amounts mismatch.
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: Wed Jan 25, 2006 9:46 pm
Reply with quote

Quote:
I want record corresponding to item number 4 on output file as amounts mismatch.


Which record with item number 4? The record from file1? The record from file2? The records from file1 and file2? That's why I asked you to show the records you expected for output.

Another question: Are you matching by key or by record number. For example, are you matching the record with item 4 in file1 to the record with item 4 in file2, or are you matching the second record in file1 with the second record in file2?
Back to top
View user's profile Send private message
mandyzzzz

New User


Joined: 04 Jul 2005
Posts: 23

PostPosted: Thu Feb 02, 2006 1:17 pm
Reply with quote

Sorry for the late reply.
I want the record from both File1 and File2 into output file.
And i am matching the files thru the key i.e item number only
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: Thu Feb 02, 2006 10:17 pm
Reply with quote

The following DFSORT/ICETOOL job will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//CON DD *
1        100.00
4        321.98
3        134.87
41       123.98
18        11.23
/*
//    DD *
1        100.00
4        111.98
3        134.87
41       123.98
18        11.23
/*
//OUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(CON) TO(OUT) ON(1,15,CH) NODUPS
/*


OUT will have:

Code:

4        111.98
4        321.98


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
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 Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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
Search our Forums:

Back to Top