To copy the matched records data from two files.

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

Moderators: Frank Yaeger, Moderator Group

Post Reply
krunal7878
Member
Posts: 3
Joined: Thu Dec 20, 2012 5:22 pm

To copy the matched records data from two files.

Post by krunal7878 » Fri Dec 21, 2012 9:34 pm

Hi,
Following is the requirement:
1. FILEA - Sorted on account id - Position 2 - Length-8, Type- CH
2. FILE B- Sorted on account id - Position 43 , Lenght-8 Type-CH.

For every matched records I want to have new file having account id , Client code from FILEA, City Code, state code and julian date , amount and tax from file b.

May you help how can the file be matched and copied for the above scenario.

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

Post by DikDude » Fri Dec 21, 2012 10:14 pm

Post some sample input and the output you want from that sample input.

Mention the recfm and lrecl of all 3 files.
Have a good one

krunal7878
Member
Posts: 3
Joined: Thu Dec 20, 2012 5:22 pm

Post by krunal7878 » Mon Dec 24, 2012 7:12 pm

File A and File B are of FB having record length - 180

File A: 81108989898989-----
File B: 811758945666666666666666666666666666689898989

For the highlighed larger fond date. whenever there is a match the file should have follwing data:

Postion 1:8 Account Id ( from any file)
Position 9:13 Province Code ( from file B Position 11)
Next 6 postiion: date from File B( postion 6 length-5)
Next 8 postion Premium from file B( Postion 21 Length-9)

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

Post by DikDude » Fri Dec 28, 2012 1:44 am

Please review what you have posted and correct or clarify the info posted . . .

Your data does not match your rules - neither the first post nor the second. . .

Make sure what you post is consistent and then someone may be able to offer a suggestion.
Have a good one

chaat
Member
Posts: 20
Joined: Sun Apr 18, 2010 11:51 pm
Location: St. Cloud, Minnesota, USA

Post by chaat » Sun Dec 30, 2012 8:54 am

Krunal,

if you have DFSORT available, then look at the JOINKEYS functionality to accomplish what you are attempting. I think that it would work.
Chuck Haatvedt

email --> clastnameatcharterdotnet

(replace lastname, at, dot with appropriate
characters)

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

Post by William Collins » Sun Dec 30, 2012 3:13 pm

Or SyncSort.

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

Post by DikDude » Mon Dec 31, 2012 10:04 pm

I suspect neither will work using the exact information posted by TS . . .

d

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