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

How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?

0 Answers  


What is the compute verb? How is it used?

0 Answers  


what happens if we dont close cursor in db2-cobol pgm?

6 Answers  


How do u initialize an array?

2 Answers   CTS,


Can anyone explain me CALL procedure in COBOL.Does it carries similarities like call by reference in C.

1 Answers  


What is the problem of ordered sequential files access?

0 Answers  


what is difference between the sysabend and userabend?

2 Answers  


What is report-item?

1 Answers   IBM,


I have a Main Program which is calling Sub-Program which is a DB2 pgm. What will happen if I am not closing the cursor used in the Sub-program? Please advise..

3 Answers   iGate,


can we declare occurs in 01 level?

2 Answers   Temenos,


where do we use dyanamic call ? and where do we use static call pls give any example pls ?

3 Answers   Patni,


when SE37 SB37 and sd37 occurs how to increase the volume , primary quantity and secondary quantity?

1 Answers   Hewitt,


Categories