Files Merge - can you please help me

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

Moderators: Frank Yaeger, Moderator Group

Post Reply
gvenkata9
Member
Posts: 3
Joined: Wed Aug 07, 2013 1:22 pm

Files Merge - can you please help me

Post by gvenkata9 » Wed Aug 07, 2013 1:25 pm

File-1
SEQ FILE - ORDER FILE : 2500 bytes length
1-12 (12 bytes part num)
28-33(6 bytes account num)
53-13(13 bytes order number)
66-73(8 bytes broker number)
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
AA12345678910000000000000001234560000000AA12345678912100321700253XYZ12345

File-2
KSDS - Account master file: 1000 bytes length
key is account num starts at 16th position, length is 6chars)
account description starts at 29th position, length is 20bytes)
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
0000000000000001234560000000ABC DEVELOPERSXXXXXXXXXXXX

file-3
KSDS - Inventory master file: 800 bytes length
key is part num starts at 1st position, length is 12chars)
part description starts at 13th position, length is 30bytes)
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
AA1234567891AL PART FOR XEROX REPLACEMENTXXXXXXXXXXXXX

file-4
KSDS - Broker Master : 350 bytes length
key is broker num starts at 1st position, length is 8bytes)
broker description starts at 9th position, length is 20bytes)
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
XYZ12345RANGA NYC/NYCONXXXXXXXXXXXXXXXXX



I need help on merge the data to reduce i/o in my report program, so I need to merge data from all the files into single file.

match criteria:
From file-1, I need to match account number against file-2 and get account description (20bytes)
From file-1, I need to match part number against file-3 and get part description (30 bytes)
From file-1, I need to match broker number against file-4 and get broker description (20 bytes)

Account description, part description, broker description fields should add to the file-1 and file-1 length can be 2500+20+30+20=2570 bytes

Thank you very much .

gvenkata9
Member
Posts: 3
Joined: Wed Aug 07, 2013 1:22 pm

Post by gvenkata9 » Mon Aug 19, 2013 2:38 pm

Hi, Can any one let me know, is it possible to do this or not.? Please

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Mon Aug 19, 2013 2:56 pm

Why? you did not use the code tags to present your data. You have tried putting column indicators but as the font used is variable pitch the columns do nit line up with the data. Using the code tags you get nicely aligned data from your cut and paste.
to reduce i/o in my report program,
so all you are doing is moving the I/O from one part of your job to another.

What have you tried so far?
Regards
Nic

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

Post by William Collins » Mon Aug 19, 2013 4:01 pm

By putting the main file into sub-key order overall IO will be reduced. If the input files are of sufficient size, and the sub-key data has a reasonably randome distribution.

Yes, it can be done.

However, this may not be the best way - depends on the data.

So, tell us about the data. How many records on each file?

Listcats of the three KSDSs before and after a run.

In the Code tags, which go

Code: Select all

 your       stuff 

gvenkata9
Member
Posts: 3
Joined: Wed Aug 07, 2013 1:22 pm

Post by gvenkata9 » Tue Aug 20, 2013 3:52 pm

Hi William, These are the counts :

SEQ FILE - ORDER FILE : 2500 bytes length
1.5 million records recs

KSDS - Account master file: 1000 bytes length
150 thousands recs

KSDS - Inventory master file: 800 bytes length
2.3 millions recs

KSDS - Broker Master : 350 bytes length
50 thousand recs

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

Post by William Collins » Tue Aug 20, 2013 5:49 pm

The LISTCATs I asked for are coming? Especially important that those are in the Code tags.

Bear in mind that the data from the Broker Master (8+20 bytes) and the Account Master (6+20) would easilyt fit in the DATA DIVISION of a COBOL program. The Inventory Master nearly so, and it will definitely fit in once "active" parts are extracted from it.

So, another possibility is to hold the key/description in the DATA DIVISION and use SEARCH ALL (or your own Binary Search) to get the data you want.

You can mock-up both solutions easily, and see if one stands out over the other with your data. Remember that you can also combine the solutions.

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