Menu

Compiler listing does not show generated identifiers when using COPY with REPLACING

Anonymous
2023-02-18
2023-02-18
  • Anonymous

    Anonymous - 2023-02-18

    Probably best to demonstrate the problem with an example.

    logger.cbl is a COBOL program that imports a copybook logger.cpy, using a COPY directive with the REPLACING clause. However, when I generate a listing (logger.lst), the listing does show the generated identifiers. I'm expecting the report to contain the generated variable names, such as:

           ******************************************************************
           * logger:   Linkage record layout for logger program             *
           ******************************************************************
    
            01 log-record.
                10 log-source pic x(32).
                88 log-no-source value spaces.
                10 log-request pic x(01) value space.
                88 log-init-log value 'I'.
                88 log-write-log value space.
                88 log-close-log value 'C'.
                10  filler                      pic x(35).
                10 log-log-text.
                    15  filler                  pic x(01) value '['.
                    15  filler.
                20 log-year pic 9(04).
                        20  filler              pic x(01) value '-'.
                20 log-month pic 9(02).
                        20  filler              pic x(01) value '-'.
                20 log-day pic 9(02).
                        20  filler              pic x(01) value space.
                20 log-hour pic 9(02).
                        20  filler              pic x(01) value '-'.
                20 log-minute pic 9(02).
                        20  filler              pic x(01) value '-'.
                20 log-second pic 9(02).
                        20  filler              pic x(01) value '-'.
                20 log-hundredths pic 9(02).
                    15  filler                  pic x(05) value '] :  '.
                15 log-text pic x(4000).
    

    What I see in the listing is that every variable name from the copybook becomes log. The program compiles without any errors, so clearly the compiler is generating the substitutions correctly.

    Is this a known issue with the compiler? Is there a plan to fix it? Is there a workaround?

    I have never seen this issue when compiling with the Micro Focus COBOL compiler.

    I am using GNUCOBOL version 3.1.2.0 on Linux Mint 20.3 with the Cinnamon desktop.

    Thanks for your help.

     
    😕
    1
    • Vincent (Bryan) Coen

      Suggest you upgrade the compiler to v3.2 rc-2 and retry your example
      with a copy of the source file submitted here if it is still not
      producing full o/p.

      I am assuming here you are NOT using any of the option types such as
      SUPPRESS PRINTING or >>LISTING OFF, etc, that will reduce listed 
      expansion of the copybooks. but please also provide the command given to
      cobc when compiling.

      I recommend that you register on sourceforge and then log in when
      posting otherwise your post will be queued until some one moderates your
      posts which could be some days as it is a manual process.

      Vince

       
  • Mickey White

    Mickey White - 2023-02-18

    Have you searched the discussion for replacing issues? I seem to recall there were some discussions.
    If you register, your posts wont set out waiting for a Mod to ok it.

     

Anonymous
Anonymous

Add attachments
Cancel