View previous topic :: View next topic
|
Author |
Message |
soumyanamboo
New User
Joined: 16 Apr 2008 Posts: 13 Location: Chennai
|
|
|
|
What will be the output if a negative value is moved to an unsigned integer?
01 WS-VAR1 PIC 99 VALUE 5
01 WS-VAR2 PIC 99 VALUE 10
01 WS-VAR3 PIC 99 VALUE 10
SUBTRACT WS-VAR1 WS-VAR2 FROM WS-VAR3
What is the value of WS-VAR3?
a) 5
b) 0
c) -5
d) On size Error. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What do you believe is the answer? Why? |
|
Back to top |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
05 |
|
Back to top |
|
|
soumyanamboo
New User
Joined: 16 Apr 2008 Posts: 13 Location: Chennai
|
|
|
|
I think it is (a) 5
Bcos answer is -5( 10+5 is subtracted from 10) and since it is an unsigned integer, only 5 will get stored
Is it correct? |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
I don't have mainframe access, but I believe you are correct (answer is a)). |
|
Back to top |
|
|
|