61⟩ What are 77 levels used for?
It is used in Elementary level item. It cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves.
“Cobol Interview Questions and Answers will guide us now that COBOL is one of the oldest programming languages in computer history. COBOL name is an acronym for COmmon Business-Oriented Language, defining its primary domain in business, finance, and administrative systems for companies and governments. Learn COBOL programming basic and advance concepts or get preparation of COBOL based jobs interview by our this Cobol Interview Questions and Answers Guide.”
It is used in Elementary level item. It cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves.
IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION, PROCEDURE DIVISION.
Alphabetic, Alphanumeric fields & alphanumeric edited items are set to SPACES. Numeric, Numeric edited items set to ZERO. FILLER OCCURS DEPENDING ON items left untouched.
nn29 means that two run units are waiting to set locks on the same record and are in deadlock.
Locks are released by a change in currency or by a commit, rollback, or finish command.
Locks may be shared or exclusive. Shared means that other run units can retrieve the record but cannot modify it. Exclusive means that other run units can neither retrieve nor modify it. Record locks may be implicit or explicit. Implicit locks are set in the ready statement usage clause. Explicit locks are set using either the keep statement or keep option of the find/obtain command.
An area sweep accesses records based on the physical location in a database area. It can be total, meaning a record-by-record search of the area, or it can be of occurrences of records of a specific type.
There is no, difference. There is a difference between obtain first and obtain next for an area sweep, but not when current on the owner in a set.
The question is very general. Let us look into these possibilities:
1. QSAM (sequential) file: You can run it thru SORT utility adding SEQNUM and then sort then sort by SEQNUM in DESC order
2. VSAM: In CICS, you can read backward using READREV;
3. VSAM: I Batch, unload the VSAM file using SORT in DESC order by key value
Find tells you whether the record is actually in the database. If it is not found you save the overhead to obtain.
Binding is a process that creates the access path logic for the sql statements within a COBOL program. After precompilation of a COBOL program a dbrm (has all the embedded sql statements) is created. This dbrm is then bound to form a plan (executable form of the sql statements).
Structured programming is a Logical way of programming, you divide the functionalities into modules and code logically. OOP is a Natural way of programming; you identify the objects first, and then write functions, procedures around the objects. Sorry, this may not be an adequate answer, but they are two different programming paradigms, which is difficult to put in a sentence or two.
Yes, we can have different PIC clauses.
E.g.:
05 REGULAR-EMPLOYEES
10 LOCATION PICTURE A(8)
10 GRADE PICTURE X(4)
10 SEMI-MONTHLY-PAY PICTURE 9999V99
10 WEEKLY-PAY REDEFINES SEMI-MONTHLY-PAY
PICTURE 999V999
05 TEMPORARY-EMPLOYEE REDEFINES REGULAR-EMPLOYEE
10 LOCATION PICTURE A(8)
10 FILLER PICTURE X(6)
10 HOURLY-PAY PICTURE 99V99
Here s9(4)comp is small integer, so two words equal to 1 byte so totally it will occupy 2 bytes(4 words).here in s9(4) comp-3 as one word is equal to 12 byte.4 words equal to 2 bytes and sign will occupy 12 byte so totally it will occupy 3 bytes.
EVALUATE SQLCODE ALSO FILE-STATUS
WHEN A=B AND C=D WHEN 100 ALSO ‘00'
imperative stmt imperative stmt
WHEN (D+X)/Y = 4 WHEN -305 ALSO ‘32'
imperative stmt imperative stmt
WHEN OTHER WHEN OTHER
imperative stmt imperative stmt
END-EVALUATE END-EVALUATE
EVALUATE SQLCODE ALSO A=B EVALUATE SQLCODE ALSO TRUE
WHEN 100 ALSO TRUE WHEN 100 ALSO A=B
imperative stmt imperative stmt
WHEN -305 ALSO FALSE WHEN -305 ALSO (A/C=4)
imperative stmt imperative stmt
The PERFORM statement is a PROCEDURE DIVISION statement which transfers control to one or more specified procedures and controls as specified the number of times the procedures are executed. After execution of the specified procedures is completed (i.e., for the appropriate number of times or until some specified condition is met), control is transferred to the next executable statement following the PERFORM statement. There are 5 types of PERFORM statements
* a) Basic PERFORM
* b) PERFORM TIMES
* c) PERFORM UNTIL
* d) PERFORM VARYING
* e) IN-LINE PERFORM
The following features are available with VS COBOL II
1. MVSXA and MVSESA support the compiler and the object programs it produces can be run in either 24- or 31-bit addressing mode.
2. VMXA and VMESA support the compiler and the object programs it produces can be run in either24- or 31-bit addressing mode.
3. VSEESA supports the compiler and the object programs it produces can be run under VSEESA.
Here s9(4)comp is small integer ,so two words equal to 1 byte so totally it will occupy 2 bytes(4 words).here in s9(4) comp-3 as one word is equal to 12 byte.4 words equal to 2 bytes and sign will occupy 12 byte so totally it will occupy 3 bytes.
It is stored in the last nibble. For example if your number is +100, it stores hex 0C in the last byte, hex 1C if your number is 101, hex 2C if your number is 102, hex 1D if the number is -101, hex 2D if the number is -102 etc…
COMP is a binary storage format while COMP-3 is packed decimal format.