Quantcast
Browsing latest articles
Browse All 4 View Live

Answer by Bill Woodger for How to convert Decimal Values to Strings in COBOL

IDENTIFICATION DIVISION. PROGRAM-ID. EXAMPLE. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC X(15). 01 T REDEFINES Y PIC -(5)9(7).99.01 U REDEFINES Y PIC -9(7).99B(4).01 X PIC S9(7)V9(2). PROCEDURE...

View Article


Answer by NealB for How to convert Decimal Values to Strings in COBOL

The fix sometimes involves REDEFINES as in:01. 05 Y PIC X(15). 05 X REDEFINES Y PIC S9(7)V9(2).Notice that X occupies less storage than Y so X can REDEFINE Y but not the other way round. Since both X...

View Article


Answer by cschneid for How to convert Decimal Values to Strings in COBOL

Depending on what you want Y to contain, no.01 VARS. 05 X PIC S9(7)V9(2). 05 Y REDEFINES X PIC X(9). 05 Z PIC -9(7).99. 05 Q PIC X(11). MOVE X TO Z MOVE Z TO Q DISPLAY Y DISPLAY QTry it and see what...

View Article

How to convert Decimal Values to Strings in COBOL

Given following code:VAR X PIC S9(7)V9(2).VAR Y PIC X(15)Following code having compile error.MOVE X TO Y. * compile error.the error message is something like this "cannot move non-integer numbers to...

View Article
Browsing latest articles
Browse All 4 View Live