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
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 |
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 |
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 |
Answer / sowjanya
give like below.
DISPLAY A SIGN LEADING SEPARATE.
| Is This Answer Correct ? | 1 Yes | 0 No |
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 |
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 |
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 |
1.What is the limit of linkage section?
SIGN TRAILING SEPARATE field occupy ?
What is the Purpose of POINTER Phrase in STRING command in COBOL?
Read a flat file and write last but one (I have n records in a file I have to write n-1th) record in another flat file. Could you please provide me the code in COBOL?
What is the Importance of GLOBAL clause According to new standards of COBOL?
Write the code implementing the perform … varying.
how to display the dataset information?
What is the difference between Perform para and perform asaection in cobol?
how to transfer the file from pc to mainframe??
What is the default value of DISP parameter?
How many times the loop runs here 01 a pic 9(2) value 1. perform para1 until a=10 move 1 to a. stop run. para1: move 10 to a.
What will happen if a variable is declared as below.. Explain with an example? Working storage section:- 01 WS-VARX PIC X(10) VALUE 'ABCDEFGHIJ'. 01 WS-VARN REDEFINES WS-VARX PIC 9(5) VALUE '12345'. What will happen I want Display WS-VARX and WS-VARN?