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 |
Extract only those records from a PS file which are having word 'TEXT' in the records using COBOL? The word TEXT is not present in a particular position in all the records.
Can printer files (having 133 characters) be of variable length?
soc-7 is a bad data,invalid data. when ever we are moving the alphabets in the position of numeric then we got this abend. so my question is if o1 ws-data pic 9(1) value passing the alphabet some x. then we got soc-7 or not? i want clarification ?
What will happen if we move SPACES to numeric field and ZEROES to alphabetic field?
what do you mean by copybook? and what is the difference between the copybook which we are using in working storage and procedure division.
whn do i get soc7 abend while moving alphanumeric to numeric or while moving numeric to aplhanumeric please reply ASAP?
what is s000 u4087 error? please give the all error codes in cobol,jcl.
How To move a value to an array using move verb?
which certifications r 4 cobol,jcl,db2,cics what is format of xam n what is importance of these certifications... plz post answer only if u r sure... thanks
Can you REWRITE a record in an ESDS file? Can you DELETE a record from it?
6 Answers ABC, IBM, Mphasis, Wipro,
What are ISOLATION LEVELS? Where do we need to specify them?
if a file has 1000 recods how copy the records from 1 to 100 records using sort