View previous topic :: View next topic
|
Author |
Message |
nandini
New User
Joined: 27 Feb 2004 Posts: 18
|
|
|
|
Hi
In cobol comp1 and comp2 will take 1 word and 2 word respectivelly.
But i would like to know its internal representation.here is an exp
77 d1 comp1
77 d2 comp2
move 100 to d1,d2.
How much byte will take in both cases and i would like to know how it will work internally.
Thanx |
|
Back to top |
|
|
mcmillan
Site Admin
Joined: 18 May 2003 Posts: 1210 Location: India
|
|
|
|
Dear
COMP-1 takes 4 Bytes and the internal format is: +0.9( 8 ) E+99
COMP-2 occupies 8 Bytes and the internal format is: +0.9(17)E+99
So the value for:
01 D1 COMP-1 VALUE ZERO.
01 D2 COMP-2 VALUE ZERO.
MOVE 100 TO D1.
MOVE 100 TO D2.
is:
+0.1E+3 and +0.1E+3 respectively. |
|
Back to top |
|
|
nandini
New User
Joined: 27 Feb 2004 Posts: 18
|
|
|
|
Hi sir,
Thank You sir, I have some more doubt on it.I couldn't undestand the ' E ' in
+0.1E+3 and can u explain by moving different values in to comp1 and comp2. Also why we are not specifying any pic value . Suppose if we are moving a value more than 2 word what happend? Hope u will reply
Love
Nandini |
|
Back to top |
|
|
mcmillan
Site Admin
Joined: 18 May 2003 Posts: 1210 Location: India
|
|
|
|
'E' is a Code Character like 9, X, A, P , V, S & G. It occupies 1 Byte.
E Means Exponentiation.
Take the value 12345
You can say this as: 0.12345 * 10 ** 5
Internally this is equivalent to +0.12345E5
You can not specify Picture clause for COMP-1, -2, INDEX & POINTER data items. Because there Data type, size & format of this items are pre-defined. |
|
Back to top |
|
|
nandini
New User
Joined: 27 Feb 2004 Posts: 18
|
|
|
|
Hi sir
Thank You sir,
Sir, u specified 'E' is a Code Character like 9, X, A, P , V, S & G' Whether
this letters have any significats or u specified it just like other character.
thanks
love |
|
Back to top |
|
|
|