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
 
Regarding SYNC clause

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

New User


Joined: 30 Mar 2007
Posts: 7
Location: Bangalore

PostPosted: Thu Apr 12, 2007 10:47 pm    Post subject: Regarding SYNC clause
Reply with quote

For example:-
01 ws-test.
02 ws-var1 pic x(02)
02 ws-var2 pic s9(06)comp sync.

so if i am storing 10 in ws-var1, in 0th place 1 is stored and 1st place 0 is stored.
and ws-var2 as 4bytes...in book it is give that it starts from 4th position.....2,3 are slack bytes...
[b]my doubts.
1)what is the total size in this case,is it 2(ws-var1)+4(ws-var2)=6.If 6 is the size then 0,1 is used for storing 10, 2,3 slack bytes...it has only 2bytes left........then how can it store?
**2)if s9(10)comp sync then range is 8byte so do it start from 8th position...make 2 to 7 places as slack bytes?
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Apr 12, 2007 11:23 pm    Post subject: Re: Regarding SYNC clause
Reply with quote

daves wrote:
For example:-
01 ws-test.
02 ws-var1 pic x(02)
02 ws-var2 pic s9(06)comp sync.

so if i am storing 10 in ws-var1, in 0th place 1 is stored and 1st place 0 is stored.
and ws-var2 as 4bytes...in book it is give that it starts from 4th position.....2,3 are slack bytes...
[b]my doubts.
1)what is the total size in this case,is it 2(ws-var1)+4(ws-var2)=6.If 6 is the size then 0,1 is used for storing 10, 2,3 slack bytes...it has only 2bytes left........then how can it store?
**2)if s9(10)comp sync then range is 8byte so do it start from 8th position...make 2 to 7 places as slack bytes?
Actually ws-var2 is 8 bytes, comp items are half or full words and 9(6) is too big for a half word.

So let's try ws-var1 = x(2) and ws-var2 = s9(6) comp sync:
The 01 lines up on a double word,
var1 occupies the first two bytes,
var2 needs to be full word aligned so there are 2 slack bytes,
var2 occupies the next 4 bytes
ws-test has a length of 8 with the sync and 5 without the sync.

Did this answer your question?
There is a good example and explanation in the section on Slack bytes within records
Back to top
View user's profile Send private message
daves

New User


Joined: 30 Mar 2007
Posts: 7
Location: Bangalore

PostPosted: Thu Apr 12, 2007 11:40 pm    Post subject:
Reply with quote

Hi William,

I got my answer n the explaination i needed from the link u provided.

Thnx 4 helping me out
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 Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm
No new posts Sync sort - Transpose TS70363 SYNCSORT 5 Tue Jun 28, 2016 3:18 am
No new posts How to sync memebers in some datasets... Lord.of.Wind Compuware & Other Tools 2 Thu Apr 21, 2016 12:48 pm
No new posts [SQL0029] INTO clause missing from em... HABBIE DB2 2 Fri Sep 04, 2015 3:54 pm
No new posts 3-D Table with nested DEPENDING ON Cl... VivekKhanna COBOL Programming 5 Sat Aug 08, 2015 11:18 pm

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