Andre White
2016-08-31 17:58:43 UTC
Hi Guys,
I have question about COBOL. I'm not expert in cobol . Currently i'm doing/Writing cobol program with my style. And then some people on different team, complaining my code style. My question is:
1. In my code if i call PERFORM procedure, i'm not included THRU EXIT. Because they style in current
program (COBOL). They always used PERFORM A-100-XXX THRU A-100-EXIT. If they give me the good
reason whey I "MUST" included THRU EXIT in my program, I will follow what they asking to me. I don't
know if they just COPY PASTE from the previous programmer or they don't know the reason.
2. About the Section, in my program they also complaining if i'm used SECTION in my code. for Example:
PROCEDURE DIVISION.
MAIN SECTION.
BEGIN-COBOL-SERVER.
.................
EVALUATE MSG-RQST
WHEN "RA" * If user want to retrieve all customer data *
A100-PROCESS-RET
WHEN "RC" * Just retrieve the account number *
A100-PROCESS-ACCOUNT
WHEN "RM" * Just retrieve the amount *
A100-PROCESS-RET-AMOUNT.
WHEN OTHER
..........
END-EVALUATE.
STOP.
?SECTION A100-PROCESS
A100-PROCESS-RET SECTION.
A100-PROCESS-RET-ACCOUNT.
..................................................
.................................................
.................................................
IF WS-ACCT = "S" THEN * if account is suspended, stop the process *
GOTO A100-EXIT
END-IF.
................................................
...............................................
.
* END OF PARAGRAPH A100-PROCESS-RET-ACCOUNT *
A100-PROCESS-RET-AMOUNT.
................................................
................................................
................................................
.
* END OF PARAGRAPH A100-PROCESS-RET-AMOUNT *
A100-EXIT.
EXIT.
Anybody can explain to me, is not good if i'm using section in my code.
Thanks guys for your reply.
Cheers.
I have question about COBOL. I'm not expert in cobol . Currently i'm doing/Writing cobol program with my style. And then some people on different team, complaining my code style. My question is:
1. In my code if i call PERFORM procedure, i'm not included THRU EXIT. Because they style in current
program (COBOL). They always used PERFORM A-100-XXX THRU A-100-EXIT. If they give me the good
reason whey I "MUST" included THRU EXIT in my program, I will follow what they asking to me. I don't
know if they just COPY PASTE from the previous programmer or they don't know the reason.
2. About the Section, in my program they also complaining if i'm used SECTION in my code. for Example:
PROCEDURE DIVISION.
MAIN SECTION.
BEGIN-COBOL-SERVER.
.................
EVALUATE MSG-RQST
WHEN "RA" * If user want to retrieve all customer data *
A100-PROCESS-RET
WHEN "RC" * Just retrieve the account number *
A100-PROCESS-ACCOUNT
WHEN "RM" * Just retrieve the amount *
A100-PROCESS-RET-AMOUNT.
WHEN OTHER
..........
END-EVALUATE.
STOP.
?SECTION A100-PROCESS
A100-PROCESS-RET SECTION.
A100-PROCESS-RET-ACCOUNT.
..................................................
.................................................
.................................................
IF WS-ACCT = "S" THEN * if account is suspended, stop the process *
GOTO A100-EXIT
END-IF.
................................................
...............................................
.
* END OF PARAGRAPH A100-PROCESS-RET-ACCOUNT *
A100-PROCESS-RET-AMOUNT.
................................................
................................................
................................................
.
* END OF PARAGRAPH A100-PROCESS-RET-AMOUNT *
A100-EXIT.
EXIT.
Anybody can explain to me, is not good if i'm using section in my code.
Thanks guys for your reply.
Cheers.