01 a pic s9(5) value -12345,
if we disply a , the sign will overpunched with last digit
but i need to get the miuns sign in the result?

Answers were Sorted based on User's Feedback



01 a pic s9(5) value -12345, if we disply a , the sign will overpunched with last digit but i ..

Answer / david

you will need two variables. Variable A where you put your
computation and variable B which will be displayed:

01 a pic s9(5) value -12345.
01 b pic -9(5).
or 01 b pic -zzzz9.
or 01 b pic 99999-.
or 01 b pic z(5)-.
or 01 b pic ----9.

MOVE A TO B.
DISPLAY B.

Is This Answer Correct ?    7 Yes 0 No

01 a pic s9(5) value -12345, if we disply a , the sign will overpunched with last digit but i ..

Answer / satish

01 a pic -9(5) value -12345

Answer : either of the below :

01 a pic -9(5) value -12345 will working without any
changes or
01 a pic 9(5) value -12345 leading seperate

Is This Answer Correct ?    2 Yes 0 No

01 a pic s9(5) value -12345, if we disply a , the sign will overpunched with last digit but i ..

Answer / saravana

01 A pic s9(5) value -12345
01 B pic -9(5)
PROCEDURE DIVISION
MOVE A TO B
DISPLAY B
STOP RUN

o/P:
-12345

Is This Answer Correct ?    2 Yes 0 No

01 a pic s9(5) value -12345, if we disply a , the sign will overpunched with last digit but i ..

Answer / sowjanya

give like below.

DISPLAY A SIGN LEADING SEPARATE.

Is This Answer Correct ?    1 Yes 0 No

01 a pic s9(5) value -12345, if we disply a , the sign will overpunched with last digit but i ..

Answer / mr.perfect

01 A pic s9(5) value -12345
01 B pic +9(5)
PROCEDURE DIVISION
MOVE A TO B
DISPLAY B
STOP RUN

o/P:
-12345

Will this work?

Is This Answer Correct ?    1 Yes 0 No

01 a pic s9(5) value -12345, if we disply a , the sign will overpunched with last digit but i ..

Answer / anil prajapati

For displaying sign in the result we have to declare a
variable with negative sign symbol
e.g. 01 b pic -9(5).

in this variable we will this value

Is This Answer Correct ?    0 Yes 0 No

01 a pic s9(5) value -12345, if we disply a , the sign will overpunched with last digit but i ..

Answer / sreejith

01 a pic -9(5) value -12345
or
01 a pic x(6) value '-12345'

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More COBOL Interview Questions

What does EXIT do ?

3 Answers   Deloitte,


what is the difference between occurs and occurs depending on? i dont think so there is the difference in storage..then why we should use occurs depending on?

9 Answers   TCS, Tech Mahindra,


COMP-3 field occupy ?

8 Answers  


What care has to be taken to force program to execute above 16 Meg line?

1 Answers  


can any one help -s806

6 Answers  






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,


How can we increase the size of an existing PDS to include more no. of modules.

3 Answers  


which generation language is cobol

4 Answers   Kanbay,


Can we access the a[0] in the array ?

6 Answers   DCL, IBM,


in how many mode we can open a file ?

4 Answers  


How to retrive the 9th records out of ten records using the cobol program ?

3 Answers   UST,


How does IDMS communicate with CICS?

1 Answers   Covansys, Satyam,


Categories