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

Can you call an OS VS COBOL pgm from a VS COBOL II pgm ?

3 Answers   Microsoft,


Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.

0 Answers   iNautix,


We are using the searching a table which is indexed, once the key is found, how can we get the occurance at which the key was found.

1 Answers  


can we declare occurs in 01 level?

2 Answers   Temenos,


If there are two files one with 100 records and other with 101 records. we have to find out the one record that is the odd man out . What are the steps to do it

7 Answers   BirlaSoft,






how do u indetify files succesfully executed or not ?

4 Answers   TCS,


IF I mention stop run in CICS what happens?

0 Answers   IBM,


what happens if parmparameter passes zero bytes to the program

0 Answers   HSBC,


Which of the following files can be OPENed in all the 4 modes? The four modes are INPUT, I-O, OUTPUT and EXTEND. (a) INDEXED (b) RELATIVE (c) SEQUENTIAL (d) All of the above

7 Answers   TCS,


if i am reading a file with some 50000 records and moving to a DB2 table and suddenly the program abends in between, is there anyway i could restart from the exact record at which the job failed once the program restarts.

2 Answers   UST,


If by mistake we MOVE a working storage variable into LINKAGE area. What will happen??

4 Answers   Accenture,


tell me about examine inspect and evaluate ?

2 Answers   CTS,


Categories