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 .
Files Merge - can you please help me
Moderators: Frank Yaeger, Moderator Group
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.
What have you tried so far?
so all you are doing is moving the I/O from one part of your job to another.to reduce i/o in my report program,
What have you tried so far?
Regards
Nic
Nic
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
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
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
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
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.
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.
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
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page