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 to open and see copy book ?

3 Answers  


When is a scope terminator mandatory?

3 Answers  


What are declaratives and what are their uses in cobol?

0 Answers  


How to delete a front spaces in a data-name/variable in cobol Example:- 01 data-name-1 PIC x(20) value " cobol language". 01 data-name-2 PIC x(20). MOVE data-name-1 to data-name-2. would like the value of data-name-2 is "cobol language".

3 Answers  


How do you define a variable of comp-1 and comp-2?

0 Answers  






RENAME clause takes new SPACE in memory.TRUE or FALSE? a)TRUE 2)FALSE

12 Answers   TCS,


i want all ERRORS codes in COBOL ,JCL,VSAM ,DB2,CICS

4 Answers   Infosys,


what is scope terminator

2 Answers   IBM,


how to remove leading spaces and zeroes in a cobol variable.is there any easy way to do it

2 Answers  


How can we increase the size of an existing PDS to include more no. of modules. I tried the answer posted by Jagan(TSO PDS 'pds name') but did not find it working. The answer posted by kamal i know very well. Please suggest me a answer so that we don't need to delete the existing PDS and still we can change the size as well.

10 Answers  


what is meaning by design document? who can repared for this?

5 Answers   TCS,


how to convert vsam table into DB2 table?

1 Answers   IBM, Wipro,


Categories