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

Cobol - What is COMP SYNC?

asked mar August 22, 2014 12:59 PM  

What is COMP SYNC?


1 Answers

answered By Mswami   0  
SYNC Keyword is used in COBOL to align the data(storage-area) to a Word-Boundary(Any address which is a multiple of 4). This is because, on Mainframes reading data from a word-boundary is computationally efficient.

Causes the item to be aligned on natural boundaries. Can be SYNCHRONIZED LEFT or RIGHT.

For binary data items, the address resolution is faster if they are located at word boundaries in the memory. For example, on main frame the memory word size is 4 bytes. This means that each word will start from an address divisible by 4. If my first variable is x(3) and next

one is s9(4) comp, then if you do not specify the SYNC clause, S9(4) COMP will start from byte 3 ( assuming that it starts from 0 ). If you specify SYNC, then the binary data item will start from address 4. You might see some wastage of memory, but the access to this

computational field is faster.
   add comment

Your answer

Join with account you already have



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!