HomeCobolPro FeaturesPowerJCL FeaturesJCLScript FeaturesContact E-JCLDeveloper Biographies

Original COBOL Program
                                                                                   

       identification division.
       Program-Id. COBOLT.
       date-compiled.
       author.   E-JCL Software, Inc.
      *
      * This sample COBOL program contains random COBOL statements and
      * is intended to demonstrate some of the run-time profiling
      * capabilities of CobolPro for z/OS.
      *
       environment  division.

       configuration   section  .
       source-computer. test-computer-name.

       object-computer. test-computer-name.
       special-names.

       data division.
       working-storage section.
       01 COUNT-X                     PIC S9(9) COMP VALUE 1.
       01 COUNT-Y                     PIC S9(9) COMP VALUE 2.
       01 COUNT-Z                     PIC S9(9) COMP VALUE 3.
      *
       procedure division.
      *---------------------------------
       0000-Main.
      *---------------------------------
      *
           Display 'Executing $$COBOLT *****************'
      *
           Perform 1001   times
           COMPUTE COUNT-X = COUNT-X + 2
           End-Perform.
      *
           If COUNT-X > 00
           Continue  IF COUNT-X = 56 Call 'DSNHLI' Using COUNT-Y End-If
           End-If.
      *
           Perform 444      times
           COMPUTE COUNT-Y = COUNT-Y + 3
           End-Perform.
      *
           Perform 707    times
           COMPUTE COUNT-Z = COUNT-Z + 4
           End-Perform.
      *
      *    A COBOL statement is not normally continued over several
      *    lines as the following COMPUTE statement is coded.
      *
      *    This demonstrates the capability of CobolPro to properly
      *    parse and evaluate continued COBOL statements.
      *
           perform 71 times display 'Before Compute......'             c
      -                                                                o
      -                                                                m
      -                                                                p
      -                                                                u
      -                                                                t
      -                                                                e

                   COUNT-Z  = 1 + 2    add 5 to COUNT-Z    end-perform.
      *
           If COUNT-Z > 3
           Display 'COUNT-Z is greater than 3'
           End-If

           perform 0001-Paragraph-Test-Abc 17 times.
      *
           move 10 to COUNT-Z.
           perform 0001-Paragraph-Test-Abc.
      *
      *    These PERFORM statements demonstrate a potential logic
      *    error since the GOBACK statement is coded within the
      *    PERFORM range. The runtime statistics illustrate how many
      *    times the statements in the PERFORM range are executed.
      *
           Perform Varying COUNT-Y
                      From 1 By 1
                     Until COUNT-Y > 5001
           Perform Varying COUNT-X
                      From 1 By 1
                     Until COUNT-X > 1046
           Continue
           COMPUTE COUNT-Z
                 = COUNT-Z + 1 + FUNCTION MAX (1 , 2 , 3 , 4)
           Continue
           End-Perform
           Continue
           goback
           Continue
           End-Perform.
      *
      *---------------------------------
       0001-Paragraph-Test-Abc.
      *---------------------------------
           If          COUNT-Z = 0
              display 'COUNT-Z = 0'
           Else
           If          COUNT-Z = 1
              display 'COUNT-Z = 1'
           Else
           If          COUNT-Z = 2
              display 'COUNT-Z = 2'
           Else
           If          COUNT-Z = 3
              display 'COUNT-Z = 3'
           Else
           If          COUNT-Z = 4
              display 'COUNT-Z = 4'
           Else
           If          COUNT-Z = 5
              display 'COUNT-Z = 5'
           Else
           If          COUNT-Z = 6
              display 'COUNT-Z = 6'
           Else
           If          COUNT-Z = 7
              display 'COUNT-Z = 7'
           Else
           If          COUNT-Z = 8
              display 'COUNT-Z = 8'
           Else
           If          COUNT-Z = 9
              display 'COUNT-Z = 9'
           Else
           If          COUNT-Z = 10
              display 'COUNT-Z = 10'
           Else
           If          COUNT-Z = 11
              display 'COUNT-Z = 11'
           End-If.

                                                          
