Programming & Design
Question:
how can I convert a numeric variable to string in COBOL?
Denis G
2008-10-25 12:24:01 UTC
I have a PIC 9(5) variable and I want to convert it to a PIC X(5) variable. How can I achieve that?
Three answers:
KegC
2008-10-25 12:36:25 UTC
Just use the MOVE statement.
MOVE
TO
cho
2016-11-12 01:23:16 UTC
Cobol Substring
TheMadProfessor
2008-10-26 11:25:24 UTC
Simply redefine the field:
05 Some-numeric-field PIC 9(5).
05 Some-display-field REDEFINES Some-numeric-field PIC X(5).
Or (if you want it to be edited), just move it to a numeric-edited field like Some-edited-field PIC ZZ,ZZ9.
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...