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


Please Help Members By Posting Answers For Below Questions

Explain how to differentiate call by context by comparing it to other calls?

680


When is inspect verb is used in cobol?

670


How do u write test cases?

1631


What is report-item in COBOL?

702


Define cobol?

856






I have to write to a outfile where the number of records in that file should be the header of that file using IMS.. can anyone help me in this issue

1921


If you are current on the owner of a set, what is the difference between obtain next and obtain first?

635


System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..

1583


Write a program that uses move corresponding.

668


What is the difference between binary search and sequential search?

634


Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc

813


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

2097


How do you differentiate between cobol and cobol-ii?

647


How to use the same COBOL program in Batch and CICS on lines? explain with an example

1910


What is cobol?

737