bug-gnucobol
[Top][All Lists]
Advanced

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

[open-cobol-list] OpenCobol 1.0 MOVE bug?


From: Pieter Baele
Subject: [open-cobol-list] OpenCobol 1.0 MOVE bug?
Date: Fri, 25 Jan 2008 06:10:32 +0100

Hi,

We get lessons cobol on University College, and I try to use OC instead
of legacyj percobol.

When I try to compile the following, I recieve errors (but works in
percobol)

Short version:

fd       artikel.
01       artikel-rec.
        05      verprijs        pic s9(4)V99.
...
working-storage section.
01      titellijn.
        03      artikelnaam     pic x(9) value 'ARTIKEL'.
...
                move verprijs to artikelnaam


It seems it is not possible to move a number field to a string field...
Or maybe our solution is wrong and there is a work-around?

Complete version:
address@hidden ~/cobol]$ cobc -x oef4.cbl 
oef4.cbl: In paragraph 'nieuwe-prijs-par':
oef4.cbl:57: Error: Invalid MOVE statement
oef4.cbl:58: Error: Invalid MOVE statement
oef4.cbl:63: Error: Invalid MOVE statement
oef4.cbl:64: Error: Invalid MOVE statement
oef4.cbl:69: Error: Invalid MOVE statement
oef4.cbl:70: Error: Invalid MOVE statement


000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. oef4A_0708.
       environment division.
       input-output section.
       file-control.
                select artikel assign to "artikel"
                organization is indexed
                record key is artikelnr
                access mode is random. 
       data division.
       file section.
       fd       artikel.
       01       artikel-rec.
                05      artikelnr       pic x(6).
                05      naam            pic x(20).
                05      per             pic xxx.
                05      stock           pic 999. 
                05      aanprijs        pic s9(4)V99.        
                05      verprijs        pic s9(4)V99.
                05      categorie       pic x(4).
       working-storage section.
       01       ws-artikelnr            pic x(6).
       01       prijsverhoging          pic 99.
       01       tussenres               pic s9(6)V99.
       01       nieuwe-prijs            pic s9(6)V99.
       01       winst                   pic s9(7)V99.
       01       nieuwe-winst            pic s9(7)V99.
       
       01       titellijn.
                03      beschr          pic x(20) value spaces.
                03      artikelnaam     pic x(9) value 'ARTIKEL'.
                03                      pic x(5) value spaces.
                03      aang-artikel    pic x(12) value 'ARTIKEL + X%'.
  
       procedure division.
       pgm.
                open i-o artikel. 
                display 'geef artikelnummer'
                accept ws-artikelnr
                move ws-artikelnr to artikelnr
                read artikel invalid key 
                            display 'verkeerd artikelnr - bestaat niet' 
                             not invalid key
                             perform nieuwe-prijs-par
                end-read             
                accept ws-artikelnr
                close artikel.
                stop run. 
       nieuwe-prijs-par.  
                display 'geef prijsverhoging'   
                accept prijsverhoging    
                display titellijn
                multiply verprijs by prijsverhoging giving tussenres
                divide tussenres by 100 giving nieuwe-prijs rounded
                Add verprijs to nieuwe-prijs
                move 'verkoopprijs' to beschr
                move verprijs to artikelnaam
                move nieuwe-prijs to aang-artikel
                display titellijn
                subtract aanprijs from verprijs giving winst
                subtract aanprijs from nieuwe-prijs giving nieuwe-winst
                move 'winst op 1 item' to beschr
                move winst to artikelnaam
                move nieuwe-winst to aang-artikel
                display titellijn
                multiply stock by nieuwe-winst
                multiply stock by winst 
                move 'totale winst' to beschr
                move winst to artikelnaam
                move nieuwe-winst to aang-artikel
                display titellijn.



reply via email to

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