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

HOW TO MOVE REDEFINES CLAUSE FROM INPUT TO OUTPUT ?

1 Answers  


How can I tell if a module is being called DYNAMICALLY or STATICALLY?

3 Answers   CTS,


what is sync clause?

2 Answers   DELL,


input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?

0 Answers  


can we use variable picture clause as xx.99 in cobol.

3 Answers  






how many maximum no of variables can be declared in linkage section ?

2 Answers   HCL,


What R 2 of the common forms of the EVALUATE STATEMENT ?

1 Answers   Cap Gemini,


What is IMPACT analysis?

2 Answers   IBM,


What will happen if we generate GDG +2 version instead of +1 version?

2 Answers   T systems,


I am sending values a and b with pic x(10) and pic x(10) by using call statement. In linkage section, I am receiving values with pic x(10) and pic x(11). Will my program fail? will it be compile error or run time abend?

3 Answers  


9(2).99 how many bytes take? Why . consider as a byte?

2 Answers  


can we use the two 01 level in file discription ?

6 Answers  


Categories