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. |