Can anyone please let me know which one of the file matching logic is efficient.
Having both the files in sorted order.
option 1:
if machval1 > machval2
read next of machfile2
if machval1 < machfval2
read next of Machfile1
if machval2 = matchval2
write into 3 fileread next of both file1, file2 and reapeat the para again..
option 2:
Here : READ-NAME-SHORT is one file and
COIP-CUSTOMER-NUMBER is from other file.
PERFORM 4201-READ-NAME-SHORT
THRU 4201-READ-NAME-SHORT-EXIT
UNTIL INP-CUSTOMER-NUMBER >= COIP-CUSTOMER-NUMBER
OR NAME-FILE-EOF.
IF INP-CUSTOMER-NUMBER = COIP-CUSTOMER-NUMBER
MOVE INP-NAME-SHORT TO COCO-FULL-NAME
Please let me know which option is efficient.
Two files Matching Logic
Moderators: dbzTHEdinosauer, Moderator Group
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
need to decide which process works.
then you need to run tests.
we have no idea what your machine looks like, how your shop is set up.
and I have little desire to comment on such abbreviated coding logic and attempt to make a decision on efficiency,
especially since I have no idea what you mean by efficient.
and depending on what manipulation is to be accomplished, a SORT solution may be better than a COBOL program written by a beginner.
then you need to run tests.
we have no idea what your machine looks like, how your shop is set up.
and I have little desire to comment on such abbreviated coding logic and attempt to make a decision on efficiency,
especially since I have no idea what you mean by efficient.
and depending on what manipulation is to be accomplished, a SORT solution may be better than a COBOL program written by a beginner.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
-
- Member
- Posts: 2
- Joined: Sat Oct 30, 2010 2:42 pm
At my first glance over the option1 and optin 2 logics..
i dont see any major logic differene between option 1 and option 2.
It is simplay using PERFORM instead of IF condition. It dont expect any cost savings
over this.. In both cases , we need to read all the recods in both files.
As suggested by Dick, we better use existing tools like DFSORT, EASYTRIVE for this kind of match files applications.
i dont see any major logic differene between option 1 and option 2.
It is simplay using PERFORM instead of IF condition. It dont expect any cost savings
over this.. In both cases , we need to read all the recods in both files.
As suggested by Dick, we better use existing tools like DFSORT, EASYTRIVE for this kind of match files applications.
Natarajan
Chennai
Chennai
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