Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

5.3.15 SYNCHRONIZED Clause



The SYNCHRONIZED clause specifies the alignment of an elementary item on a natural boundary in storage.


    ___ Format _____________________________________________________________ 
   |                                                                        |
   | >>__ _SYNCHRONIZED_ __ _______ _____________________________________>< |
   |     |_SYNC_________|  |_LEFT__|                                        |
   |                       |_RIGHT_|                                        |
   |                                                                        |
   |________________________________________________________________________|
SYNC is an abbreviation for SYNCHRONIZED and has the same meaning.

The SYNCHRONIZED clause is never required, but can improve performance on some systems for binary items used in arithmetic.


X The SYNCHRONIZED clause can appear at the elementary level or at the group
X level (in which case, every elementary item within this group level item
X is synchronized).

LEFT
Specifies that the elementary item is to be positioned so that it will begin at the left character position of the natural boundary in which the elementary item is placed.

RIGHT
Specifies that the elementary item is to be positioned such that it will terminate on the right character position of the natural boundary in which it has been placed.

When specified, the LEFT and the RIGHT phrases are syntax checked, but they have no effect on the execution of the program.

The length of an elementary item is not affected by the SYNCHRONIZED clause.

Table 14lists the effect of the SYNCHRONIZE clause on other language elements.


 Table 14. SYNCHRONIZE Clause Effect on Other Language Elements            
 Language Element    Comments                                              
 OCCURS clause     
                   
                   
 When specified for an item within the scope of an     
 OCCURS clause, each occurrence of the item is         
 synchronized.                                         
 DISPLAY or        
 PACKED-DECIMAL    
 Each item is syntax checked, but it has no effect on  
 the execution of the program.                         
 BINARY or         
 COMPUTATIONAL     
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
RevisionX                    
RevisionX                    
                   
                   
                   
 When the item is the first elementary item            
 subordinate to an item that contains a REDEFINES      
 clause, the item must not require the addition of     
 unused character positions.                           
                                                       
 When the synchronized clause is not specified for a   
 subordinate data item (one with a level number of 02  
 through 49):                                          
                                                       
    The item is aligned at a displacement that is a   
     multiple of 2 relative to the beginning of the    
     record, if its USAGE is BINARY and its PICTURE is 
     in the range of S9 through S9(4).                 
                                                       
    The item is aligned at a displacement that is a   
     multiple of 4 relative to the beginning of the    
     record, if its USAGE is BINARY and its PICTURE is 
RevisionX      in the range of S9(5) through S9(18), or its      
RevisionX      USAGE is INDEX.                                   
                                                       
 When SYNCHRONIZED is not specified for binary items,  
 no space is reserved for slack bytes.                 
RevisionX  USAGE IS POINTER, 
RevisionX  USAGE IS          
RevisionX  PROCEDURE-POINTER,
RevisionX  or USAGE IS       
RevisionX  OBJECT REFERENCE  
RevisionX  The data is aligned on a fullword boundary.           
RevisionX                                                        
RevisionX                                                        
RevisionX                                                        
RevisionX                                                        
RevisionX  COMPUTATIONAL-1    RevisionX  The data is aligned on a fullword boundary.           
RevisionX  COMPUTATIONAL-2    RevisionX  The data is aligned on a doubleword boundary.         
RevisionX  COMPUTATIONAL-3   
RevisionX                    
RevisionX  The data is treated the same as the SYNCHRONIZED      
RevisionX  clause for a PACKED-DECIMAL item.                     
RevisionX  COMPUTATIONAL-4   
RevisionX                    
RevisionX  The data is treated the same as the SYNCHRONIZED      
RevisionX  clause for a COMPUTATIONAL item.                      
RevisionX  COMPUTATIONAL-5   
RevisionX  (Workstation      
RevisionX  Only)             
RevisionX  The data is treated the same as the SYNCHRONIZED      
RevisionX  clause for a COMPUTATIONAL item.                      
RevisionX                                                        
RevisionX  DBCS and Floating 
RevisionX  Point Item        
RevisionX  The SYNCHRONIZED clause is ignored.                   
RevisionX                                                        
 REDEFINES clause  
                   
                   
                   
                   
                   
                   
                   
 For an item that contains a REDEFINES clause, the     
 data item that is redefined must have the proper      
 boundary alignment for the data item that redefines   
 it.  For example, if you write the following, be sure 
 that data item A begins on a fullword boundary:       
                                                       
   02 A               PICTURE X(4).                    
   02 B REDEFINES A   PICTURE S9(9) BINARY SYNC.       


In the File Section, the compiler assumes that all level-01 records containing SYNCHRONIZED items are aligned on doubleword boundaries in the buffer. You must provide the necessary slack bytes between records to ensure alignment when there are multiple records in a block.

In the Working-Storage Section, the compiler aligns all level-01 entries on a doubleword boundary.

For the purposes of aligning binary items in the Linkage Section, all level-01 items are assumed to begin on doubleword boundaries. Therefore, if you issue a CALL statement, such operands of any USING phrase within it must be aligned correspondingly.

Subtopics:



Previous Topic Next Topic Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.