#36 Copy replacing error in fixed format

unclassified
open
None
5
2014-07-28
2012-04-02
No

When a program with fixed format have the sentence

       COPY EXAMPLE REPLACING ==:REG:== BY ==EXAMPLE==.

Expanding the copybook could cause some errors if the replacing produce a line greather than 72 characteres.

Copy EXAMPLE.CBL

001000 01  :REG:.                                                       
001800     05 :REG:-ENTRADA.                                         
001900        10 :REG:-CLAVE                     PIC X(100).         
002000        10 :REG:-CLAVE-C01001 REDEFINES :REG:-CLAVE.           
002100           15 :REG:-C01001-COD-ENT-GR      PIC S9(5)       COMP-3.
002200           15 :REG:-C01001-C-ITN-BCGR      PIC S9(3)       COMP-3.
....

Discussion

  • Simon Sobisch

    Simon Sobisch - 2012-10-09

    I don't see the problem here, fixed format code should not extend 72 characters, so this is like it should, isn't it?

    sf-mensch

     
  • Sergey Kashyrin

    Sergey Kashyrin - 2012-10-24

    Not confirmed. Human said right - don't miss CR/LF etc.
    Need to close this one (I think)

     
    Last edit: Sergey Kashyrin 2012-10-24
  • Simon Sobisch

    Simon Sobisch - 2012-10-25

    OK, I just read the 2002 ISO standard about COPY statement. "6.5 Logical conversion
    [...] library text in fixed-form reference format [is] logically converted to free-form reference format before the application of replacing and conditional compilation actions."
    Therefore it shouldn't matter how long the line becomes. OC seems wrong here (but don't expect a quick fix as this would be a parser rewrite).

    sf-mensch

     
    Last edit: Simon Sobisch 2012-10-25
  • Brian Tiffin

    Brian Tiffin - 2012-12-15
    • assigned_to: Brian Tiffin
     
    Last edit: Simon Sobisch 2014-01-10
  • Brian Tiffin

    Brian Tiffin - 2012-12-15

    I'll take a crack at ensuring this works.

     
  • Vincent (Bryan) Coen

    BT, good luck but see my comment on my tool prtcobol.
    It was a function I was debating adding but my photography got in the way and I put it on the back burner to see if anyone complained.

    Nope no one did.

    May be, no one is using it :)

     
    Last edit: Vincent (Bryan) Coen 2013-02-16

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks