开发者

SQLSTATE 7003 while unloading table in JCL

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.


I think it could simply be you are missing a semi-colon ( ; ) to terminate your sql statement.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