IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

What is the reason for error SQLCODE = -311 when unloading?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Judy85

New User


Joined: 05 Aug 2011
Posts: 17
Location: China

PostPosted: Wed Sep 21, 2011 7:29 pm
Reply with quote

What is the reason for SQLCODE = -311 when unloading a table with SQL?
Code:

//SYSTSIN  DD *                                         
  DSN SYSTEM(DB2D)                                       
  RUN  PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARMS('SQL') -   
    LIB('DB2D.RUNLIB.LOAD')                             
//SYSIN    DD *       
    SELECT MACH_TYPE,SERIAL_NBR,CUST_ADDR   
    FROM LIDS.DWCC                         
    WHERE CUST_ADDR LIKE '%DEPT OF ENERGY%'
    OR CUST_ADDR LIKE '%ARMY%'             
    OR CUST_ADDR LIKE '%NAVY%'             
    OR CUST_ADDR LIKE '%AIRFORCE%'         
    OR CUST_ADDR LIKE '%FDIC%'             
    OR CUST_ADDR LIKE '%REPUBLIC BANK%'     
    OR CUST_ADDR LIKE '%DEPT OF DEFENCE%'   
    OR CUST_ADDR LIKE '%FBI%'               
    OR CUST_ADDR LIKE '%IGOV%'             
    OR CUST_ADDR LIKE '%MARINE CORP%'       
    OR CUST_ADDR LIKE '%US MARINES%'       
    OR CUST_ADDR LIKE '%US SENATE%'         
    OR CUST_ADDR LIKE '%US TRUSTEES%'       
    OR CUST_ADDR LIKE '%USDA FSIS%'         
    OR CUST_ADDR LIKE '%USDA-ARS-PDL%'     
    OR CUST_ADDR LIKE '%VIEJAS%'     
    OR CUST_ADDR LIKE '%VION CORP%'         
    OR CUST_ADDR LIKE '%VISTRONIX INC%'     
    OR CUST_ADDR LIKE '%VITRO SVCS DIV%'   
    OR CUST_ADDR LIKE '%WILDWOOD%'   
    OR CUST_ADDR LIKE '%WINCOR NIXDORF%'   
    OR CUST_ADDR LIKE '%WORLD BANK%'       
    OR CUST_ADDR LIKE '%101ST AIRBORNE DIV%'
    OR CUST_ADDR LIKE '%3D RESEARCH CORP%' 
    OR CUST_ADDR LIKE '%53 SPTS/SCN%'       
    OR CUST_ADDR LIKE '%6TH CIRCUIT%';     
/*                                                   
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Sep 21, 2011 7:48 pm
Reply with quote

THE LENGTH OF INPUT HOST VARIABLE NUMBER position-number IS
NEGATIVE OR GREATER THAN THE MAXIMUM
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Sep 21, 2011 7:49 pm
Reply with quote

one of your literals is greater than the length of CUST_ADDR
-311 explained here

and why are you (I assume you are a chinese company) doing looking at databases with US Military info?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Sep 21, 2011 9:38 pm
Reply with quote

Hi DIck,

We (US - DoD) contract anywhere . . . icon_smile.gif

d
Back to top
View user's profile Send private message
Judy85

New User


Joined: 05 Aug 2011
Posts: 17
Location: China

PostPosted: Thu Sep 22, 2011 12:10 pm
Reply with quote

I fact, I am in Us company.
Back to top
View user's profile Send private message
Judy85

New User


Joined: 05 Aug 2011
Posts: 17
Location: China

PostPosted: Thu Sep 22, 2011 12:19 pm
Reply with quote

CUST_ADDR is 120 CHAR

Code:
Select Column Name        Col No Col Type Length Scale  Null Def FP    Col Card
       *                       * *             *      * *    *   *            *
------ ------------------ ------ -------- ------ ------ ---- --- -- -----------
       SERV_PERF              11 CHAR          1      0 Y    N   N           -1
       CUST_ADDR              12 VARCHAR     120      0 Y    N   N           -1
       DLR_CMT                13 CHAR         90      0 Y    N   N           -1
       PART_QTY               14 INTEGER       4      0 Y    N   N           -1
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Sep 22, 2011 12:47 pm
Reply with quote

Can you post the entire error message?
Back to top
View user's profile Send private message
Judy85

New User


Joined: 05 Aug 2011
Posts: 17
Location: China

PostPosted: Thu Sep 22, 2011 12:54 pm
Reply with quote

I have found the problem. It is because of the problem of the numbers from column 73 to 80 in JCL dataset. I have fix the problem by deleting the numbers. Thank you all!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Sep 22, 2011 8:22 pm
Reply with quote

You're welcome.

Good to hear it is working - thank you for letting us know icon_smile.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Reorg abended with REASON=X'00E40347' DB2 2
No new posts REASON 00D70014 in load utility DB2 6
Search our Forums:

Back to Top