Hi ronmathew,
ronmathew wrote:can anyone tell me about Sync mode
SYNC clause is specified with COMP, COMP-1 and COMP-2 items. These items are expected to start at half/full/double word boundaries for faster address resolution. SYNC clause does this but it may introduce slack bytes (unused bytes) before the binary item.
01 WS-TEST.
10 WS-VAR1 PIC X(02).
10 WS-VAR2 PIC S9(6) COMP SYNC.
Assumes WS-TEST starts at relative location 0 in the memory, WS-VAR1 occupies zero and first byte. WS-VAR2 is expected to start at second byte. As the comp item in the example needs one word and it is coded with SYNC clause, it will start only at the next word boundary that is 4th byte. So this introduces two slack bytes between WS-VAR1 and WS-VAR2.
Hope above explaination gives you clear idea about SYNC in COBOL.
