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
 
bytes taken for comp sync

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

New User


Joined: 10 Jan 2008
Posts: 4
Location: Chennai

PostPosted: Thu Jan 10, 2008 9:35 am    Post subject: bytes taken for comp sync
Reply with quote

how many bytes will be taken to store a variable declared as COMP SYNC ?
normally a varible declared as COMP will take 2 bytes if it is 9(1) to 9(4).
4 bytes if it is 9(5) to 9(9).
8 bytes if it is 9(10) to 9(18).
what chane will come in this when we include sync with that?
Back to top
View user's profile Send private message

ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Thu Jan 10, 2008 11:40 am    Post subject:
Reply with quote

Hi,

Folowing information might be useful.

Quote:

COMP binary number
S9 to S9(4) - stored as 2 bytes
S9(5) to S9(9) - stored as 4 bytes
S9(10) to S9(18) - stored as 8 bytes
NOT aligned on a specific boundary
also known as COMP-4

COMP SYNC binary number on a specific boundary
S9 to S9(4) - stored as 2 bytes on halfword
S9(5) to S9(9) - stored as 4 bytes on fullword
S9(10) to S9(18) - stored as 8 bytes on fullword

Using COMP SYNC can cause "slack bytes" to be embedded within the WORKING STORAGE because of the forced alignment. This can affect questions as to the size of table entry, or computing the size of a record.

Anything on an 01 level is automatically on a doubleword boundary.



KSK
Back to top
View user's profile Send private message
ahalyah

New User


Joined: 13 Dec 2007
Posts: 25
Location: india

PostPosted: Thu Jan 10, 2008 11:54 am    Post subject:
Reply with quote

Hi,
COMP SYNC is used for faster address resolution.
For ex.
01 ws-rec.
05 ws-var1 pic x(2).
05 ws-var2 pic X(3) comp sync.

then it will store ws-var2 not immedietly after 2 bytes. It will store in 5 th byte. So introduces slack bytes b/n them. But address resolution is faster. Means it will fetch the data from half word or full word boundaries.
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 965
Location: Richmond, Virginia

PostPosted: Thu Jan 10, 2008 6:56 pm    Post subject:
Reply with quote

Is this extra documentation/maintenance complexity really gaining you enough CPU nanoseconds to justify it?
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Jan 11, 2008 1:03 am    Post subject:
Reply with quote

Hi Varun...

Do you have a specific problem involving SYNC or is this a ques that you were wondering about in general?
Back to top
View user's profile Send private message
varunvasudevan

New User


Joined: 10 Jan 2008
Posts: 4
Location: Chennai

PostPosted: Fri Jan 11, 2008 9:38 am    Post subject: Reply to: bytes taken for comp sync
Reply with quote

Actully my doubt is , on what basis the word boundary will be decided.?
is it always 4 bytes or will it be the size of particular element in a group with wich we mention SYNC clause?

for ex:
01 group.
05 ele1 pic x(10).
05 ele2 pic 9(6) comp SYNC.
05 ele3 pic s9(4)v99 comp3.

in the above example SYNC declared with 'ele2 pic 9(6) comp' . normally it will take 4 bytes in memory.So for this group 4 bytes wll be word boundy.
so my quest is, insted of 'ele2 pic 9(6) comp' , if it was 'ele2 pic 9(14) comp sync' what would be the size of word boundary? 9(14) comp will take 8 bytes. so will it be 8 bytes?
Back to top
View user's profile Send private message
khyati kumar

New User


Joined: 04 Jan 2008
Posts: 15
Location: Pune

PostPosted: Fri Jan 11, 2008 3:51 pm    Post subject: How to redefine comp-3 variable?
Reply with quote

How to redefine comp-3 variable?

Suppose I have comp-3 valiable S9(11)V99 comp-3 and I have to move this value to ZZZ,ZZZ,ZZZ,ZZ9.99.So please let me know any suggestion what to do because while moving this variable i am getting S0c7 so i want to redefine ?
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 Error in SQL-PLIST3 'Above value tru... rikdeb DB2 4 Wed Sep 06, 2017 1:34 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Sync sort - Transpose TS70363 SYNCSORT 5 Tue Jun 28, 2016 3:18 am
No new posts Need help to populate date in COMP-3 ... chetanambi DFSORT/ICETOOL 3 Tue Jun 21, 2016 12:25 pm

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