openmainframeproject / cobol-check

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

Added new functionality #261

Closed sam94dion closed 1 year ago

sam94dion commented 1 year ago

Hi,

So I did a rebase to avoid signing of all my previous commits. Sorry If that is not the best way. Doing a rebase is what I found on stackoverflow.

Added functionalities :

  1. If you want to test a subprogram but the sub program is passed a linkage section you would want to stub that part for the program to be able to run without dependences.

example:

 LINKAGE SECTION.  
 COPY COPY002.
 PROCEDURE DIVISION.

TO

      * LINKAGE SECTION.

       COPY COPY002.

       PROCEDURE DIVISION.
  1. You might declare SQL cursors within your working-section which will need to be stubbed

example:

           EXEC SQL  
              DECLARE NAME-CUR CURSOR FOR  
              SELECT FIRST_NAME, LAST_NAME FROM TEXEM
           END-EXEC.

TO

      *      EXEC SQL  
      *        DECLARE NAME-CUR CURSOR FOR  
      *        SELECT FIRST_NAME, LAST_NAME FROM TEXEM
      *      END-EXEC.
  1. If you have SQL copybook you might want to use the variables within the copybook but discard other information. example:
       EXEC SQL INCLUDE TEXEM  END-EXEC.

TO

       01  TEXEM.                                                               
           10 FIRST-NAME           PIC X(10).                                   
           10 LAST-NAME            PIC X(10).                                   
           10 TMS-CREA             PIC X(26).