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 |
write a program to eliminate duplicate records in a input file and send them to output file.THIS IS IGATE RECENT QUESTIONN.....JUST 1 WEEK BACKKKK...
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.
How To Separate The Numerics From An Alphanumric Data Item Which Contains Both Alphabates And Numerics ?
wht is the diff b/w if and evaluate stmts ?
give the examples of strings in cobol
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
comp-3 field occupy?
Consider the below example call a-test1. -- -- -- a-test1. if a=b perform a-test through a-exit next sentence else if b=c perform c-test through c-exit. if a=d perform d-test through d-exit. a-test. -- -- a-exit. exit. can u tell me what will happen if a=b after looping into a-exit will the control go back to a- test1. will the condition a=d be checked???
How can you get the ksds file records into your cobol program?
How did the release of cobol/370 version 1.3 improve the performance of release 1.1?
I have a field with data type X(10). I want to perform arithmetic operation on this field? I tried doing it by moving the value into a numeric field. but it didn't work out. I am getting a S0C7 abend. Pls let me know if there is any way of getting this done?
Describe the difference between subscripting and indexing ?