In this blog post, let’s learn about the error message “13508 Expecting keyword, found keyword.” when working with HPE NonStop SQL/MX, the reason for the error and the solution to fix this error message.
Error Message
13508 Expecting keyword, found keyword.
Reason for the Error
You did not enter the keyword or character that NonStop SQL/MX required. When the preprocessor is processing the code within a control block such as IF, WHILE, DO, or is at the end of one, it looks for the keyword that ends that block and then a semicolon, and issues this message if that keyword or character is not found: For example:
In an IF or WHILE block:
*** ERROR[13508] Expecting END, found EXEC.
When IF is not followed by THEN:
*** ERROR[13508] Expecting THEN, found ;.
When WHILE is not followed by DO:
*** ERROR[13508] Expecting DO, found ;.
When the keyword END is not followed by a semicolon while processing an IF or WHILE block:
*** ERROR[13508] Expecting ;, found EXEC.
Solution
Correct the syntax and resubmit