Monday, 28 July 2014

COBOL SYNCH Option

The SYNCHRONIZED clause instructs the compiler to insert slack bytes when they are needed for proper alignment.

Most processors are efficient at picking up data which start on a word boundary (a word is usually 2 bytes) and not so efficient at picking up data from a byte boundary. 

In COBOL, data items are not normally word aligned. To cause alignment along a word boundary, the SYNC clause is used. It is obvious that this form of alignment is likely to lead to some unused memory area between data items. It can be used with numeric or alphanumeric data items, but they must be elementary items.

Slack bytes (within records). Bytes inserted by the compiler between data items to ensure correct alignment of some elementary data items. Slack bytes contain no meaningful data. 


Created with Artisteer

No comments:

Post a comment