IBM COBOL400 Job Interview Preparation Guide
IBM COBOL400 Job Interview Preparation Guide
Global Guideline.
http://www.globalguideline.com/
Question # 1
What is the difference between section,paragraph and sentences?
Answer:Section is group of Praragraphs.
Paragraph is group of executable statements.
Sentence is statement(executable statements).
Read More Answers.
Question # 2
How array can be declare in cobol?
Answer: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 Answers.
Question # 3
What is the difference between comp & comp-3?
Answer: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 Answers.
Question # 4
What is comp?
Answer:"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.
Copyright http://www.GlobalGuideline.COM
Page 2/7
Question # 5
What is PERFORM? and its types?
Answer: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 Answers.
Question # 6
What is the difference between SEARCH and SEARCHALL?
Answer: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 Answers.
Question # 7
WHAT ALL THE CONDITIONES REQUIRED FOR USING OPEN OPCODE ON A FILE?
Answer: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 Answers.
Question # 8
Can we open close file in COBOL any number of times?
Answer: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 Answers.
Question # 9
What are Fillers?What is the actual use of Fillers? With mall/simple Example?
Answer:When a programmer is not intended to use any fields in a record structure, it can be defined as Filler.
This cant 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)
Copyright http://www.GlobalGuideline.COM
Page 3/7
Question # 10
What is the cobol compiler?
Answer:The cobol compiler is IGYCRCTL
Read More Answers.
Question # 11
How to detect record is locked in Cobol/400?Wat is the solution for that?
Answer: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 Answers.
Question # 12
How to Convert 2010/02/11 to m/dd/yyy.. with string and without string if any other method... code?
Answer: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 Answers.
Question # 13
Code how to read 5th element of the array?
Answer: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 Answers.
Question # 14
How to update data area in cobol 400 program?
Answer: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 Answers.
Question # 15
When search all is used in cobol program without sorted input data?
Answer: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 Answers.
Question # 16
How can i change the below code in SQL to cobol/400?EXEC SQL SELECT COUNT(*) INTO : WS-COUNT FROM Db file
Copyright http://www.GlobalGuideline.COM
WHERE Field 1 = :
Page 4/7
WS-VAR AND
Question # 17
What is redefine and its syntax?
Answer: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 Answers.
Question # 18
What is INPUT PROCEDURE and OUTPUT PROCEDURE?
Answer: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 Answers.
Question # 19
Define sort? and its syntax?
Answer: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 Answers.
Copyright http://www.GlobalGuideline.COM
Page 5/7
Global Guideline is a platform to develop your own skills with thousands of job interview questions
and web tutorials for fresher's and experienced candidates. These interview questions and web
tutorials will help you strengthen your technical skills, prepare for the interviews and quickly revise
the concepts. Global Guideline invite you to unlock your potentials with thousands of Interview
Questions with Answers or begin a tutorial right away, such as HTML, XML, XSLT, Cascading
Style Sheet (CSS), Search Engine Optimization (SEO), JavaScript, Structure Query Language (SQL),
Database Articles, Web Hosting Guide and much more. Learn the most common technologies
Interview Questions and Answers. We will help you to explore the resources of the World Wide Web
and develop your own skills from the basics to the advanced. Here you will learn anything quite
easily and you will really enjoy while learning. Global Guideline will help you to become a
professional and Expert, well prepared for the future.
* This PDF was generated from http://www.GlobalGuideline.com at November 29th, 2012
* If any answer or question is incorrect or inappropriate or you have correct answer or you found any
problem in this document then don't hesitate feel free and e-mail us we will fix it.
You can follow us on FaceBook for latest Jobs, Updates and other interviews material.
www.facebook.com/InterviewQuestionsAnswers
Follow us on Twitter for latest Jobs and interview preparation guides
http://twitter.com/InterviewGuide
Best Of Luck.
Global Guideline Team
http://www.globalguideline.com
[email protected]