There is a variable with value 19446. Requirement is to
convert it to 194.46. I tried it by doing divide by 100 and
my receiving field data type is 9(03)v99. But the output is
194. I am not getting the decimal value. Could anyone pls
let me know how to get this done?
Answer Posted / vaneesh
To make this we require to use redefines.
01 ws-value-change
05 WS-ALPHANUMERIC PIC X(5).
05 WS-NUMERIC REDEFINES WS-ALPHANUMERIC PIC 9(3)
V99.
011 WS-EDITED-NUMERIC PIC 9(3).99.
PROCEDURE DIVISION
MOVE '19446' TO WS-ALPHANUMERIC
MOVE WS-NUMERIC TO WS-EDITED-NUMERIC
DISPLAY WS-EDITED-NUMERIC
STOP RUN
You will get the value as 194.46
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
How do you define a variable of comp-1 and comp-2?
How to print 10 to 1 if the input have only 10 digit number?
What is static and dynamic call in cobol?
What is an in line perform? When would you use it? Anything else you wish to say about it.
How can you get the ksds file records into your cobol program?
EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?
What are the cobol coding sheets?
i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc
2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
what is the difference between COBOL2 AND COBOL390?
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
What are the different data types in cobol?
What the difference is between continue and next sentence?