Highlighted
Super Contributor.
Super Contributor.
95 views

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

Jump to solution

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.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

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

Jump to solution

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.

 

View solution in original post

4 Replies
Highlighted
Super Contributor.
Super Contributor.

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

Jump to solution

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.

0 Likes
Highlighted
Super Contributor.
Super Contributor.

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

Jump to solution

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

 

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

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

Jump to solution

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.

 

View solution in original post

Highlighted
Super Contributor.
Super Contributor.

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

Jump to solution

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).

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.