Can I set the source format to FREE for Copybook files?

In my project I've set the project properties to use the FREE source format.

But that format doesn't seem to apply to Copybook files.

Am I doing something wrong? How can I have Copybook files use the FREE source format?

Your answer is appreciated.

  • I found the reason for this behaviour myself now:

    I accidentally had the Force Upper Case In Editor mode selected from the COBOL toolbar. After deselecting that mode I was able to edit the Copybook file as usual.

  • Today I created a new Copybook file, and again it's set to FIXED. Neither can I edit that source format nor am I able to reset it to project defaults.

    How can I have new copybooks adhere to my project settings and be in FREE source format?

     

    Copybook FIXED format.png

     

  • Verified Answer

    Copybooks might not inherit the project settings until they are included within a program. This is of course something we could look into improving.

    Alternatively, it is common practice to set the source format at the beginning of a shared copybook so that it can be included in any source format program by writing the following at the top of the copybook file:

          $set sourceformat(free)
    01 grp.
    03 grp-a pic xxxx.
    03 grp-b pic xxxx.

     

  • Thanks a lot for sharing this valuable piece of information with me!

    With your information I now got two options to work with to get my copybook code formatted in FREE style.

    I apprehend that it's kind of necessary to have the style written in the copybook file itself, as it may be included by different programming teams adhering to different programming styles.

    Well, and yes, I guess a preferences setting might be helpful to assume a particular formatting for "unbound" copybook files. I also believe, such setting would be helpful to be read from an .editorconfig file (if such option may be available in the future).