SORT JCL to seperate Matched and unmatched records

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

Moderators: Frank Yaeger, Moderator Group

Post Reply
vikasbs
Member
Posts: 8
Joined: Mon Apr 17, 2006 5:17 pm

SORT JCL to seperate Matched and unmatched records

Post by vikasbs » Tue Jun 08, 2010 6:58 pm

I've two file with FB record formate

File A - Record length - 9
File B - Records Lenght - 300

I need to comparea a number from File A in position ( 1,9) to a number
in FIle B in position (2,9).

My Requirement

1) I want two output files OUT1 with matched records from File B

2) Output file OUT2 with unmatched records from File A.

In the output file OUT1 I want the whole record for the matched records to come inthe output.In the OUT2 just the numbers shouold be enough.

Request you to give me the SORT and ICETOOL JCL.

Kindly let me know for more information.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Re: SORT JCL to seperate Matched and unmatched records

Post by Anuj Dhawan » Wed Jun 09, 2010 3:33 pm

You mihgt like to review your post again for these lines:
vikasbs wrote:I need to comparea a number from File A in position ( 1,9) to a number in FIle B in position (2,9).
For File A - number is of length 9 while for File B it's of just 8 - two numbers of differnet number of digits can never be same unless you are keeping the possibilty of having leading-zero in some numbers; but even if so - you've not stated that.
Regards,
Anuj

vikasbs
Member
Posts: 8
Joined: Mon Apr 17, 2006 5:17 pm

SORT JCL to seperate Matched and unmatched records

Post by vikasbs » Fri Jun 11, 2010 1:44 pm

Hi Anuj,

The number in File A starts from collumn 1

- - - - + - - - - 1
11 11 1 1 11 1
The same number in File A in File B start from collumn 2

- - - - + - - - - 1 -
21 11 1 1 1 11 1

Hope I am clear.

Regards
Vikas

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue Jun 15, 2010 6:17 pm

So yo actually menat (2,10) - length of key is 9.

Please have a look at "Create files with matching and non-matching records at location: http://www.ibm.com/support/docview.wss? ... g3T7000094. You might need to make some adjustments, but it should give you a start.

Good Luck :)
Regards,
Anuj

academyindia4

Topic deleted by Admin

Post by academyindia4 » Mon Jan 25, 2016 10:04 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