Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NLE getChild(int) is null #69

Open
ravijp opened this issue Nov 25, 2024 · 12 comments
Open

NLE getChild(int) is null #69

ravijp opened this issue Nov 25, 2024 · 12 comments
Assignees

Comments

@ravijp
Copy link

ravijp commented Nov 25, 2024

Hi @avishek-sen-gupta,

I am trying out the tool on some cobol files and I get following error -
image

Could you let me know possible reasons for this kind of errors and what kinda resolutions are required?

@ravijp ravijp changed the title NLP getChild(int) is null NLE getChild(int) is null Nov 25, 2024
@avishek-sen-gupta
Copy link
Owner

Please add the following details to help identify the issue.

  • The smallest COBOL program which can reproduce this issue (remove all code/data which does not contribute to reproducing the issue)
  • The exact task(s) you are trying to run, together with the command that you issued in the shell.
  • The stack trace (which you have already provided)
  • Your platform details (you can paste the output of mvn --version)

@ravijp
Copy link
Author

ravijp commented Nov 26, 2024

@avishek-sen-gupta
it is tough to recreate full COBOL program as it uses copybook files and code is sensitive. I am sharing a gist of the code

      *****************************************************************

           PERFORM INITSTART THRU INITSTART-EXIT.                    

           PERFORM WRITEQTDQ  THRU TDQ-EXIT.
       
           PERFORM TERMIN  THRU TERMIN-EXIT.

      *****************************************************************
       INITSTART.                                              
      *****************************************************************
      ... 
      *****************************************************************
       WRITEQTDQ.
      *****************************************************************
       
           EXEC CICS
                WRITEQ TD
                QUEUE   ('TERR')
                FROM    (MSGE-RCRD)
                LENGTH  (LENGTH OF MSGE-RCRD)
                NOHANDLE
           END-EXEC.
       
           IF EIBRESP >  0
               PERFORM WRITECONSOLE THRU WC-EXIT
           END-IF.
       
       TDQ-EXIT. EXIT.
      *****************************************************************
       WRITECONSOLE.
      *****************************************************************
       
           MOVE EIBRESP    TO WSC-EIBRESP.
           MOVE MSGNO      TO WSC-MSGNO.
       
           EXEC CICS
                WRITE OPERATOR
                TEXT  (WSC-MSG)
                TEXTLENGTH (62)
                EVENTUAL
           END-EXEC.
       
       WC-EXIT. EXIT.

      *****************************************************************
       TERMIN.
      *****************************************************************
       
           EXEC CICS RETURN END-EXEC.
       
       TERMIN-EXIT. EXIT.
       

I comment the section relevant to PERFORM WRITEQTDQ THRU TDQ-EXIT., I can run the code and generate flowchart.

Error is coming from this section.
I checked the syntex using boradcom package - copybook dependecy etc. everything looks fine.

Let me know your thoughts

@avishek-sen-gupta
Copy link
Owner

avishek-sen-gupta commented Nov 27, 2024 via email

@avishek-sen-gupta
Copy link
Owner

Please re-run using the latest commit and share the output in a file. Have added some logging to diagnose the situation.

@ravijp
Copy link
Author

ravijp commented Nov 27, 2024

@avishek-sen-gupta I am running following command-
java -jar /home/rprakash/cobol-rekt/smojol-cli/target/smojol-cli.jar run COBOFILE --commands="DRAW_FLOWCHART" --srcDir "/home/rprakash/codelocation/programs" --copyBooksDir="/home/rprakash/codelocation/copybook/","/home/rprakash/codelocation/db2copy/" --dialectJarPath /home/rprakash/cobol-rekt/che-che4z-lsp-for-cobol-integration/server/dialect-idms/target/dialect-idms.jar --reportDir out/report --generation=PROGRAM

Error after rebuilding using the latest commit -
image

@ravijp
Copy link
Author

ravijp commented Nov 27, 2024

This time error is in first part. I am sharing the first part code INITSTART.

I tested by commenting relevant to each PERFORM section.

      *****************************************************************

           PERFORM INITSTART THRU INITSTART-EXIT.                    

           PERFORM WRITEQTDQ  THRU TDQ-EXIT.
       
           PERFORM TERMIN  THRU TERMIN-EXIT.

      *****************************************************************
       INITSTART.                                              
      *****************************************************************
      
           MOVE CBOOKAREA TO SQLCA.
       
           CALL WTIARDSN USING SQLCA
                           ERRMSG
                           ERRTXTLEN.
       
           EXEC SQL SET :SVPKG = CURRENT PACKAGESET END-EXEC.
           MOVE SVPKG(1:8) TO SVCOLID.
           STRING '****** THE CURRENT PACKAGE IS '
                  SVCOLID '  ******'
              DELIMITED BY SIZE
                 INTO CMNTXT(317:386).
       
           MOVE ERRMSG (3:790)  TO CMNTXT(396:869).
           MOVE +1106                         TO COMN-TXTLEN. 
      *****************************************************************
       WRITEQTDQ.
      *****************************************************************
       
           EXEC CICS
                WRITEQ TD
                QUEUE   ('TERR')
                FROM    (MSGE-RCRD)
                LENGTH  (LENGTH OF MSGE-RCRD)
                NOHANDLE
           END-EXEC.
       
           IF EIBRESP >  0
               PERFORM WRITECONSOLE THRU WC-EXIT
           END-IF.
       
       TDQ-EXIT. EXIT.
      *****************************************************************
       WRITECONSOLE.
      *****************************************************************
       
           MOVE EIBRESP    TO WSEIBRESP.
           MOVE MSGNO      TO WSMSGNO.
       
           EXEC CICS
                WRITE OPERATOR
                TEXT  (WSMSG)
                TEXTLENGTH (62)
                EVENTUAL
           END-EXEC.
       
       WC-EXIT. EXIT.

      *****************************************************************
       TERMIN.
      *****************************************************************
       
           EXEC CICS RETURN END-EXEC.
       
       TERMIN-EXIT. EXIT.
       

@ravijp
Copy link
Author

ravijp commented Nov 27, 2024

One more thing I noticed in FlowChart, if a Program has multiple EXEC CICS ...END-EXEC. Then in flow chart we get first EXEC CICS code chunk as part of all the EXEC CICS. Showing one example of what I am talking about - > it is the purple box which gets duplicated across all EXEC CICS.
image

@avishek-sen-gupta
Copy link
Owner

@avishek-sen-gupta I am running following command- java -jar /home/rprakash/cobol-rekt/smojol-cli/target/smojol-cli.jar run COBOFILE --commands="DRAW_FLOWCHART" --srcDir "/home/rprakash/codelocation/programs" --copyBooksDir="/home/rprakash/codelocation/copybook/","/home/rprakash/codelocation/db2copy/" --dialectJarPath /home/rprakash/cobol-rekt/che-che4z-lsp-for-cobol-integration/server/dialect-idms/target/dialect-idms.jar --reportDir out/report --generation=PROGRAM

Error after rebuilding using the latest commit - image

Could you paste the entire output of the command in a file, and share it please?

@avishek-sen-gupta
Copy link
Owner

One more thing I noticed in FlowChart, if a Program has multiple EXEC CICS ...END-EXEC. Then in flow chart we get first EXEC CICS code chunk as part of all the EXEC CICS. Showing one example of what I am talking about - > it is the purple box which gets duplicated across all EXEC CICS. image

CICS support has not been explicitly added since I haven't had any use cases. If you want to get this fixed, you can open another issue and we can go from there.

@ravijp
Copy link
Author

ravijp commented Nov 27, 2024

@avishek-sen-gupta I am running following command- java -jar /home/rprakash/cobol-rekt/smojol-cli/target/smojol-cli.jar run COBOFILE --commands="DRAW_FLOWCHART" --srcDir "/home/rprakash/codelocation/programs" --copyBooksDir="/home/rprakash/codelocation/copybook/","/home/rprakash/codelocation/db2copy/" --dialectJarPath /home/rprakash/cobol-rekt/che-che4z-lsp-for-cobol-integration/server/dialect-idms/target/dialect-idms.jar --reportDir out/report --generation=PROGRAM
Error after rebuilding using the latest commit - image

Could you paste the entire output of the command in a file, and share it please?

Entire output has the code references in it. I can't share that. Can we connect over google meet? my email - [email protected]

@ravijp
Copy link
Author

ravijp commented Nov 30, 2024

Hi @avishek-sen-gupta, sharing code template to demonstrate the error

00100  IDENTIFICATION DIVISION.
00200  PROGRAM-ID. MyCOBOLProgram.
00300  ENVIRONMENT DIVISION.
00400  CONFIGURATION SECTION.
00500  SOURCE-COMPUTER. IBM-PC.
00600  OBJECT-COMPUTER. IBM-PC.
00700  DATA DIVISION.
00800  WORKING-STORAGE SECTION.
01000     01  WS-SAVE-PACKAGE      PIC X(10).
01200  PROCEDURE DIVISION.
01500  MAIN-PROCEDURE.
01600      EXEC SQL
01610          SET :WS-SAVE-PACKAGE = CURRENT PACKAGESET
01620      END-EXEC.
01621      DISPLAY 'Current Package set: ' WS-SAVE-PACKAGE.
01800      STOP RUN.

@avishek-sen-gupta
Copy link
Owner

This will require adding some specific support for DB2 SQL post-processing. I'll open a specific issue for this and work on it.

@avishek-sen-gupta avishek-sen-gupta self-assigned this Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants