Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

-303 in db2 fetch

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging
View previous topic :: :: View next topic  
Author Message
srinut123

New User


Joined: 11 Oct 2005
Posts: 62
Location: India

PostPosted: Thu Jun 11, 2009 3:17 am    Post subject: -303 in db2 fetch
Reply with quote

Hi
I'm trying to fetch a field with type DECIMAL(6,0) to a cobol variable of type S9(6)v USAGE COMP-3. The data type I took from the DCLGEN of the table but still I'm getting -303 (ie data types not compatible) during the fetch.
Please advise.

The field is a NOT NULL.

Thanks
SR
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Jun 11, 2009 3:38 am    Post subject:
Reply with quote

Show the dclgen definition of the column and cobol definition of the host variable and the select statement. Something very basic is wrong.
Back to top
View user's profile Send private message
srinut123

New User


Joined: 11 Oct 2005
Posts: 62
Location: India

PostPosted: Thu Jun 11, 2009 3:46 am    Post subject:
Reply with quote

Hi
Thanks for the reply.. here are the details..

DB2 DEFINITIONS:

DACNCNT DECIMAL(6, 0) NOT NULL

COBOL DECLARION:
01 WS-ACN-CNT PIC S9(6)V USAGE COMP-3.

CURSOR:
DECLARE C1 CURSOR SELECT DACNCNT FROM TBS0101

FETCH:
FETCH C1 INTO :WS-ACN-CNT

ERROR:
SEVERE ERROR OR WARNING ENCOUNTERED...
SQLCODE =-0000303
SQLERRMC =11
SQLSEQUENCE = 0002
SQLERRD(3) = 0000000
SQLWARN0 =
SQLWARN1 =
SQLWARN2 =
SQLWARN3 =
SQLWARN4 =
SQLWARN5 =
SQLWARN6 =
SQLWARN7 =

Thanks
SR
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Jun 11, 2009 3:49 am    Post subject:
Reply with quote

what is the COBOL definition from the DCLGEN?

Try making the USAGE of the COBOL field COMP.
Back to top
View user's profile Send private message
srinut123

New User


Joined: 11 Oct 2005
Posts: 62
Location: India

PostPosted: Thu Jun 11, 2009 3:56 am    Post subject:
Reply with quote

COBOL definitino from DCLGEN is S9(6)V USAGE COMP-3. Infact I used the same.

Yes I tried making COMP-3 to COMP. Its of no use.. icon_sad.gif

-SR
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Jun 11, 2009 4:39 am    Post subject:
Reply with quote

Do the columns and host variables for the where clause of your cursor also match up properly?
Back to top
View user's profile Send private message
srinut123

New User


Joined: 11 Oct 2005
Posts: 62
Location: India

PostPosted: Thu Jun 11, 2009 4:55 am    Post subject:
Reply with quote

Yes.. i'm just selecting one column.. and the corresponding host variable is mentioned in the fetch.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Jun 11, 2009 5:50 am    Post subject:
Reply with quote

deleted by poster
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Jun 11, 2009 6:49 am    Post subject:
Reply with quote

I have a strange feeling that some thing is missing or mistyped since cut and paste doesn't appear to be used. Are you sure the DCLGEN matches the table?
Back to top
View user's profile Send private message
srinut123

New User


Joined: 11 Oct 2005
Posts: 62
Location: India

PostPosted: Thu Jun 11, 2009 9:30 am    Post subject: Reply to: -303 in db2 fetch
Reply with quote

yes.. I made sure that the type is same.. huh! looking strange! I tried with all data types.. nothing works during run time
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Jun 12, 2009 6:22 am    Post subject:
Reply with quote

Hello,

What happens if you try to use some other column from that table?

What happens if you try to select this column in spufi?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Multi row fetch - "for read only... Nileshkul DB2 3 Sun Aug 14, 2016 12:52 am
No new posts JCL to fetch schedule status from act... parasmalik20 CA Products 1 Thu Jun 02, 2016 7:11 pm
No new posts ABEND due to FETCH FAILED jackzhang75 ABENDS & Debugging 17 Thu Mar 10, 2016 3:08 am
No new posts Sort Query to fetch particular records RahulG31 DFSORT/ICETOOL 13 Fri Mar 04, 2016 8:17 pm
No new posts Fetch the latest record from a table ... maxsubrat DB2 8 Tue Dec 01, 2015 7:13 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us