Home > Software > Mainframe > Cobol
Interview Questions   Tutorials   Discussions   Programs   

Cobol - Which is better comp or comp-3 in terms of memory utilization?




508
views
asked mar September 6, 2014 01:38 PM  

Which is better comp or comp-3 in terms of memory utilization?


           

1 Answers



 
answered By Mswami   0  

COMP is a binary storage format while COMP-3 is packed decimal format.

USAGE COMP:

  • Maintained in binary
  • Only integral numbers
  • Depending on the size of the data item, stored either in half word or full word
  • Should be numeric only

COMP-3 USAGE:

  • Internal Representation In Packed Decimal Form
  • Each digit and sign occupy 1/2 byte
  • Hexadecimal number C or F denotes positive sign
  • Hexadecimal number D denotes negative sign.

COMP-3 is better.

flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert