cobol-check icon indicating copy to clipboard operation
cobol-check copied to clipboard

Fix db2

Open samdion1994 opened this issue 1 year ago • 5 comments

Fix the expands db2 copybooks.

samdion1994 avatar Oct 24 '23 11:10 samdion1994

Hi @samdion1994

Thank you for the tests, it helped tremendously in understanding what is happening.

With that understanding now in place, I cannot approve the pull request, because the expansion of the copybook is no longer happening "in place". Meaning, we cannot move the working storage elements, to other locations in working storage. Consider this example:

EXEC SQL INCLUDE TEXEM  END-EXEC.
01  TEXEM2 REDEFINES TEXEM.
   10 FULL-NAME PIC X(20).
   10 FILLER PIC X(26).

The current changes would move TEXEM below the redefine, meaning the compile would fail.

Looking at the code again, I think the insertion of code is in the correct location, the issue is, that .getFileSectionStatements() is a bad name. Either the function is misused in this context, and there ought to be another function managing the expansion of copybooks, or the function should have another name, making it useable in more contexts.

Cheers, Rune

Rune-Christensen avatar Oct 27 '23 06:10 Rune-Christensen

Hi @samdion1994 Thank you, the new function is a much better encapsulation of what is happening in the code.

But, the changes still moves the expanded copybook to a new location, that will have to be fixed before approval. Thank you

Cheers

Rune-Christensen avatar Oct 29 '23 17:10 Rune-Christensen

Hi @samdion1994 Any progress on reverting the changes, that causes the expansion of SQLCA/TEXEM to move from where it was?

Regards Rune

Rune-Christensen avatar Nov 13 '23 12:11 Rune-Christensen

Hi rune, Sorry been busy!

Probably this week :)

samdion1994 avatar Nov 16 '23 00:11 samdion1994

Hey @Rune-Christensen,

Think you can merge this and I could do another fix later?

There a lot of stuff I need to change for this request and little time, but I get what you're saying and I agree that this needs to be fixed. Also I think we might have the same problem with the file section expander.

samdion1994 avatar Nov 16 '23 02:11 samdion1994