View previous topic :: View next topic |
Author |
Message |
vikramdr Beginner
Joined: 15 Feb 2003 Posts: 15 Topics: 11
|
Posted: Sat Dec 09, 2006 2:27 pm Post subject: How SYNC verb in cobol work. |
|
|
Hi,
Can some one explain me how SYNC verb in cobol work. Also please explain what will be length of following group variable.
Code: |
01 WS-Rec.
05 WS-FLD1 PIC X(3).
05 WS-FLD2 PIX S9(4) USAGE COMP SYNC.
05 WS-FLD2 PIX S9(5) USAGE COMP SYNC.
01 WS-EMP-NO
05 WS-FIELD1 X(01).
05 WS-FIELD1 X(05) JUSTIFIED RIGHT
05 WS-FIELD1 9(05) SYNCHRONISED LEFT
05 WS-FIELD1 9(3).
|
Thanks _________________ Vikram |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
naveen Beginner

Joined: 03 Dec 2002 Posts: 90 Topics: 31
|
Posted: Sat Jan 13, 2007 2:25 pm Post subject: |
|
|
In layman's language , SYNC aligns storage to word boundaries. Every fetch/read instruction for CPU reads one complete word. If storage of an item is spilled over two words , it will need 2 CPU fetch cycles. With the help of SYNC storage is aligned to word boundaries and hence extra CPU fetch cyles are reduced , resulting in faster access.
At the same time the downside is the waste of space created because of movement of storage towards boundaries , these empty spaces are called slack bytes. |
|
Back to top |
|
 |
|
|