Reading from 2 input files using SORT

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

Moderators: Frank Yaeger, Moderator Group

Post Reply
goldyroshan
Active Member
Posts: 67
Joined: Thu Apr 05, 2012 1:29 am
Location: WI, USA

Reading from 2 input files using SORT

Post by goldyroshan » Fri Apr 11, 2014 10:24 pm

I have 1st input file having control numbers from 1st to 9th position.
Another input file having lots of fields including control numbers from 3000th position (9 bytes).

I want to read 1st file for Control Numbers, find them in 2nd input file & extract the same records (same control numbers) from 2nd input file into output file.

Please suggest SORT JCL for the same.
Logically yours,
:-) GRS :-)

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

Post by William Collins » Fri Apr 11, 2014 11:19 pm

How many records on the control file?

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Sun Apr 13, 2014 10:28 pm

One way would be to use JOINKEYS.

There are examples in the forum or the documentation.
Have a good one

goldyroshan
Active Member
Posts: 67
Joined: Thu Apr 05, 2012 1:29 am
Location: WI, USA

Post by goldyroshan » Mon Apr 14, 2014 6:03 am

614 records in control file
Logically yours,
:-) GRS :-)

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

Post by William Collins » Mon Apr 14, 2014 8:44 am

Yes, as DikDude suggested, JOINKEYS for a multiple-record control file.

goldyroshan
Active Member
Posts: 67
Joined: Thu Apr 05, 2012 1:29 am
Location: WI, USA

Post by goldyroshan » Wed Apr 16, 2014 10:28 am

Thanks William & DikDude. I was able to get the desired result using JOINKEYS.
Logically yours,
:-) GRS :-)

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Thu Apr 17, 2014 9:38 pm

Thank you for letting us know :)

dd

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