Need sort to compare 2 datasets
Moderators: Frank Yaeger, Moderator Group
-
- Member
- Posts: 7
- Joined: Fri Jun 17, 2011 3:25 pm
Need sort to compare 2 datasets
I have 2 datasets having different copybooks ( Say File 1 and File 2 )
I want records present in file1 but not in file2 based on a Keyword which exists in both the datasets at different positions.
Can you please help me to get sort for this ?
I want records present in file1 but not in file2 based on a Keyword which exists in both the datasets at different positions.
Can you please help me to get sort for this ?
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
You can use DFSORT's JOINKEYS function for that. For some examples, see the "Create files with matching and non-matching records" Smart DFSORT Trick at:
http://www.ibm.com/support/docview.wss? ... g3T7000094
If you need more specific help, please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
http://www.ibm.com/support/docview.wss? ... g3T7000094
If you need more specific help, please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
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
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Based on the information you sent me offline, here's a DFSORT JOINKEYS job that will do what I think you want:
Code: Select all
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/70)
//IN2 DD DSN=... input file2 (FB/74)
//SORTOUT DD DSN=... output file (FB/70)
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(1,8,A)
JOINKEYS F2=IN2,FIELDS=(1,8,A)
JOIN UNPAIRED,F1,ONLY
REFORMAT FIELDS=(F1:1,70)
OPTION COPY
/*
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
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
Frank Yaeger, :
Hi Frank,
Can you please help me on this below mentioned requirement.
I/P:
0192002682|0000001004931|RAINBOW
0192002682|0000000706570|NON-RAINBOW
0192002682|0000000706570|NON-RAINBOW
4000000018|0001935277780|RAINBOW
4000000018|0001943580989|RAINBOW
5192002681|0000001004932|RAINBOW
5192002681|0000000706570|NON-RAINBOW
6792002686|0000000706570|NON-RAINBOW
6992002688|0000000706570|RAINBOW
7192002683|0000001004932|NON-RAINBOW
7192002683|0000000706570|RAINBOW
7192002683|0000001004932|NON-RAINBOW
Expected O/P:
0192002682|0000001004931|RAINBOW
0192002682|0000000706570|NON-RAINBOW
0192002682|0000000706570|NON-RAINBOW
5192002681|0000001004932|RAINBOW
5192002681|0000000706570|NON-RAINBOW
7192002683|0000001004932|NON-RAINBOW
7192002683|0000000706570|RAINBOW
7192002683|0000001004932|NON-RAINBOW
Hi Frank,
Can you please help me on this below mentioned requirement.
I/P:
0192002682|0000001004931|RAINBOW
0192002682|0000000706570|NON-RAINBOW
0192002682|0000000706570|NON-RAINBOW
4000000018|0001935277780|RAINBOW
4000000018|0001943580989|RAINBOW
5192002681|0000001004932|RAINBOW
5192002681|0000000706570|NON-RAINBOW
6792002686|0000000706570|NON-RAINBOW
6992002688|0000000706570|RAINBOW
7192002683|0000001004932|NON-RAINBOW
7192002683|0000000706570|RAINBOW
7192002683|0000001004932|NON-RAINBOW
Expected O/P:
0192002682|0000001004931|RAINBOW
0192002682|0000000706570|NON-RAINBOW
0192002682|0000000706570|NON-RAINBOW
5192002681|0000001004932|RAINBOW
5192002681|0000000706570|NON-RAINBOW
7192002683|0000001004932|NON-RAINBOW
7192002683|0000000706570|RAINBOW
7192002683|0000001004932|NON-RAINBOW
efge
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
Hi William,William Collins wrote:|1) Franlk retired more than three years ago. 2) This is the same as your previous question. Hod did you get on with that?
Since i am very new to the mainframe technology , I am trying to implement suggestion given by you in another thread .
As a beginner in mainframe technology i am trying to understand your technical words.
Thanks,
Basavaraj.A.S
efge
Since it is very confusing to implement using ICETOOL (above all it is grey area to me) , Currently I am implementing using COBOL code.Basav wrote:Hi William,William Collins wrote:|1) Franlk retired more than three years ago. 2) This is the same as your previous question. Hod did you get on with that?
Since i am very new to the mainframe technology , I am trying to implement suggestion given by you in another thread .
As a beginner in mainframe technology i am trying to understand your technical words.
Thanks,
Basavaraj.A.S
efge
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