View previous topic :: View next topic |
Author |
Message |
sivaraj.ramaraj Beginner
Joined: 05 Sep 2007 Posts: 5 Topics: 3
|
Posted: Wed Aug 13, 2008 12:03 pm Post subject: how many bytes did S99V999 COMP-3 will take? |
|
|
how many bytes did S99V999 COMP-3 will take? |
|
Back to top |
|
 |
CraigG Intermediate
Joined: 02 May 2007 Posts: 202 Topics: 0 Location: Viginia, USA
|
Posted: Wed Aug 13, 2008 12:23 pm Post subject: |
|
|
Have you tried looking in the COBOL manual? 3 Bytes. |
|
Back to top |
|
 |
sivaraj.ramaraj Beginner
Joined: 05 Sep 2007 Posts: 5 Topics: 3
|
Posted: Wed Aug 13, 2008 1:20 pm Post subject: |
|
|
yah , i looked into the manuls but i thought it will count 'S' also so 6/2+1=4 bytes |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Aug 13, 2008 1:28 pm Post subject: |
|
|
sivaraj.ramaraj,
how did you count 6 in 99V999 ? The decimal point is NOT stored
Kolusu |
|
Back to top |
|
 |
sivaraj.ramaraj Beginner
Joined: 05 Sep 2007 Posts: 5 Topics: 3
|
Posted: Wed Aug 13, 2008 1:33 pm Post subject: |
|
|
Hi Kolusu,
i didn't count the decimal part ,but i hve counted the 'S' bit |
|
Back to top |
|
 |
warp5 Intermediate

Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Thu Aug 14, 2008 12:57 am Post subject: |
|
|
S99V999 gives 6 hex characters, 5 digits, 1 sign, which in turn gives a total of 3 bytes. |
|
Back to top |
|
 |
sivarao Beginner
Joined: 21 Aug 2008 Posts: 6 Topics: 1
|
Posted: Mon Aug 25, 2008 11:55 pm Post subject: |
|
|
S99V999-it will occupy 3 bytes.
S99V999- 5 digits and 'V' is a suumed decimal point it will not occupy any memory.
Let me know if you have any doubt. |
|
Back to top |
|
 |
Santlou Beginner
Joined: 18 Apr 2007 Posts: 21 Topics: 4 Location: sw florida
|
Posted: Mon Sep 01, 2008 9:23 pm Post subject: |
|
|
An easy way to remember is to take the number of digits (not including the sign or implied decimal), then divide that number by 2, drop the remainder (if any) and add 1.
Example:
s9(2)V999
there are 5 digits here, so 5 / 2 = 2.5
drop the remainder (.5) = 2
Add 1 (2 + 1) = 3
This is for Packed (COMP-3) fields. |
|
Back to top |
|
 |
|
|