View previous topic :: View next topic |
Author |
Message |
chuck Beginner
Joined: 30 Nov 2007 Posts: 29 Topics: 13
|
Posted: Fri Jun 28, 2024 2:10 pm Post subject: Period missing after END-EXEC in WS |
|
|
Hi
We have a number of programs that are in production where we have this construct in W-S
EXEC SQL
INCLUDE blah
END-EXEC
EXEC SQL
INCLUDE blah
END-EXEC
Note that there is no period after the END-EXEC
These programs, as I said, were successfully compiled, linked and bound and are running in prod.
Recently I had reason to recompile one of these programs in dev and I started getting compiler errors which disappeared once I added the period after the END-EXEC
I was curious if anyone knew of a change in the way the cobol compiler works that would cause this behaviour to change? Did IBM, like, "tighten up" the compiler?
I know that periods are not needed in the Procedure Division
Thanks |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Fri Jun 28, 2024 4:52 pm Post subject: |
|
|
chuck,
Is it the Precompiler that issued the error message when the period is missing or is it the COBOL compiler that issued the message?
According Db2 12 , Period is OPTIONAL if it is in between COBOL statements.
Db2 12 Programming Guide wrote: |
If the SQL statement appears between two COBOL statements, the period after END-EXEC is optional and might not be appropriate. If the statement appears in an IF?THEN set of COBOL statements, omit the ending period to avoid inadvertently ending the IF statement.
|
Here is the link to it
https://www.ibm.com/docs/en/db2-for-zos/12?topic=programming-cobol-applications-that-issue-sql-statements
Also what level was the previous version compiled and what is the new version of compile? _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
chuck Beginner
Joined: 30 Nov 2007 Posts: 29 Topics: 13
|
Posted: Tue Oct 29, 2024 9:56 am Post subject: |
|
|
Sorry, should have responded to this. We did discover that stand alone precompiler (DSNHPC?) will ignore the fact that period is missing but if we used integrated precompiler of IGYCRCTL then it will flag it.
So confirms your assumption Kolusu
Thanks |
|
Back to top |
|
|
|
|