Profiled COBOL Program with Run-Time Statement-Level Counts
                                                                                       

       identification division.
       Program-Id. COBOLT.
       DATE-COMPILED. 09/01/11.
       author.   E-JCL Software, Inc.
      *
      * This sample COBOL program contains random COBOL statements and
      * is intended to demonstrate some of the run-time profiling
      * capabilities of CobolPro for z/OS.
      *
       environment  division.

       configuration   section  .
       source-computer. test-computer-name.

       object-computer. test-computer-name.
       special-names.

       data division.
       working-storage section.
       01 COUNT-X                     PIC S9(9) COMP VALUE 1.
       01 COUNT-Y                     PIC S9(9) COMP VALUE 2.
       01 COUNT-Z                     PIC S9(9) COMP VALUE 3.
      *
       procedure division.
      *---------------------------------
       0000-Main.
      *---------------------------------
      *
           Display 'Executing $$COBOLT *****************'               1
      *
           Perform 1001   times                                         1
           COMPUTE COUNT-X = COUNT-X + 2                                1001
           End-Perform.
      *
           If COUNT-X > 00                                              1
           Continue                                                     1
                     IF COUNT-X = 56                                    1
                                     Call 'DSNHLI' Using COUNT-Y End-If 0
           End-If.
      *
           Perform 444      times                                       1
           COMPUTE COUNT-Y = COUNT-Y + 3                                444
           End-Perform.
      *
           Perform 707    times                                         1
           COMPUTE COUNT-Z = COUNT-Z + 4                                707
           End-Perform.
      *
      *    A COBOL statement is not normally continued over several
      *    lines as the following COMPUTE statement is coded.
      *
      *    This demonstrates the capability of CobolPro to properly
      *    parse and evaluate continued COBOL statements.
      *
           perform 71 times                                             1
                            display 'Before Compute......'              71
                                                                       c71
      -                                                                o
      -                                                                m
      -                                                                p
      -                                                                u
      -                                                                t
      -                                                                e

                   COUNT-Z  = 1 + 2
                                       add 5 to COUNT-Z    end-perform. 71
      *
           If COUNT-Z > 3                                               1
           Display 'COUNT-Z is greater than 3'                          1
           End-If

           perform 0001-Paragraph-Test-Abc 17 times.                    1
      *
           move 10 to COUNT-Z.                                          1
           perform 0001-Paragraph-Test-Abc.                             1
      *
      *    These PERFORM statements demonstrate a potential logic
      *    error since the GOBACK statement is coded within the
      *    PERFORM range. The runtime statistics illustrate how many
      *    times the statements in the PERFORM range are executed.
      *
           Perform Varying COUNT-Y                                      1
                      From 1 By 1
                     Until COUNT-Y > 5001
           Perform Varying COUNT-X                                      1
                      From 1 By 1
                     Until COUNT-X > 1046
           Continue                                                     1046
           COMPUTE COUNT-Z                                              1046
                 = COUNT-Z + 1 + FUNCTION MAX (1 , 2 , 3 , 4)
           Continue                                                     1046
           End-Perform
           Continue                                                     1
           goback                                                       1
           Continue                                                     0
           End-Perform.
      *
      *---------------------------------
       0001-Paragraph-Test-Abc.
      *---------------------------------
           If          COUNT-Z = 0                                      18
              display 'COUNT-Z = 0'                                     0
           Else
           If          COUNT-Z = 1                                      18
              display 'COUNT-Z = 1'                                     0
           Else
           If          COUNT-Z = 2                                      18
              display 'COUNT-Z = 2'                                     0
           Else
           If          COUNT-Z = 3                                      18
              display 'COUNT-Z = 3'                                     0
           Else
           If          COUNT-Z = 4                                      18
              display 'COUNT-Z = 4'                                     0
           Else
           If          COUNT-Z = 5                                      18
              display 'COUNT-Z = 5'                                     0
           Else
           If          COUNT-Z = 6                                      18
              display 'COUNT-Z = 6'                                     0
           Else
           If          COUNT-Z = 7                                      18
              display 'COUNT-Z = 7'                                     0
           Else
           If          COUNT-Z = 8                                      18
              display 'COUNT-Z = 8'                                     17
           Else
           If          COUNT-Z = 9                                      1
              display 'COUNT-Z = 9'                                     0
           Else
           If          COUNT-Z = 10                                     1
              display 'COUNT-Z = 10'                                    1
           Else
           If          COUNT-Z = 11                                     0
              display 'COUNT-Z = 11'                                    0
           End-If.
  

                                                          
COBOL Execution Profile Report
                                                                                       

 CobolPro for z/OS                                     (C) E-JCL Software, Inc.

  

                         COBOL Execution Profile Report

 

 Member: $$COBOLT                                             Date: 01.Sep.2011
                                                              Time: 08:36:06 PM

 

|---------------------------------|----------|----------|------------|---------|
|                                 |Number Of |Number Of |Number Of   |Runtime  |
|         COBOL Statement         |Statements|Statements|Statements  |Execution|
|                                 |          |Executed  |Not Executed|Count    |
|---------------------------------|----------|----------|------------|---------|
| Add                             |        1 |        1 |          0 |       71|
| Call 'DSNHLI'                   |        1 |        0 |          1 |        0|
| Compute                         |        5 |        5 |          0 |     3269|
| Continue                        |        5 |        4 |          1 |     2094|
| Display                         |       15 |        5 |         10 |       91|
| Goback                          |        1 |        1 |          0 |        1|
| If                              |       15 |       14 |          1 |      167|
| Move                            |        1 |        1 |          0 |        1|
| Perform                         |        8 |        8 |          0 |        8|
|---------------------------------|----------|----------|------------|---------|
| Total                           |       52 |       39 |         13 |     5702|
|---------------------------------|----------|----------|------------|---------|

Copyright © 2014 E-JCL Software, Inc. All rights reserved.