COPYBOOK Naming Conventions in Visual COBOL versus RM/COBOL

[Migrated content. Thread originally posted on 24 February 2011]

Hello, I'm having an issue when I try to build my project. My initial program has a copybook statement as follows: COPY "LS/POPUP". My copybooks are stored under a folder called COPY with subfolders called DS, LS, FC, FD, WS, etc.. The compiler is trying to use the wrong copybook. It is locating WS/POPUP instead of LS/POPUP. When I check the dependencies under the program's COBOL File Properties, it shows COPY\WS\POPUP.cbl. How can I alter the dependency to point to the correct copybook, or do I have to change my naming conventions for my copybooks?
  • There may actually be a bug here that I will investigate but the only way that I can currently get this to work is:

    Modify copybook to point to full path name:

    COPY "C:\Copy\LS\POPUP".

    or to remove the folder name from the copy and add a copybook Path to the Copybook Path tab of the Properties page:

    COPY "POPUP".
    with Copybook Path set to:
    C:\Copy\LS\
  • Thanks Chris for looking into this. I'm not sure your solutions will work for us. Unfortunately, we use the same copybook name in different parts of our code. For example, we have a file called SICNTL. We create copybooks, "FC/SICNTL", "FD/SICNTL", "DS/SICNTL" and "PD/SICNTL". These are four different copybooks stored in four different subfolders. We have multiple versions of our software and each version is using a different main folder, i.e. \RMS620\COM\FC versus \RMS611\COM\FC. I was using "\COPY" as an example in my original post. So we can't hardcode the path and pointing the program to use a specific copybook will not allow me to use all four.

    Any other suggestions?
  • Thanks Chris for looking into this. I'm not sure your solutions will work for us. Unfortunately, we use the same copybook name in different parts of our code. For example, we have a file called SICNTL. We create copybooks, "FC/SICNTL", "FD/SICNTL", "DS/SICNTL" and "PD/SICNTL". These are four different copybooks stored in four different subfolders. We have multiple versions of our software and each version is using a different main folder, i.e. \RMS620\COM\FC versus \RMS611\COM\FC. I was using "\COPY" as an example in my original post. So we can't hardcode the path and pointing the program to use a specific copybook will not allow me to use all four.

    Any other suggestions?
  • Thanks Chris for looking into this. I'm not sure your solutions will work for us. Unfortunately, we use the same copybook name in different parts of our code. For example, we have a file called SICNTL. We create copybooks, "FC/SICNTL", "FD/SICNTL", "DS/SICNTL" and "PD/SICNTL". These are four different copybooks stored in four different subfolders. We have multiple versions of our software and each version is using a different main folder, i.e. \RMS620\COM\FC versus \RMS611\COM\FC. I was using "\COPY" as an example in my original post. So we can't hardcode the path and pointing the program to use a specific copybook will not allow me to use all four.

    Any other suggestions?
  • It appears that this form of the copy statement is not currently supported but development is looking into it.
    Thanks for your patience!
  • Verified Answer

    As an alternative based on your copybooks directory structure , the following may be used:

    Specify copybooks location relative to the COBOL source:
    copy "Copylib/RM/Copy01".
    copy "../RMCopy/Copylib/RM/Copy01".
    copy Copy01 of "../RMCopy/Copylib/RM".
    copy Copy01 of ../RMCopy/Copylib/RM.

    Under Windows SUBSTitute a drive letter to your base copybook directory
    (for example subst Z: Y:\...\RMS6111\COM)

    copy "Z:/RM/Copy01".

    Using "/" or "\" will be accepted.