01 ws-p pic 9(2).
01 ws-q pic 9(2) value 01.
01 ws-r pic 9(2) value 99.
p.d.
compute p = q + r
what will be result of p ans(00) but my question is that
how i got 10 on the place of 00.
(truncation will ocuure on right side not left).
please tell me ?
Answer Posted / sam
01 p pic 9(02) value zero.
01 p1 pic 9(03) value zero
01 q pic 9(02) value 99.
01 r pic 9(02) value 1.
01 s pic x(02) value spaces.
p = q+r.
actual p value = 100. but p value is numeric so it writes
from right to left tuncations will be taken left side.
so p value = 00 if u want p = 10
but we cann't use justifications
since justification claue works on alphanumeric field.
so compute p1 = q+r.
move p1 to s . ( here s will contain value 10)
now move s to p.then p will be 10.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is comp-1 and comp-2?
what happens if parmparameter passes zero bytes to the program
How do you get the data to code the BMS macro?
What are the different rules to perform a Search?
) How do u handle errors in BMS macro
what is amode(24), amode(31), rmode(24) and rmode(any)?
Difference between array and sub-script ?
What is the difference between goback, stop run and exit program in cobol?
How do you reference the following file formats from cobol programs?
Write a cobol program making use of the redefine clause.
What is the problem of ordered sequential files access?
What is the difference between a binary search and a sequential search what are the pertinent cobol?
Difference between cobol and cobol-ii?
How you can characterize tables in cobol?
Define cobol?