I program in other languages but not COBOL and have inherited a COBOL program, which I am trying to understand.
I think it involves subprograms.
First, I am looking for some validation that what I am looking at is indeed a subprogram. Second, I want to understand the process flow when there is a subprogram.
Here is part of the program:
MOVE ZERO TO HOLD-CD.
IF (ST-C > ZERO) AND (ST-C < 64)
MOVE ST-C TO HOLD-CD GO TO CHECK-5.
IF (S-SUP > ZERO) AND (S-SUP < 64)
MOVE S-SUP TO HOLD-CD GO TO CHECK-5.
MOVE ZERO TO HOLD-CD.
CHECK-CODE.
IF HOLD-CD = 05 OR 16 OR 22 OR 29 OR 52
NEXT SENTENCE ELSE GO TO SET-CODE.
*
IF (HUN = HOLD-HUN) AND (EST-PD = HOLD-EST)
NEXT SENTENCE ELSE MOVE 0 TO CK-CNTR
GO TO CHECK-5.
IF CK-CNTR = 0 GO TO CHECK-5.
IF CK-CNTR = 1 MOVE 'B' TO FT-1
MOVE HOLD-TOA TO TOA
GO TO SET-CODE.
CHECK-5.
more statements here
So, first, I want to know if "check-code" is the start of a subprogram.
Second, if the program reaches and executes the second "Move zero to hold-cd" statement, will it then proceed to execute the "check-code" subprogram (assuming that this is a subprogram)? Or will it only execute the "check-code" subprogram when it is called using a go to statement or some other method of calling subprograms?
I hope this is clear.
I think it involves subprograms.
First, I am looking for some validation that what I am looking at is indeed a subprogram. Second, I want to understand the process flow when there is a subprogram.
Here is part of the program:
MOVE ZERO TO HOLD-CD.
IF (ST-C > ZERO) AND (ST-C < 64)
MOVE ST-C TO HOLD-CD GO TO CHECK-5.
IF (S-SUP > ZERO) AND (S-SUP < 64)
MOVE S-SUP TO HOLD-CD GO TO CHECK-5.
MOVE ZERO TO HOLD-CD.
CHECK-CODE.
IF HOLD-CD = 05 OR 16 OR 22 OR 29 OR 52
NEXT SENTENCE ELSE GO TO SET-CODE.
*
IF (HUN = HOLD-HUN) AND (EST-PD = HOLD-EST)
NEXT SENTENCE ELSE MOVE 0 TO CK-CNTR
GO TO CHECK-5.
IF CK-CNTR = 0 GO TO CHECK-5.
IF CK-CNTR = 1 MOVE 'B' TO FT-1
MOVE HOLD-TOA TO TOA
GO TO SET-CODE.
CHECK-5.
more statements here
So, first, I want to know if "check-code" is the start of a subprogram.
Second, if the program reaches and executes the second "Move zero to hold-cd" statement, will it then proceed to execute the "check-code" subprogram (assuming that this is a subprogram)? Or will it only execute the "check-code" subprogram when it is called using a go to statement or some other method of calling subprograms?
I hope this is clear.