Candidates for positions involving the use of COBOL language must demonstrate a strong knowledge and experience of divisions, data types, PERFORM instructions and types of research.

Facilitate the test by anticipating these common questions and preparing detailed answers.

1. Which sections comprise the Data Division?

Data division describes the fields, records and files in memory. It defines all the data of a COBOL program.

This division has six sections: FILE, WORKING-STORAGE, LINKAGE, LOCAL-STORAGE, REPORT and SCREEN.

The FILE section contains one or more File Description entries, which consist of level 01 record descriptions. If an entry indicates that all records vary in length, you can read them using the OCCURS DEPENDING ON clause. This clause varies the size of the records according to the number of occurrences they contain.

The working memory (WORKING-STORAGE section) defines the names of the data so that the program can manipulate them. This section describes the data using the OCCURS clause.

The LINKAGE section is part of a called program that links to the data in the WORKING-STORAGE section of the calling program.

A LOCAL-STORAGE section is allocated each time a program is called. It is released when the program executes the EXIT PROGRAM, GOBACK, or STOP RUN instructions.

The REPORT section contains one or more Report Description entries that are self-explanatory.

The SCREEN section is used to create forms on a screen.

Kết quả hình ảnh cho cloud technology

2. What are the research techniques and under what circumstances should they be used?

The search is either binary or sequential.

The binary search is faster when the table contains more than 100 entries. Use it if the table entries are listed in ascending or descending order. To ensure proper operation, use the SEARCH ALL statement with the ASCENDING KEY or DESCENDING KEY clause. Include the INDEXED BY clause.

Sequential search organizes the array when the entries are in random order. The SEARCH instruction searches from top to bottom in the table. You must set the index to 1 for the INDEXED BY clause.

3. How is multithreading different from threading on a single CPU?
Multithreading allows a program to simultaneously execute separate threads.

A program runs faster when multiple threads are running on multiple CPUs. To spread a program over multiple threads, use the RECURSIVE clause in the PROGRAM-ID section. All COBOL programs must be compiled with the THREAD compile option so that threads are properly allocated.

Each thread can use the same copy of the data from the WORKING-STORAGE section. If you are using the LINKAGE section, make sure that a copy of the LOCAL-STORAGE section is available for each call of the program. You must release this section when the called program is returned to the main program.

However, multithreading in COBOL has some limitations. For example, avoid unwanted language elements; thus, the ALTER, GO TO, and STOP RUN statements do not work with multithreading.

4. Give some examples of COBOL dialects.

A COBOL dialect contains instructions or compile directives specific to this instance of the language. A dialect of COBOL can not be used in other dialects.

Micro Focus Studio Enterprise Edition for Unix contains dialects that are enabled during compilation.
For example, with Micro Focus, the ACU dialect allows compatibility with ACUCOBOL.

ENTCOBOL specifies that reserved words in IBM Enterprise COBOL for z / OS and OS / 390 must also be treated as such in Micro Focus. Similarly, ISO 2002 specifies that the reserved words in ISO COBOL 2002 must also be in Micro Focus. In this standard, the reference syntaxes of zones A and B are combined in the text box of the program; the text can start anywhere in this area.

5. What is the biggest problem to consider when the main COBOL program calls a C / C ++ subroutine?

The biggest risk is that of a memory overflow in a C / C ++ subroutine called by the main COBOL program during compilation. When the memory used is too large, a stack overflow occurs, all the more serious as the stack size of a given C / C ++ subprogram is reduced. The program therefore has less stack space per thread when running the subroutine in multithreading modes. The less battery space, the more memory is likely to overflow.

The problem is compounded when threads share the heap (or heap). You must therefore make sure that the threads do not try to access the same memory segments at the same time in the C program.