Cobol interview questions pdf free download




















You must load the table in the specified order. What is binary search? Search on a sorted array. Compare the item to be searched with the item at the center. If it matches, fine else repeat the process with the left half or the right half depending on where the item lies. My program has an array defined to have 10 items. What is wrong with it? Records from the sort work file must be returned one at a time to the output procedure.

Number of sort datasets depends on the volume of data being sorted, but a minimum of 3 is required. But, Next Sentence would take the control to the sentence after it finds a full stop. Does nothing! If used, must be the only sentence within a paragraph. Redefines just causes both fields to start at the same location. Basically you need to correct the offending data.

Many times the reason for SOC7 is an un-initialized numeric item. Examine that possibility first. Examine the compilation output XREF listing to get the verb and the line number of the source code at this offset. Then you can look at the source code to find the bug. Some installation might have batch program debugging tools. Use them. Packed Decimal fields: Sign is stored as a hex value in the last nibble 4 bits of the storage.

Zoned Decimal fields: As a default, sign is over punched with the numeric value stored in the last bite. It is stored in the last nibble. It is stored in the most significant bit. COMP-1 — Single precision floating point. It uses 4 bytes. There is no picture clause to be given. It will take 4 bytes to occupy. Causes the item to be aligned on natural boundaries. For binary data items, the address resolution is faster if they are located at word boundaries in the memory.

For example, on main frame the memory word size is 4 bytes. This means that each word will start from an address divisible by 4. If you specify SYNC, then the binary data item will start from address 4. You might see some wastage of memory, but the access to this computational field is faster.

Do not code the 4 bytes for record length in FD i. Do not code 4 bytes for record length in FD i. A scope terminator brackets its preceding verb, e. When would you use it? Anything else you wish to say about it. Programs compiled with a 24 bit mode can only address 16 Mb of space, as though they were kept under an imaginary storage line.

In a normal call they are able to be modified. It is the part of the called program where these share items are defined. It is not possible to pass an index via linkage.

The index is not part of the calling programs working storage. For readability, it is recommended coding practice to always make scope terminators explicit. By default the test is performed before the perform. Evaluation of the WHEN clauses proceeds from top to bottom and their sequence can determine results. In a binary search the table element key values must be in ascending or descending sequence.

In a sequential search the table is searched from top to bottom, so ironically the elements do not have to be in a specific sequence. Calling a program name literal. Dynamically called modules are those that are not bound with the calling program at link edit time IEWL for IBM and so are loaded from the program library joblib or steplib associated with the job. A Statically called module is one that is bound with the calling module at link edit, and therefore becomes part of the executable load module.

Structured programming is logical way of programming where the functionalities are divided into modules and helps write the code logically. Object Oriented Cobol language is a Natural way of programming in which you identify the objects, and then write functions and procedures around that object. Finally the file will be closed. The linkage section is used to pass data from one program to another program or to pass data from a procedure to a program.

Global variables are accessible only to the batch program whereas external variables can be referenced from any batch program residing in the same system library. Pic 9v99 is a three position Numeric field with an implied or assumed decimal point after the first position. These are options for a compiler to find the subscript out of range. COMP-1 is a Single precision floating point and uses four bytes.

COMP2 is the double precision floating number and uses eight bytes. PIC 9. The Purpose of Pointer is to specify the leftmost position within receiving field where the first transferred character will be stored. If it matches, it is good to go with the value else repeat the process with the left half or the right half depending on where the item lies. In this, first objects are identified and then the functions and procedures are written.

It is a natural way of programming. It is more secure as compared with structured COBOL programming because there is a feature of data hiding. Scope terminators are used for nesting. Also, use Tests before and Test after in performing statements while writing do-while statements.

COBOL programing language is segregated into four major divisions. It is used for identifying the program.

It consists of two sections: the configuration section and input-output section. Data identification- It is a place which describes the data items, defines the names that are used in the program and also allocates memories as required by the program.

It consists of three sections: the file section, working-storage section, and linkage section. Procedure division. The following rules have to be taken care of while conducting SORT operation- Input and output files must be closed. Input file is the file that has to be sorted in a particular sequence. The output file is the result that we get after the sorting process.

Work files are used for holding records during the sorting process. Input and output files must have FD entries. Also, short descriptions should be there in the file section of work files. It has six sections- File section - It defines the fields within the records of each file in the program. Working storage section - It defines the names of the data that the program uses for the manipulation of data.

Screen section — It is used when the program does in-out through forms. Report section - It is used for preparing reports. Linkage section. There should be some initial value present in the search index.



0コメント

  • 1000 / 1000