MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Period missing after END-EXEC in WS

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
chuck
Beginner


Joined: 30 Nov 2007
Posts: 29
Topics: 13

PostPosted: Fri Jun 28, 2024 2:10 pm    Post subject: Period missing after END-EXEC in WS Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri Jun 28, 2024 4:52 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
chuck
Beginner


Joined: 30 Nov 2007
Posts: 29
Topics: 13

PostPosted: Tue Oct 29, 2024 9:56 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group