Why does CA Datacom DBSQLPR utility give syntax error: SQLCODE = -20, SQLSTATE=42601 MESSAGE = SYNTAX-LAST TOKEN(S): <n>?
search cancel

Why does CA Datacom DBSQLPR utility give syntax error: SQLCODE = -20, SQLSTATE=42601 MESSAGE = SYNTAX-LAST TOKEN(S): <n>?

book

Article ID: 21763

calendar_today

Updated On:

Products

Datacom DATACOM - AD CIS COMMON SERVICES FOR Z/OS 90S SERVICES DATABASE MANAGEMENT SOLUTIONS FOR DB2 FOR Z/OS COMMON PRODUCT SERVICES COMPONENT Common Services CA ECOMETER SERVER COMPONENT FOC Easytrieve Report Generator for Common Services INFOCAI MAINTENANCE IPC UNICENTER JCLCHECK COMMON COMPONENT Mainframe VM Product Manager CHORUS SOFTWARE MANAGER CA ON DEMAND PORTAL CA Service Desk Manager - Unified Self Service PAM CLIENT FOR LINUX ON MAINFRAME MAINFRAME CONNECTOR FOR LINUX ON MAINFRAME GRAPHICAL MANAGEMENT INTERFACE WEB ADMINISTRATOR FOR TOP SECRET Xpertware

Issue/Introduction

Introduction:

I have a very simple SQL SELECT request that spans three lines of input, as follows:

   
SELECT *   
 FROM DIR_TABLE  
;  

When I submit the SQL request using the CA Datacom DBSQLPR utility, the result is condition code 0020 due to a syntax error, as follows:

INPUT STATEMENT:   
SELECT *                                                       00520140  
 FROM DIR_TABLE                                                00520240  
;  
___________SQL ERROR SUMMARY START___________   
   
 SQLCODE = -20, SQLSTATE=42601   
 MESSAGE = BAD SYNTAX: <00520140>   
 WHEN THE ERROR OCCURRED, THE SYNTAX BELOW HAD BEEN PARSED:   
 SELECT * SELECT * 00520140                                                      00520140   
 FROM DIR_TABLE   
____________SQL ERROR SUMMARY END____________  

 

Question:

Why does CA Datacom DBSQLPR utility give syntax error: SQLCODE = -20, SQLSTATE=42601 MESSAGE = SYNTAX-LAST TOKEN(S): ?

 

Answer:

The syntax error is due to the sequence numbers. The clue is in the "00520140" which shows that the input has sequence numbers in positions 73-80.

There is no need to edit and remove the sequence numbers. You can provide the DBSQLPR parameter INPUTWIDTH=72. INPUTWITH is used to limit the length of the input of the DBSQLPR control cards.

 

Additional Information:

Refer to the section "DBUTLTY Reference"https://docops.ca.com/ca-datacom/15-0/en/reference/dbutlty-reference for all the options and parameters that are supported in the CA Datacom® Core - 15.0 .

Environment

Release:
Component: DB