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

Suppose i have a Cobol field of 10 byte. it contains a decimal sign.How to know where is the point location?

1 Answers  


Difference between cobol and cobol-ii?

0 Answers  


diffrence between z(2) and z9(2)

4 Answers   Cap Gemini,


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

1 Answers  


write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

0 Answers  


HI THIS IS ANIL. HOW TO PASS A RECORDS OF A FILE(PS OR PDS) TO AN ARRAY?

2 Answers  


01 text-data pic x(100). move 'xyzdbfrjjg u' to text-data. how to find the value of last index of text-data?

3 Answers   Mind Tree,


have in 100 records in a flat file i want to move records like 1,3,5,7,9,11,.. to Output file1 and 2,4,6,8,10,12,14 .. records moved to Output file2..Pls Provide real time answer..

5 Answers   TCS,


What are 77 levels used for?

0 Answers  


In an EVALUATE statement, can I give a complex condition on a when clause?

2 Answers  


What is the difference between performing a SECTION and a PARAGRAPH?

5 Answers   Accenture, Patni,


What are different data types in cobol?

0 Answers  


Categories