Merging Datasets with removing duplicates
Moderators: Frank Yaeger, DikDude, Moderator Group
-
- Member
- Posts: 8
- Joined: Tue Oct 30, 2012 5:14 pm
Merging Datasets with removing duplicates
Hi,
I have two datasets with the data as,
1st file:EIC009B
EIC011B
EIC013B
EIC014B
EIC028B
EIC032B
2nd file:APC065B
APC069B
EIC032B
CCC100B
CUC200B
EIC013B
EIC014B
CUC941B
DIC001B
DIC002B
I want to merge both these files into a third dataset and also it should be without any duplicates.So Please help me on this how to achieve this in a one step?
I have two datasets with the data as,
1st file:EIC009B
EIC011B
EIC013B
EIC014B
EIC028B
EIC032B
2nd file:APC065B
APC069B
EIC032B
CCC100B
CUC200B
EIC013B
EIC014B
CUC941B
DIC001B
DIC002B
I want to merge both these files into a third dataset and also it should be without any duplicates.So Please help me on this how to achieve this in a one step?
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
-
- Member
- Posts: 8
- Joined: Tue Oct 30, 2012 5:14 pm
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
-
- Member
- Posts: 8
- Joined: Tue Oct 30, 2012 5:14 pm
-
- Member
- Posts: 8
- Joined: Tue Oct 30, 2012 5:14 pm
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
OK, you want to "merge" two different datasets with different numbers of records and drop the duplicates.
If you have "no key" it is either "impossible" or you use the whole record as a key.
Makes me wonder now what you mean by "merge".
You MERGE on files which are already in sequence on your key (even if it the whole record). As the first few bytes of your records were obviously not in sequence, I presumed (and certainly wasn't going to spend time checking) that you had some other key that was in sequence.
So, it really sounds like you want to SORT, on the entire record, with SUM FIELDS=NONE? Concatenate your input datasets on SORTIN. Give it a whirl.
If you have "no key" it is either "impossible" or you use the whole record as a key.
Makes me wonder now what you mean by "merge".
You MERGE on files which are already in sequence on your key (even if it the whole record). As the first few bytes of your records were obviously not in sequence, I presumed (and certainly wasn't going to spend time checking) that you had some other key that was in sequence.
So, it really sounds like you want to SORT, on the entire record, with SUM FIELDS=NONE? Concatenate your input datasets on SORTIN. Give it a whirl.
-
- Member
- Posts: 8
- Joined: Tue Oct 30, 2012 5:14 pm
For ur understanding my 3rd dataset after merging and removing duplicates will be,
APC069B
CCC100B
CUC200B
EIC032B
EIC009B
EIC011B
EIC013B
EIC014B
EIC028B
EIC032B
CUC941B
DIC001B
DIC002B
I want this kind of data in my output dataset
Hope you get that
Thanx in advance
Reagards,
Harshal
Thanx in advance
APC069B
CCC100B
CUC200B
EIC032B
EIC009B
EIC011B
EIC013B
EIC014B
EIC028B
EIC032B
CUC941B
DIC001B
DIC002B
I want this kind of data in my output dataset
Hope you get that
Thanx in advance
Reagards,
Harshal
Thanx in advance
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
-
- Member
- Posts: 3
- Joined: Fri Feb 08, 2013 4:41 pm
- Location: Bangalore
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
-
- Member
- Posts: 3
- Joined: Fri Feb 08, 2013 4:41 pm
- Location: Bangalore
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