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

Hi, My interviewer ask A calls B and C calls B, a and b are static c and b are dynamic.what happens if they compile and execute at same time.

3 Answers   iGate,


What is the different between index and subscript?

3 Answers  


I have a COBOL main program which is calling sub program, the number of calling parameters used in main program are 4 whereas in sub program it's 5. Sub program is passing 5 parameters back to main program Will there be any compilation error? Or main program parameters displays junk values?

1 Answers  


period is missing in the cobol program which error we getting

5 Answers   TCS, Tesco,


What is the Purpose of POINTER Phrase in STRING command in COBOL?

0 Answers   Winsol Solutions,






How do you compile cobol program..?

1 Answers  


What do you understand by passing by reference and passing by content?

1 Answers  


I have a variable account-number declared as comp-3, s9(10) comp-3 in a file. How do i find a particular account number say 123456 in that file?

3 Answers  


What is the use of LINKAGE SECTION?

1 Answers  


What does MAXCC 3 means? It is used in one my codes.

2 Answers   Wipro,


I have two questions here. 1. How to read a flat file in reverse order? 2. How to read a VSAM KSDS file in reverse order? In both the cases we donot know the total number of records.

2 Answers   L&T,


What is length is cobol?

0 Answers  


Categories