What is the difference between comp and comp-3 usage?
Explain other COBOL usage?s.

Answers were Sorted based on User's Feedback



What is the difference between comp and comp-3 usage? Explain other COBOL usage?s...

Answer / elite group

Comp -- binary form
Comp-3 Packed Decimal

Usages are:
Display: Default it occupies the number of bytes is equal
to the size of the data-item
Comp -- Binary Number of bytes is equal to the size of the
data-item
Comp-1 -- 4-Bytes no pic clause is required
Comp-2 -- 8-byted no pic caluse is required, Double
precision
Comp-3 -- Packed Decimal Number of bytes is
(n+1)/2 -- if n is odd
(n/2)+1 -- if n is even
Comp-4 --- Same as Comp

Is This Answer Correct ?    57 Yes 14 No

What is the difference between comp and comp-3 usage? Explain other COBOL usage?s...

Answer / cauvitha

comp - used for binary representation. To make the calculations faster. it can have S and 9.
Memory usage is
s9(1)-s9(4) - 2bytes
s9(5)-s9(9) - 4bytes
s9(10)-s9(18) - 8bytes

===

comp-3 - used to store packed decimal values. Stores comparitively more values than comp. It can have S, 9, V.

Memory usage is
n/2 + 1 (Even)
n+1/2 (odd)

Is This Answer Correct ?    24 Yes 4 No

What is the difference between comp and comp-3 usage? Explain other COBOL usage?s...

Answer / sultana

Usage Clause :COMP
Binary representation of data item.
PIC clause can contain S and 9 only.
S9(01) – S9(04) Half word.
S9(05) – S9(09) Full word.
S9(10) - S9(18) Double word.

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More COBOL Interview Questions

subscript and index r not coded in u r application program what will happen?

2 Answers  


perform I from 0 by 1 until I=5?How maney times it will executes

8 Answers  


How To move a value to an array using move verb?

3 Answers   IBM,


How many bytes will be allocated for the following record description entries? 01 REC-A. 05 A PIC S9(4). 05 B PIC XXXBXXX. 05 C PIC ____9.99. 05 D PIC S9(5) COMP-3. 05 E PIC 9(3) COMP.

16 Answers   IBM, TCS,


how to display the dataset information?

2 Answers  






Write the syntax of a two dimensional array?

8 Answers   Honeywell, Xansa,


how can we fetch 3 records in cobol pgm any coding pls ?

3 Answers   CGI,


How to find whether a Flat file is empty or not without Reading a file in COBOL Program. (not using JCL)

9 Answers   Bank Of America,


How to Write the RESTART Logic Using COBOL?

4 Answers   GalaxE, L&T, Syntel, TCS,


can we print comp 3 stmts how ?

3 Answers   Accenture, TCS,


Why is it necessary that file needs to be opened in I-O mode for REWRITE?

0 Answers  


a pic s9(4) comp b pic s9(4) comp-3 c ???????????????? d ???????????????? move a to c add a+B giving d. what is ur declaration for c,d?

4 Answers  


Categories