GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Mainframe  >  COBOL
Go To First  |  Previous Question  |  Next Question 
 COBOL  |  Question 112 of 162    Print  
There are 2 files. These 2 files contains some common (duplicate) records. How do you copy these common (matching) records into third file. Suggest the answer using COBOL as well as through JCL.

  
Total Answers and Comments: 2 Last Update: September 06, 2007     Asked by: sekhargupta 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
August 02, 2007 10:34:02   #1  
sunayana.sarangi Member Since: August 2007   Contribution: 7    

RE: There are 2 files. These 2 files contains some com...

Using JCL :
Step 1: using pgm SORT sort and merge the two files
SORTIN DD file 1 (i/p file 1)

SORTIN DD file 2 (i/p file 2)

SORTOUT DD file 3 (o/p file containing the sorted and merged recs of both the i/p files)

Step 2: Using SUM FIELDS NONE XSUM : the duplicates will be eliminated and written in to the file defined in the SORTXSUM DD step

Using COBOL :
Use the MERGE verb along with the OUTPUT PROCEDURE. In the OUTPUT PROCEDURE code the logic for eliminating the duplicates and writing them in to an output file.


 
Is this answer useful? Yes | No
September 06, 2007 05:50:17   #2  
venkatesh        

RE: There are 2 files. These 2 files contains some com...
You can use IEBCOMPR utility to solve this.
 
Is this answer useful? Yes | No

 Related Questions

There are at least five differences: COBOL II supports structured programming by using in line PERFORMs and explicit scope terminators, it introduces new features (EVALUATE, SET .. TO TRUE, CALL .. BY 
Latest Answer : The END Delimiter --> END-READ                               END-PERFORM                              ...

A scope terminator brackets its preceding verb, eg. IF .. END-IF, so that all statements between the verb and its scope terminator are grouped together. Other common COBOL II verbs are READ, PERFORM, EVALUATE, 
Latest Answer : terminators like END-PEROFRM END-EVALUTE are called explicit scope terminaotr available in COBOL 85. ...

The PERFORM and END-PERFORM statements bracket all COBOL II statements between them. The COBOL equivalent is to PERFORM or PERFORM THRU a paragraph. In line PERFORMs work as long as there are no internal 
Latest Answer : In In-line PERFORM the procedure name is omitted. An In-line PERFORM must be delimited by the END-PERFORM statement.SYNTAX:          PERFORM                   ...

NEXT SENTENCE gives control to the verb following the next period. CONTINUE gives control to the next verb after the explicit scope terminator. (This is not one of COBOL II's finer implementations). 
Latest Answer : Next sentence: The sentence is the collection of statements and is always end with period(.).so next sentence means the control passes to next sentence after period.e.g.: if X=3 Compute X=X-3 Next sentence End-if ...

EVALUATE can be used in place of the nested IF THEN ELSE statements.  
Latest Answer : EVALUATE statement contrusts a case structure. The explicit scope terminator for EVALUATE is END-EVALUATE. The various cases can be places between the EVALUATE and END-EVALUATE statements. Example:Here SQLCODE is a built in variable name EVALUATE SQLCODE ...

Partial list: REMARKS, NOMINAL KEY, PAGE-COUNTER, CURRENT-DAY, TIME-OF-DAY, STATE, FLOW, COUNT, EXAMINE, EXHIBIT, READY TRACE and RESET TRACE.  

Explain the difference between an internal and an external sort, the pros and cons, internal sort syntax etc?
An external sort is not COBOL; it is performed through JCL and PGM=SORT. It is understandable without any code reference. An internal sort can use two different syntaxes: 1.) USING, GIVING sorts are 

Comp is a binary usage, while comp-3 indicates packed decimal. The other common usages are binary and display. Display is the default. 3/28/00 Dave Herrmann: 'I was reading your FAQ on Cobol, as 
Latest Answer : Binary representation of data item are called 'comp', while comp-3 is the packed decimal.comp-1 & comp-2 are another usage.  ...

In a COBOL II perform statement, when is the conditional tested, before or after the perform execution?
In COBOL II the optional clause WITH TEST BEFORE or WITH TEST AFTER can be added to all perform statements. By default the test is performed before the perform.  

In COBOL II the 88 levels can be set rather than moving their associated values to the related data item. (Web note: This change is not one of COBOL II's better specifications.)  
Latest Answer : Last answer is correct and below example also.e.g. 05  ACCOUNT-TYPE         PIC X(01) VALUE 'N'.             88  PREPAID-ACCT                     ...


 Sponsored Links

 
Related Articles

What is Common Metadata

In simple but technical term, metadata is a data that describes another data. It can be any item describing an individual datum or a collection of multiple content items. Metadata is very useful in facilitating the use, management and understanding of data in a large data warehouse. Depending on the
 

What is Common Data Structure

In big data warehouses such as those used by business organizations which may have many branches around the world and which may have diversified products and services, different kinds of data flood the warehouse every single day. These data may come from other warehouse data sources, or simply fresh
 

What is Common Data Modeling Method

Common Data Modeling is one of the core considerations when setting up a business data warehouse. Any serious company wanting to have a data warehouse will have to be first serious about data models. Building a data model takes time and it is not unusual for companies to spend two to five years just
 

What is Common Data Modeling

Common Data Modeling is defining the unifying the structure used in allowing heterogeneous business environments to interoperate. A Common Data Model is very critical to a business organization. Especially with business environment where it is common to have multiple applications, a Common Data Mod
 

What is Common Data Model

This data model represents events, entities and objects in the real world that are of interest to the company. It is subject oriented and includes all aspects of the real world, primarily activities pertaining to the business. To use lay terms, a data model can be considered a road map to get one em
 

What is Common Data Architecture

Business need to define their organizational rules, policies and process in order to realize their projected growth within a specified period. In order to realize these targets, the essentially need to have a basic framework as the guide in their operations. The gathering and use of data is a very s
 

What is Data File

In a logical data model, the conceptual data model which is based on the business semantic is being defined. Thus, entities and relationships and corresponding table and column design, object oriented classes, and XML tags, among other things are being laid regardless of the database will be physica
 

Importance of Header Files

What is the importance of header files? The main role of header file is it is used to share information among various files. In brief, if we have several functions say 4 functions named as f1, f2, f3, f4 placed in file say sample.c and if all the functions want to get accessed by each other then all
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape