Hi.
I need to perform a compare between two files, to make sure that other than the identified field, all other fields are same.
File1 : aaaabbbb2222ccc44444.......
File2 : aaaabbbb3333cccc44444.....
I have to compare all other fileds values of these files , excluding field with 2222 in F1 and 3333 in F2.
Both the files are FB and of samelength - 80
Compare 2 files, excluding one fields from both.
Moderators: Frank Yaeger, DikDude, Moderator Group
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
You need to do a better job of explaining what you want to do before anyone can help you.
What do you want to if (1) all of the fields are the same or (2) all of the fields are not the same.
Do you only have one record in each file, or can there be more than one record in each file? If more, do you want to compare record 1 of file1 to record 1 of file2, record 2 of file1 to record 2 of file2, etc. Or do you want to do something else? If you can have more than one record in each file, show a better example of input and expected output.
What do you want to if (1) all of the fields are the same or (2) all of the fields are not the same.
Do you mean you want to exclude the field in each input record at positions 9-12, or are 2222 and 3333 really significant in some way? How?excluding field with 2222 in F1 and 3333 in F2.
Do you only have one record in each file, or can there be more than one record in each file? If more, do you want to compare record 1 of file1 to record 1 of file2, record 2 of file1 to record 2 of file2, etc. Or do you want to do something else? If you can have more than one record in each file, show a better example of input and expected output.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
File1 :
rec1 - aaaabbbb2222cccc44444.......
rec2 - ccccxxxx1111dddd55555.......
File2 :
rec1 - aaaabbbb3333cccc44444.....
rec2 - ccccxxxx1111dddd55555.......
F1 and F2 can have any number of records. I want to exclude records from position 9 to 12 from both the files records and want to compare record 1 of F1 with record 1 of F2 and so on... all other fields excluding from position 9 to 12.
rec1 - aaaabbbb2222cccc44444.......
rec2 - ccccxxxx1111dddd55555.......
File2 :
rec1 - aaaabbbb3333cccc44444.....
rec2 - ccccxxxx1111dddd55555.......
F1 and F2 can have any number of records. I want to exclude records from position 9 to 12 from both the files records and want to compare record 1 of F1 with record 1 of F2 and so on... all other fields excluding from position 9 to 12.
ARI
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Sigh. We're getting closer.
Again:
File1 :
aaaabbbb2222cccc44444.......
ccccxxxx1111dddd55555.......
eeeeffff4444xxxxxxxxx.......
ffffffff0000xxxxxxxxx.......
hhhhhhhh1234qqqqqqqqq.......
File2 :
aaaabbbb3333cccc44444.......
ccccxxxx0000dddd55555.......
eeeeffff4444yyyyyyyyy.......
gggggggg0000xxxxxxxxx.......
hhhhhhhh4567qqqqqqqqq.......
Again:
You say you want to compare the records, but you don't say what you want to do if the records are equal or not equal. So how can we give you a job to do what you haven't said you want to do?What do you want to if (1) all of the fields are the same or (2) all of the fields are not the same.
Show an example of input and output where all of the fields (excluding 9-21) in two records are the same and where all of the fields (excluding 9-12) in two records are different. For example, if you had these input files, what would you expect for output and why?show a better example of input and expected output.
File1 :
aaaabbbb2222cccc44444.......
ccccxxxx1111dddd55555.......
eeeeffff4444xxxxxxxxx.......
ffffffff0000xxxxxxxxx.......
hhhhhhhh1234qqqqqqqqq.......
File2 :
aaaabbbb3333cccc44444.......
ccccxxxx0000dddd55555.......
eeeeffff4444yyyyyyyyy.......
gggggggg0000xxxxxxxxx.......
hhhhhhhh4567qqqqqqqqq.......
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Hi,
further to the details provided, Please see the below example -
File1 :
aaaabbbb2222cccc4444.......
ccccxxxx1111dddd5555.......
eeeeffff4444xxxxyyyy.......
....
File2 :
aaaabbbb3333cccc4444.......
ccccxxxx0000dddd5555.......
eeeeffff44442222aaaa....
In file 2 record 3 , yyyy from file1 has been changed to aaaa.
The idea of my process to change values only for 4 bytes - 9 to 12 and keep other values same. To validate the process output -
The compare JCL should compare values of two files excludig those 4 bytes from both F1 & F2 as change is expected there. In case of any mismatch found in all other field values, as it is in present in Record 3; the record should be copied to the error file from File 1 and job should end with a return code to notify that to the user.
In addition to this - Can I start comparing from a perticular record - e.g - I want to skip first 10 reows of F1 and F2 while start comparinfg ? is it possible - please let me know. It will reduce a lot of my reformating effort before I start comparing files.
further to the details provided, Please see the below example -
File1 :
aaaabbbb2222cccc4444.......
ccccxxxx1111dddd5555.......
eeeeffff4444xxxxyyyy.......
....
File2 :
aaaabbbb3333cccc4444.......
ccccxxxx0000dddd5555.......
eeeeffff44442222aaaa....
In file 2 record 3 , yyyy from file1 has been changed to aaaa.
The idea of my process to change values only for 4 bytes - 9 to 12 and keep other values same. To validate the process output -
The compare JCL should compare values of two files excludig those 4 bytes from both F1 & F2 as change is expected there. In case of any mismatch found in all other field values, as it is in present in Record 3; the record should be copied to the error file from File 1 and job should end with a return code to notify that to the user.
In addition to this - Can I start comparing from a perticular record - e.g - I want to skip first 10 reows of F1 and F2 while start comparinfg ? is it possible - please let me know. It will reduce a lot of my reformating effort before I start comparing files.
ARI
-
- Member
- Posts: 25
- Joined: Tue Apr 28, 2009 10:53 pm
- Location: USA
- Contact:
Here is a SyncSort for z/OS JOIN application that will produce the requested output:
If there is always a 1:1 correlation between the two files, and the data is pre-sequenced, then you can add SORTED to each of the JOINKEYS statements as follows:
Based on this data, then following record will be in the output file:
I will get back to you regarding setting a non-zero return code when records are present in the output file.
Code: Select all
//SORT1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD *
AAAABBBB2222CCCC4444...
CCCCXXXX1111DDDD5555...
EEEEFFFF4444XXXXYYYY...
//SORTJNF2 DD *
AAAABBBB3333CCCC4444...
CCCCXXXX0000DDDD5555...
EEEEFFFF44442222AAAA...
//SORTOUT DD DSN=OUTPUT.FILE
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(1,8,A,13,68,A)
JOINKEYS FILES=F2,FIELDS=(1,8,A,13,68,A)
JOIN UNPAIRED,F1,ONLY
REFORMAT FIELDS=(F1:1,80)
SORT FIELDS=COPY
/*
Code: Select all
JOINKEYS FILES=F1,FIELDS=(1,8,A,13,68,A),SORTED
JOINKEYS FILES=F2,FIELDS=(1,8,A,13,68,A),SORTED
Code: Select all
EEEEFFFF4444XXXXYYYY...
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
If you have the Nov, 2009 DFSORT PTF, you can use JOINKEYS with DFSORT as well. In addition, you can skip the first 10 records of each input file by adding:
For more information on the Nov, 2009 DFSORT PTF, see:
http://www.ibm.com/support/docview.wss? ... g3T7000174
It would help if you would tell us which Sort product you're actually using (DFSORT, Syncsort, CA-Sort).
Code: Select all
//JNF1CNTL DD *
OPTION SKIPREC=10
//JNF2CNTL DD *
OPTION SKIPREC=10
/*
http://www.ibm.com/support/docview.wss? ... g3T7000174
It would help if you would tell us which Sort product you're actually using (DFSORT, Syncsort, CA-Sort).
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page