Comp-3

What is comp-3 and advantage with examples?

Questions by raju_68

Showing Answers 1 - 6 of 6 Answers

shaikmf

  • Jun 11th, 2008
 

COMP-3 is a computational method used in COBOL. COMP-3 is represented in Packed Decimail format. Decimails are alloed to this COMP-3 Field.
Each digit occupies 1/2 bite of memory, so this declaration is useful and it conserves the memory.

Ex: 01 A  PIC  S9(5) COMP-3

A will occupy 5/2+1/2(Sign) =3 Bytes of memory. other than the boundary values(4,9,18) COMP-3 will conserve the memory space.

  • All computational usages are to compress data.
  • comp3 is converts data into packet decimal format.
  • each byte is divided into two characters in comp3.
  • based on the type of length specified lengths are categorized
  • if the length is odd the formula is (n/2)+(1/2)
  • if the lenth is even the formula is (n/2)+1

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions