IBM COBOL400 Interview Questions And Answers

Download IBM COBOL400 Interview Questions and Answers PDF

Strengthen your IBM COBOL400 interview skills with our collection of 19 important questions. These questions will test your expertise and readiness for any IBM COBOL400 interview scenario. Ideal for candidates of all levels, this collection is a must-have for your study plan. Access the free PDF to get all 19 questions and give yourself the best chance of acing your IBM COBOL400 interview. This resource is perfect for thorough preparation and confidence building.

19 IBM COBOL400 Questions and Answers:

IBM COBOL400 Job Interview Questions Table of Contents:

IBM COBOL400 Job Interview Questions and Answers
IBM COBOL400 Job Interview Questions and Answers

1 :: What is the difference between section,paragraph and sentences?

Section is group of Praragraphs.
Paragraph is group of executable statements.
Sentence is statement(executable statements).
Read More

2 :: How array can be declare in cobol?

Array can be declared in cobol using the OCCURS clause.

Syntax is,

For one dimensional array,

01 Arrays.
05 Var1 PIC X(10) Occurs 10 times.


For two dimensional array,

01 Arrays.
03 AAA Occurs 10 times
05 BBB Occurs 10 times
07 Value PIC 9(3).
Read More

3 :: What is the difference between comp & comp-3?

Comp : Store the data in Binary formate, it will take less
space compare to Comp-3.

Comp-3 : Store the data in Pack decimal,it will take more
space compare to Comp.

Example :

S9(18)

Comp : takes 4 bytes
Comp-3: takes 10 bytes
Read More

4 :: What is comp?

"COMP" in Cobol = Binary storage format(if -ve bit is ON,
if +ve bit is OFF)
COMP-1 = Single precision floating point. Uses 4 bytes.
COMP-2 = Double precision floating point. Uses 8 bytes.
COMP-3 = packed decimal format. Uses 4 bytes.


Example 01 WS-VAR USAGE COMP-1.
Read More

5 :: What is PERFORM? and its types?

to execute set of statement elsewhere in the prgram.
types :
perform para-name.
perform para1 until condition.
perform para1 n times.
perform para1 thru para4 until condition.
inline perform.
perform varying i from 1 by 1 until condition.
perform para1 with test before/after until condition.
Read More

6 :: What is the difference between SEARCH and SEARCHALL?

Search verb searches an item in a sequential manner. But
Search All searches an item by using Binary search, so it
is more efficient and faster than its counter part. One
thing required in Search All verb is the array must be
sorted.
Read More

7 :: WHAT ALL THE CONDITIONES REQUIRED FOR USING OPEN OPCODE ON A FILE?

There are some conditions,
1. File should be decare in FILE-CONTROL, FILE SECTION.
2. file should be closed before opening it other wise ut
will gives error.
Read More

8 :: Can we open close file in COBOL any number of times?

yes, we can open closed file in COBOL any no. of time but
the condition is the file is not closed with "WITH LOCK"
clause otherwise you can't open.
Read More

9 :: What are Fillers?
What is the actual use of Fillers? With mall/simple Example?

When a programmer is not intended to use any fields in a record structure, it can be defined as Filler.
This can’t be initialized or used in any operation of the procedure division.


Eg: if a record contains the following fields
05 EMP-REC.
10 EMP-KEY PIC XXX.
10 EMP-NAME PIC X(32).
10 EMP-SEX PIC X.
10 EMP-DEPT PIC X(10)
10 EMP-DESIG PIC X(5).
10 EMP-SAL PIC 9(7).


If the programmer is not intended to use , name ,dept and sal in the program the u can define the structure as follows
05 EMP-REC.
10 EMP-KEY PIC XXX.
10 FILLER PIC X(32).
10 EMP-SEX PIC X.
10 FILLER PIC X(10)
10 EMP-DESIG PIC X(5).
10 FILLER PIC 9(7).
Read More

10 :: What is the cobol compiler?

