openmainframeproject / cobol-check

A testing framework for Cobol applications
Apache License 2.0
78 stars 28 forks source link

File Statement need FIX #333

Closed samdion1994 closed 9 months ago

samdion1994 commented 10 months ago

Hi @Rune-Christensen,

I happened to see this error the other day. Care to share your thoughts?

    String s1 = "       WORKING-STORAGE SECTION.";
    String s2 = "       PROCEDURE DIVISION.";
    String s3 = "       851-PLACEHOLDER.";
    String s4 = "           READ THIS-FILE INTO THAT-VARIABLE";
    String s5 = "               AT END";
    String s6 = "                 DISPLAY ALLO"; 
    String s7 = "           END-READ";  

ends up giving me

image

" READ THIS-FILE INTO THAT-VARIABLE"; " AT END"; " DISPLAY ALLO"; " END-READ";

I could comment the whole thing but then how would we test the AT END.

I can fix it, just not sure how to go about it thanks!

Rune-Christensen commented 10 months ago

Hi @samdion1994

There is a lot of work not yet done, regarding file management. This is one of the situations, that cannot yet be managed by COBOL Check. We usually recommend our developers, to isolate the code that needs to be mocked, inside a new section or paragraph, and then mock the section.

In this situation that is not enough, because the compile will fail.

Atm. I suggest commenting the entire read - end-read statement. Regarding testing the at end statement, I currently have no good answer to that.

samdion1994 commented 9 months ago

Thanks for the input :)