Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Uses of USAGE SYNC Clause

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
rahul_desai29

New User


Joined: 15 Mar 2006
Posts: 10
Location: fl;jds

PostPosted: Wed Mar 15, 2006 12:03 pm    Post subject: Uses of USAGE SYNC Clause
Reply with quote

Quote:


HI, ALL
I Want to know the uses of using USAGE SYNC

RAHUL
Back to top
View user's profile Send private message

nuthan

Active User


Joined: 26 Sep 2005
Posts: 146
Location: Bangalore

PostPosted: Wed Mar 15, 2006 12:39 pm    Post subject: Re: Uses of USAGE SYNC
Reply with quote

Hi,
Every time it will start from fresh boundary while occupying bytes.

Let us suppose If my first variable is x(3) and next one is s9(4) comp, then if you do not specify the SYNC clause, S9(4) COMP will start from byte 3 ( assuming that it starts from 0 ). If you specify SYNC, then the binary data item will start from address 4. You might see some wastage of memory, but the access to this computational field is faster.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Fri Mar 24, 2006 9:10 am    Post subject: Re: Uses of USAGE SYNC
Reply with quote

Hi Nuthan,
Can you expain this more??
I got a impression that you want to say that there if overlapping of data if we dont specify SYNC??

If yes, then how will you identify that where do you nees to use SYNC???


Thanks
ap_mainframes
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Mar 24, 2006 10:16 am    Post subject:
Reply with quote

Hi ap

Its nt like overlapping.

suppose if u declare wo variable like that...
01 var-a pic 9(4).
01 var-b pic x(6).

then var-a will occupy the first 4 byte of the word & varb will occupy 5 th byte to 10 th byte of the same word.
But if we declare ...
01 var-a pic 9(4).
01 var-b pic x(6) usage sync.
then var-a will occupy the first 4 byte of the word & var-b will occupy first 6 byte of the next word.
hope it will helpful.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Fri Mar 24, 2006 11:13 am    Post subject: Re: Uses of USAGE SYNC
Reply with quote

Hey Ekta,

That explains.

Thanks
ap_mainframes
Back to top
View user's profile Send private message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Fri Mar 24, 2006 1:06 pm    Post subject: Re: Uses of USAGE SYNC
Reply with quote

HI,
I hope this will give some more idea about the sync clause ...

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.

Cheers
RSC
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am
No new posts )SEL and )ENDSEL usage cvnlynn TSO/ISPF 4 Thu Jun 15, 2017 1:15 am
No new posts Need inputs on Space requirement and... ashek15 IMS DB/DC 0 Sat Apr 01, 2017 8:26 am
No new posts Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us