The cobol compiler is IGYCRCTL
Read More

11 :: How to detect record is locked in Cobol/400?
Wat is the solution for that?

Check the file status, if the file status is 9D then it indicates that the record is locked. Solution should be READ the file with NO LOCK.
Read More

12 :: How to Convert 2010/02/11 to m/dd/yyy.. with string and without string if any other method... code?

The above issue can be resolved by using REDEFINES clause.

01 DATE-FIELD
05 DATE-YYYY PIC 9(04).
05 DATE-MM PIC 9(02).
05 DATE-DD PIC 9(02).
01 DATE-CONT REDEFINES DATE-FIELD
05 DATE-MM-CONT PIC 9(02).
05 DATE-DD-CONT PIC 9(02).
05 DATE-YYYY-CONT PIC 9(04).

I guess the above declaration will resolve it. I have not
tested it.
Read More

13 :: Code how to read 5th element of the array?

In COBOL we can directly access the particular index of the
array using subscript.

Eg: Arrayname(5)
or
Move 5 to indx
Arrayname(indx).
Read More

14 :: How to update data area in cobol 400 program?

Either DISPLAY keywords in COBOL-400 we can update the data
area.
For example
MOVE 'bbbb' TO GP-FILLER.
DISPLAY GP-FILLER UPON OTHER-DATA-AREA
FOR "SKDTAARA" LIBRARY "QGPL".
Read More

15 :: When search all is used in cobol program without sorted input data?

SEARCH ALL is a binary search. So, the data needs to be in
sorted order and the array used for search all operation
should have index by.
Read More

16 :: How can i change the below code in SQL to cobol/400?
EXEC SQL SELECT COUNT(*) INTO : WS-COUNT FROM Db file
WHERE Field 1 = : WS-VAR AND
Field 2 = : WS-USERID
END-EXEC

Declare below three variables in working storage section.

77 WS-COUNT PIC 99. VALUE ZEROS.
77 WS-VAR PIC X(10) VALUE "WELCOME".
77 WS-USERID PIC x(5) VALUE "AAAAA".
Decalre one indicator for end of file.
04 EOF-DB-FILE PIC X VALUE "N".
88 EOF-DB-FILE VALUE "Y".
Read each record from input file(Db file) and increase
count if the conditions are satisfied.
PROCEDURE DIVISION.
OPEN INPUT DB-FILE.
READ Db-file
AT END MOVE "Y" TO EOF-DB-FILE
GO TO 1000-EXIT.
IF FIELD1 = WS-VAR AND FIELD2 = WS-USERID
ADD 1 TO WS-COUNT
END-IF
GO TO 1000-EXIT.
DISPLAY WS-COUNT
CLOSE DB-FILE.
STOP RUN.
Read More

17 :: What is redefine and its syntax?

REDEFINE is a Cobol Verb.

It is similar to RENAME Verb.
It uses the same WORKING-STORAGE memory of a data name
With another data name programmer want instead.

Syntax.

WORKING-STORAGE SECTION.
01 WS-NAME PIC x(15).
01 WS-AGE PIC 99.
05 NAME REDIFINES WS-NAME.
Read More

18 :: What is INPUT PROCEDURE and OUTPUT PROCEDURE?

SORT WORKFILE ASCENDING KEY EMP-NO
INPUT PROCEDURE PARA-1
OUPUT PROCEDURE PARA-2.
SO INPUT PROCEDURE(RELASE THE RECORDS FOR SORTING)
OUTPUT PROCEDURE(RETURN THE SORTED RECORDS).
Read More

19 :: Define sort? and its syntax?

Here the sort is considered as an internal sort that is we
want to manipulate the data before feeding it to sort.Else
in rest of the cases we use external sort.
The syntax is :
SORT SORTFILE ON ASCENDING/DESCENDING KEY
USING FILE1,FILE2/ INPUT PROCEDURE PARA-1
GIVING FILE3/ OUTPUT PROCEDURE PARA-2
Read More