View previous topic :: View next topic
|
Author |
Message |
mandyzzzz
New User
Joined: 04 Jul 2005 Posts: 23
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
mandyzzzz
New User
Joined: 04 Jul 2005 Posts: 23
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
mandyzzzz
New User
Joined: 04 Jul 2005 Posts: 23
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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:
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 |
|
|
|