In this blog post, let’s learn about the error message “13509 Expecting keyword1 after keyword2, found keyword3.” when working with HPE NonStop SQL/MX, the reason for the error and the solution to fix this error message.
Error Message
13509 Expecting keyword1 after keyword2, found keyword3.
Reason for the Error
You did not enter the keyword that NonStop SQL/MX was expecting. When the preprocessor encounters certain keywords, it expects them to be followed by other specific keywords. For example:
This error is issued if the preprocessor does not find the keyword DIVISION immediately after any of these keywords:
IDENTIFICATION
ENVIRONMENT
DATA
WORKING-STORAGE
PROCEDURE
***ERROR[13509] Expecting DIVISION after DATA, found EXEC.
This error is issued if the preprocessor does not find the keyword SECTION immediately after any of these keywords:
FILE
LINKAGE
***ERROR[13509] Expecting SECTION after FILE, found EXEC.
This error is issued if the preprocessor does not find the picture representation immediately after the keyword PICTURE:
***ERROR[13509] Expecting picture specification after PICTURE, found EXEC.
Solution
Correct the syntax and resubmit