MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How SYNC verb in cobol work.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
vikramdr
Beginner


Joined: 15 Feb 2003
Posts: 15
Topics: 11

PostPosted: Sat Dec 09, 2006 2:27 pm    Post subject: How SYNC verb in cobol work. Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sat Dec 09, 2006 6:39 pm    Post subject: Reply with quote

vikramdr,

Check this link which explains in detail about the SYNC verb

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3LR10/5.3.15?DT=20020920180651

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
naveen
Beginner


Joined: 03 Dec 2002
Posts: 90
Topics: 31

PostPosted: Sat Jan 13, 2007 2:25 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group