Consider the following COBOL entries:
05 X PIC 99 VALUE 10.
SUBTRACT 20 FROM X.
The resultant value of X wil be
Answers were Sorted based on User's Feedback
Answer / sayan
since no sign clause is mentioned, the minus sign is
ignored and the resultant value of X will be 10.
Is This Answer Correct ? | 16 Yes | 1 No |
Answer / rajiv gupta
Answeer would be 10. as 20 -10 should be -10 but X is not
declared as signed variable as S9(2)so answer is 10.
Is This Answer Correct ? | 5 Yes | 1 No |
Answer / swappy
Answer #3 is correct. Since there is no sign clause it will
just ignore the -ve sign and resultant will be 10.
Also Prabhu, there is no problem with the level no. There
will not be any error due to the level no.
Is This Answer Correct ? | 4 Yes | 1 No |
Answer / madhu
x=x-20 will be -10
Since there is a -ve sign in the beginning it'll be stored
on top of the last digit. So -0 = }.
Then ans will be 1}
Is This Answer Correct ? | 4 Yes | 4 No |
Answer / prabhu shankar
If u see the level number itself u can able to say that it
will show error. Because PIC will have the level number 77
and not like 01,02,03.
So it show the error only.Wll not exucute.
I think so. If any wrong plz apologise me.
Is This Answer Correct ? | 1 Yes | 7 No |
what if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9(4) ........ IF(B NUMERIC) ADD 10 TO C a.the condition in the if statement is wrong b.noting is wrong c.because C is initialised.ADD 10 TO C is wrong d.both B and C shoud have same size.
can you declare redefine in level 01?
How is sign stored in a COMP field ?
I encountered an error when I move spaces to a numeric field?What should I do to move spaces on that field?help please.
what modification we need to do in jcl if we use sort in cobol? I mean whether we need to include tempary file used for sorting in assign statement?
What are all the divisions of a COBOL program?
What is difference between com and com3? Eg. s9(4) so what is the memory it will occupy com and com3.
what is the advantage of sync class
What are the functions like c or c++ in cobol?
Can you please let me know the centre name of INS certification in Kolkata.
what is Reentrancy and Quasi-reentrancy?
i Want All cobol ERROR codes?