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

What is the difference between CALL BY VALUE and CALL BY CONTENT?

7 Answers  


Following questions were asked in Capegemini on 8th sep,2012 mainframe test 1.)Condition code for dul recors in VSAM- 2.) Is NULL or =NULL in Select statement 3.)max size of CI 4.)What happens after CI is full 5.)Ques on COND parameter 6.)which among following can not be rolled back a)delete table b.)droptable c)Update d.)insert 7.)groupby and orderby sql querries 8.)Max extents in VSAM file 9.)quesn on DPRTY=(1,10) 10.)range of condition codes in COBOL 11.)occurs clase can not be used at which level? 12.)delimiter in jcl 13.)sort card for file in PGM=SORT 14.)PIC(6) value 120056 possible? 15)question on BLKSIZE Is (20,20) and (20,10) possible? 16.)number of bytes in RDF 17.)Can we use index in WS-section or LK-section 18.)Verify command in IDCAMS used for? 19.)question on Alternate Index 20.)Return code of file attribute mismatch 21.)In which format COBOL variables stored? 22.)what is Alternate of HANDLE? 23.)can SUM,AVG,MIN,ROUND used in numeric and char variable data types? 24.)What is the datatype of FILE STATUS codes in WS-section?

2 Answers   Cap Gemini,


What COBOL construct is the COBOL II EVALUATE meant to replace?

1 Answers  


01 a pic s9(5) value '-12345' how it will be stored

7 Answers   ACS,


How to define a array dynamically.....

5 Answers   Fidelity,






What are the pertinent COBOL

0 Answers   IBM,


I have 2 dimensional array with having 100 elements. So how to find the 11th item in an array?

6 Answers   IBM,


if you give cylinder(1,1)how many cylinders it will be allocate?

3 Answers   Hewitt,


can we use go to statement inline-perform?

7 Answers   IBM,


u have passed sme charecters thru parm parameter in jcl. how do u code in cobol to recieve the values u gave in parm ?

2 Answers   IBM,


What is Redefines clause?

8 Answers  


9(2).99 how many bytes take? Why . consider as a byte?

2 Answers  


Categories