Here is tricky COBOL interview question in many interviews. If the domain is Banking, surely you need to have answer for this question. Here is for you Banking domain knowledge.
How to process 2 files by comparing key fields in COBOL?
- Read the records in both the first file and the second file. If the key field matches, you can ignore it.
- Let us say T, M files.
- T < M means this is a new account so we need to update in the master file
- T > M means an account is missing in the Master file, so we need to update it
- If both files are the same number of records. It is good, our work is reduced
- If T file comes to AT END you need to move HIGH VALUES into the key field
- If M files come to AT END you need to move HIGH VALUES into the key field
- So you need to process till both key fields are equal to HIGH VALUES.
Note: Key fields must be in PIC (X) not numeric
- To avoid a lot of I/Os, you can read data into a local array table, and you can process the records.
Get new content delivered directly to your inbox.
- How to Write Complex SQL Sub-queryHere is a sample sub-query. Here you will read records from two tables. Also explained how the query works.
- How to Run Stored Procedure in SQL DeveloperHere are steps of how to create a procedure in SQL developer and how to call it.
- 13 Essential Python Interview QuestionsHere are 13 essential python interview questions useful to crack your interview.
- How to Find Sum of Series in PythonSample Python script to calculate the sum of the GP series. Knowing the skills applied to write this script useful for interviews.
- Python Program to Print Name in Reverse OrderHere’s a python program that reverses the name you enter and prints it in reverse order. This is useful for interviews.