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

-303 in db2 fetch


IBM Mainframe Forums -> ABENDS & Debugging
Post new topic   Reply to topic
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
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
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
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
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
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
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
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
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
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
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

Moderator Emeritus


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

PostPosted: Fri Jun 12, 2009 6:22 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> ABENDS & Debugging

 


Similar Topics
Topic Forum Replies
No new posts Fetch data from programs execute (dat... DB2 3
No new posts Code Multi Row fetch in PL1 program PL/I & Assembler 1
No new posts Need to fetch data from so many DB2 t... DB2 9
No new posts fetch the record number from FMNMAIN ... CLIST & REXX 10
No new posts Fetch the Dataset names from inside m... TSO/ISPF 18
Search our Forums:

Back to Top