gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[open-cobol-list] numeric edited, MOVE


From: Hans-Martin Rasch
Subject: [open-cobol-list] numeric edited, MOVE
Date: Mon Mar 20 08:47:05 2006
User-agent: KMail/1.6

Hi, 

there are problems with the MOVE of numeric edited fields if the decimal point 
is defined implicitly by "V" or "P":

         05 FIELD1                      PIC  S99V99.
         05 FIELD2                      PIC  -99V99.
         05 FIELD3                      PIC  PPB99.
         05 FIELD4                      PIC  99BPP.
         05 FIELD5                      PIC  9999V9999.
          .
           MOVE -12.34        TO FIELD1.
           MOVE FIELD1      TO FIELD2.
           DISPLAY FIELD1 " " FIELD2.
           MOVE -12.34        TO FIELD2.
           MOVE FIELD2      TO FIELD1.
           DISPLAY FIELD1 " " FIELD2.
           MOVE 0.001         TO FIELD3.
           MOVE FIELD3      TO FIELD5.
           DISPLAY FIELD3 " " FIELD5.
           MOVE 100           TO FIELD4.
           MOVE FIELD4      TO FIELD5.
           DISPLAY  FIELD4 " " FIELD5. 

gives the output

           1234-  -12.3
           1230   -12.3
           4   00040000
           01 00010000

The diff of my attempt to fix move.c is appended.


Hans-Martin Rasch

Attachment: move.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]