在 JCL 中卸载表时出现 SQLSTATE 7003
我有一个具有以下格式的 JCL
Proc Library
//JS020 EXEC PGM=IKJEFT01,
// DYNAMNBR=20
//*
//EXTRACT DD DSN=PATH.EXTRACT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1,10),RELEASE)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSPUNCH DD SYSOUT=*
//*
//SYSTSIN DD DSN=PATH.CONTROL_CARD_LIB(CARD1), DISP=SHR
//SYSREC00 DD DSN=TABLEA.UNLOAD.FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,LRECL=80
//SYSIN DD DSN=PATH.CONTROL_CARD_LIB(CARD2), DISP=SHR
----->>
路径.CONTROL_CARD_LIB CARD1
DSN SYSTEM(XXXX)
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARM('SQL')
CARD2
Select * from TABLE
where condition1
and condition2
and condition3
当我提交作业时,我总是得到 SQLSTATE = 7003 和 SQLCODE = -518。我尝试在网络上查找并得到以下描述
EXECUTE 语句中标识的语句是一个选择语句,或者未处于准备状态。
有人可以告诉我我错过了什么吗?非常感谢。
I have a JCL with the following format
Proc Library
//JS020 EXEC PGM=IKJEFT01,
// DYNAMNBR=20
//*
//EXTRACT DD DSN=PATH.EXTRACT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1,10),RELEASE)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSPUNCH DD SYSOUT=*
//*
//SYSTSIN DD DSN=PATH.CONTROL_CARD_LIB(CARD1), DISP=SHR
//SYSREC00 DD DSN=TABLEA.UNLOAD.FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,LRECL=80
//SYSIN DD DSN=PATH.CONTROL_CARD_LIB(CARD2), DISP=SHR
----->>
PATH.CONTROL_CARD_LIB
CARD1
DSN SYSTEM(XXXX)
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARM('SQL')
CARD2
Select * from TABLE
where condition1
and condition2
and condition3
When I submit my job I am always getting SQLSTATE = 7003 and SQLCODE = -518. I tried looking in the web and got the following description
The statement identified in the EXECUTE statement is a select-statement, or is not in a prepared state.
Can someone tell me what I miss? Many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为这可能只是您缺少一个分号(
;
)来终止您的 sql 语句。I think it could simply be you are missing a semi-colon (
;
) to terminate your sql statement.正如 James 提到的,CARD2 中的 SELECT 语句缺少分号。当您指定 PARM('SQL') 时,表示您的输入数据集包含一个或多个完整的 SQL 语句,每个语句均以分号结尾。
如果不指定 SQL 参数,则输入数据集必须包含一个或多个使用以下语法的单行语句(不带分号):
表或视图名称 [WHERE 条件] [ORDER BY 列]
每个输入语句必须是有效的 SQL SELECT 语句,其中省略了 SELECT * FROM 子句且没有结束分号。
更多详情请参考这里 => http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.db2.doc.apsg%2Frntiaul.htm
As James mentions, your SELECT statement in CARD2 is missing a semicolon. When you specify PARM('SQL'), it indicates that your input data set contains one or more complete SQL statements, each of which ends with a semicolon.
If you do not specify the SQL parameter, your input data set must contain one or more single-line statements (without a semicolon) that use the following syntax:
table or view name [WHERE conditions] [ORDER BY columns]
Each input statement must be a valid SQL SELECT statement with the clause SELECT * FROM omitted and with no ending semicolon.
Please refer to this for more details => http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.db2.doc.apsg%2Frntiaul.htm