Is it possible to have mixed format Cobol programs in a workspace?
With some versions of Cobol, particularly ACU Cobol, it is possible to have a program where area A starts in column 1 and copybooks where area A starts in column 8. Can these source files be loaded into EA?
It is possible to have mixed format source files and copybooks. A single program or copybook must be in only one format, ie area A starts in column 1 or in column 8. A single file cannot have a mixed layout.
What is possible is that a program can be in one format and the copybooks that it uses in another format. An example of this is the standard ACU demo of WinHelp.cbl and the winhelp.def copybook.
From Enterprise Analyzer (EA) 3.4 Hot Fix 8 and EA 3.5 Hot Fix 2 there is now a new workspace option for the ACU Cobol dialect called "Attempts to Resolve Mixed Formatting Styles..” (see screenshot attached). This needs to be selected as by default is it turned off.
When using source files that start in column 1, then the workspace needs to be configured to allow this. For more information on how to configure this support see Can I change the Cobol source format within EA?
With both the new option selected and the legacy.xml changes in place, the following now will happen:
The starting positions will be adjusted according to the first line of each file automatically. While the length of Area A and Area B will be calculated according to the legacy.xml (e.g. Area B End – Area B Start = 129).
If there is not a legacy.xml, and the new option is used, the starting positions will be adjusted automatically as before. However, the lengths of each area will be the default ones for ACU Cobol, or Area A = 4 and Area B = 61.
Note: If the first line does not represent the correct formatting style of the particular file the margins will not be set correctly and errors could occur. These errors can include processing comment lines as though they were source files, processing source lines incorrectly etc.
Screenshot of new workspace option