What is the difference between comp and comp-3 usage?
Explain other COBOL usage?s.
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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?
Why did you choose to work with ibm mainframe cobol programming?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
I have a sequential file of 100 records. How do I load the records into a two dimensional array ?
what is the coding difference between COBOL and CICS.
What is the difference between PIC 9.99 and PIC9v99?
What is inspect in cobol ?
Explain complete concept of table handling in COBOL with an example?
How do you get the data to code the BMS macro?
What are the cobol coding sheets?
How do u know what version of cobol u are using?
I want to declare a field with data type Double in my COBOL program. how shall i do that ?