Readable and maintainable COBOL code #131
Unanswered
FALLAI-Denis
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
This discussion is a bit on the sidelines of the Z Open Editor issue, but maybe Z Open Editor could bring changes to meet our needs in part.
We are currently leading a project to withdraw from a tool (IBM VisualAge Pacbase) which is a COBOL code generator in favor of a solution based on VS Code and IBM Z Open Editor.
Among the subjects that we must address, there is that of the transformation of the generated COBOL code (known to be difficult to maintain: linear code, without nesting of instruction blocks, and numerous GO TOs to manage sequence breaks) into readable and maintainable COBOL code.
We are trying to determine the readability and maintainability (and probably also testability) criteria of a COBOL source code.
We would also like to take into account some programming language facilities of our COBOL code generator which is a superset of the base COBOL language.
In particular, this language has instructions making it possible to exit to a level of nesting higher than the current level, or to return at the start of the iteration to a level higher than the current level of nesting. To illustrate this corresponds to the leave and iterate instructions of the Rexx language, where we can indicate a reference to a level.
Native COBOL does not allow this: COBOL V6 provides ease with the exit paragraph, exit section, exit perform instructions, but this is limited to the current level, not to several nesting levels, (we made an RFE to have an evolution allowing to specify a disconnection reference, but it was rejected).
We also want the COBOL code that will be written with Z Open Editor, but also the COBOL code that will be migrated (and probably reformatted / restructured) from our generator to meet a corporate standard: that all programs of the same typology (batch / CICS) all have the same organization and coding style.
Where Z Open Editor could help us is by offering ease of inserting and deleting block levels, moving blocks, changing the nature of a block (nature: sequence, iteration, alternative).
We believe this is only possible if the COBOL source code meets a writing standard.
If Z Open Editor does not offer these code manipulation facilities, (which can be difficult because each company can define its own standards), we think we can develop an extension that supports it.
Our subject is to define this standard. Either a standard specific to our company, or a de facto standard recognized by the community of COBOL developers.
We did some research and couldn't find any really relevant information about standardizing COBOL source code.
We have also experimented with different solutions, but none is completely satisfactory:
We would be happy to hear from the COBOL developer community on this topic:
Thanking you.
Beta Was this translation helpful? Give feedback.
All reactions