Need sort to compare 2 datasets

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
ujwal.borkar
Member
Posts: 7
Joined: Fri Jun 17, 2011 3:25 pm

Need sort to compare 2 datasets

Post by ujwal.borkar » Fri Jun 17, 2011 4:10 pm

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 ?

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Fri Jun 17, 2011 9:51 pm

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.
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

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Mon Jun 20, 2011 10:32 pm

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

ujwal.borkar
Member
Posts: 7
Joined: Fri Jun 17, 2011 3:25 pm

Post by ujwal.borkar » Wed Jun 29, 2011 5:10 pm

Thanks Guru :)

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Wed Jun 29, 2011 8:37 pm

Frank is not a sort-guru
he is the sort-god.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

Basav
Member
Posts: 7
Joined: Thu Sep 10, 2015 3:26 pm

Post by Basav » Tue Sep 15, 2015 9:00 am

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
efge

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Tue Sep 15, 2015 11:57 am

|1) Franlk retired more than three years ago. 2) This is the same as your previous question. Hod did you get on with that?

Basav
Member
Posts: 7
Joined: Thu Sep 10, 2015 3:26 pm

Post by Basav » Tue Sep 15, 2015 4:42 pm

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?
Hi William,

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

Basav
Member
Posts: 7
Joined: Thu Sep 10, 2015 3:26 pm

Post by Basav » Tue Sep 15, 2015 4:44 pm

Basav wrote:
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?
Hi William,

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
Since it is very confusing to implement using ICETOOL (above all it is grey area to me) , Currently I am implementing using COBOL code.
efge

academyindia4

Topic deleted by Admin

Post by academyindia4 » Mon Jan 25, 2016 9:28 pm

<< Content deleted By Admin >>

Post Reply

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



Other References
Mainframe Tools and others