If i have a variable
A pic 9(2) value 10
Compute A = a - 100

what will be the value of A and will there be any error
becoz of the Negative value

Answers were Sorted based on User's Feedback



If i have a variable A pic 9(2) value 10 Compute A = a - 100 what will be the value of A and w..

Answer / chandrakant sinha

90 will be the output
No error will be generated.

Is This Answer Correct ?    10 Yes 2 No

If i have a variable A pic 9(2) value 10 Compute A = a - 100 what will be the value of A and w..

Answer / garry

From above you will get answer as :

90 (without any sign'-').

If you Code S9(02).
Result : 9} (-90)
To get -90 properly, use SIGN is Leading or trailing.

Any difference, please write at : thespider390@hotmail.com

Is This Answer Correct ?    1 Yes 0 No

If i have a variable A pic 9(2) value 10 Compute A = a - 100 what will be the value of A and w..

Answer / kiran

90 ill come "-" sign wont come bcoze we didnt mention A as a
signed variable

ex

A pic s9(2)

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More COBOL Interview Questions

Please let me know at which Scenarios we will go for STATIC call or DYNAMIC

3 Answers   IBM,


What is difference between comp & comp-4?

6 Answers  


What rules are to be followed while using the corresponding options?

0 Answers  


I have a Flat file in which certain records are present in a tabular format. I need to extract some of the records on some basis from it and copy them into a flat file...how it can be done ??

2 Answers   HCL,


01 a pic 9(6) value is 123456 01 b pic 9(3) move a to b wht will be the value ?

6 Answers   Patni,






What is an in-line perform ?

4 Answers   Accenture,


What is the significance of 'above the line' and 'below the line'?

2 Answers   Nokia,


WE HAVE 5 DIFFERENT RECORDING MODE IN COBOL.FIXED, FIXEDBLOCK, VARIABLE, VARIABLEBLOCK AND UNDEFINED. WHAT IS THE DIFFERENCE AMONG ALL AND WHICH TYPE OF FORMAT SHOULD BE USED WHEN

3 Answers   Infosys,


I got user abend U4038 while compiling my runjcl.. can anyone help me?

10 Answers   CGI,


COBOL Snippet: Tell where the control will when the below code execute IF (A=B) CONTINUE ELSE NEXT SENTENCE PERFORM <IMP-STMT> END-IF.

7 Answers   HCL,


Consider the following code: 77 A PIC 99V99 VALUE 55.35 77 B PIC 99V999 VALUE 32.754 ADD B TO A ON SIZE ERROR DISPLAY "ERROR!!!" What will be the result ? (a) A=88.10, B=32.754 (b) A=87.00 B=32.754 (c) A=87.10 B=32.754 (d) ERROR!!! will be DISPLAYed on the screen.

3 Answers   TCS,


Write the code to count the sum of n natural numbers.

0 Answers  


Categories