View previous topic :: View next topic
|
Author |
Message |
rajesh_mbt
New User
Joined: 27 Mar 2006 Posts: 97 Location: India
|
|
|
|
01 A PIC S9(3).
MOVE -125 TO A.
DISPLAY A.
What is the value of A? |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
12N
will be displayed |
|
Back to top |
|
|
rajesh_mbt
New User
Joined: 27 Mar 2006 Posts: 97 Location: India
|
|
|
|
Thanks for your reply.
Can you help me how it becomes 12N. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
The sign will be punched on the least significant bit.
The corresponding codes for the positive and negetive digits are as follows....
if the no. is positive and the ...
last digit is | corresponding value is
1 | A
2 | B
3 | C
4 | D
5 | E
6 | F
7 | G
8 | H
9 | I
RESPECTIVELY
if the no. is negetive and the ...
last digit is | corresponding value is
1 | J
2 | K
3 | L
4 | M
5 | N
6 | O
7 | P
8 | Q
9 | R |
|
Back to top |
|
|
karthick Raja
New User
Joined: 10 Aug 2006 Posts: 8
|
|
|
|
Hi,
Just put HEX ON and you can note the value suppressed. (Lease Significant Bit + Sign). |
|
Back to top |
|
|
muthukannan
New User
Joined: 03 Aug 2006 Posts: 42 Location: Chennai
|
|
|
|
Hi,
If we are declaring s9(4) , its displaying the same value. How to display the 123 with a minus symbol or 123N?
Can you please explain about this.
Thank you,
MK |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Quote: |
How to display the 123 with a minus symbol or 123N? |
Declare it as PIC ---9. |
|
Back to top |
|
|
cobolunni
Active User
Joined: 07 Aug 2006 Posts: 127 Location: kerala,india
|
|
|
|
You can also declare variable as PIC S9(3) SIGN IS LEADING SEPARATE. |
|
Back to top |
|
|
h.dinesh
New User
Joined: 06 Dec 2006 Posts: 46 Location: Chennai
|
|
|
|
Hi,
Just to add to above
PIC S9(4) SIGN LEADING SEPARATE --- displays sign in the beginning
you may also use
PIC S9(4) SIGN TRAILING SEPARATE --- displays sign at end
Dinesh |
|
Back to top |
|
|
muthukannan
New User
Joined: 03 Aug 2006 Posts: 42 Location: Chennai
|
|
|
|
Hi Guys,
Thank you so much for the elaborated explanasions.
Thank you,
MK |
|
Back to top |
|
|
|