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

Undeclared table problem in COBOL DB2 program


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

New User


Joined: 20 Jan 2006
Posts: 12
Location: kochi

PostPosted: Thu Aug 19, 2010 4:44 pm
Reply with quote

Hi,

I am receving the following message in endevor at bind package time

2849 COL 16 STATEMENT REFERENCES UNDECLARED TABLE "DL@DDA"."TDPMPOR"

However i have included the table

1660 EXEC SQL
1661 INCLUDE TDPMPOR
1662 END-EXEC.

The actual SQL query is as follows:
2848 EXEC SQL
2849 SELECT MPNUMBER
2850 INTO :BRF65DB-MPNUMBER
2851 FROM DL@DDA.TDPMPOR
2852 WHERE WONUMBER = :BRF65DB-WORKS-ORDER
2853 AND WOITEM = :BRF65DB-WORKS-ITEM
2854 FETCH FIRST 1 ROW ONLY
2855 END-EXEC.


I have included SQLCA , any thoughs on this strange problem will be very helpful.
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 Aug 19, 2010 5:14 pm
Reply with quote

trgk03 wrote:
Hi,

I am receving the following message in endevor at bind package time

2849 COL 16 STATEMENT REFERENCES UNDECLARED TABLE "DL@DDA"."TDPMPOR"

However i have included the table

1660 EXEC SQL
1661 INCLUDE TDPMPOR
1662 END-EXEC.

The actual SQL query is as follows:
2848 EXEC SQL
2849 SELECT MPNUMBER
2850 INTO :BRF65DB-MPNUMBER
2851 FROM DL@DDA.TDPMPOR
2852 WHERE WONUMBER = :BRF65DB-WORKS-ORDER
2853 AND WOITEM = :BRF65DB-WORKS-ITEM
2854 FETCH FIRST 1 ROW ONLY
2855 END-EXEC.


I have included SQLCA , any thoughs on this strange problem will be very helpful.


What is in "INCLUDE TDPMPOR", perhaps there is an error in it.
Back to top
View user's profile Send private message
trgk03

New User


Joined: 20 Jan 2006
Posts: 12
Location: kochi

PostPosted: Thu Aug 19, 2010 5:23 pm
Reply with quote

Within INCLUDE TDPMPOR

************************************************************
* SQL DECLARATION FOR TABLE TDPMPOR DEFN. FROM
************************************************************
EXEC SQL
DECLARE TDPMPOR TABLE
(WONUMBER CHAR (006) NOT NULL WITH DE
MPNUMBER CHAR (004) NOT NULL WITH DE
MPVERSN CHAR (002) NOT NULL WITH DE
ORDERNO CHAR (006) NOT NULL WITH DE
WOITEM CHAR (003) NOT NULL WITH DE
PLINENO CHAR (007) NOT NULL WITH DE
CANCEL CHAR (001) NOT NULL WITH DE
CUTNO CHAR (003) NOT NULL WITH DE
TIMEST TIMESTAMP NOT NULL WITH DE
LENGTH DECIMAL (05,00) NOT NULL WITH DE
WIDTH DECIMAL (05,00) NOT NULL WITH DE
WEIGHT DECIMAL (05,03) NOT NULL WITH DE
END-EXEC.
************************************************************
************************************************************
* COBOL DECLARATION FOR TABLE TDPMPOR
VERSION 8 REL. 1.0
************************************************************
01 ROW-TDPMPOR.
05 MPOR-WO-NUMBER PIC X(0006).
05 MPOR-MP-NUMBER PIC X(0004).
05 MPOR-MP-VERSION PIC X(0002).
05 MPOR-ORDERNO PIC X(0006).
05 MPOR-ITEMNO PIC X(0003).
05 MPOR-PLINENO PIC X(0007).
05 MPOR-CANCEL PIC X(0001).
05 MPOR-CUTNO PIC X(0003).
05 MPOR-TIME-STAMP PIC X(026).
05 MPOR-LENGTH PIC S9(05) C
05 MPOR-WIDTH PIC S9(05) C
05 MPOR-WEIGHT PIC S9(02)V9(03) C
************************************************************
* NUMBER OF COLUMNS DESCRIBED BY THIS DECLARATION IS 12
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Aug 19, 2010 5:36 pm
Reply with quote

maybe remove the table qualification DL@DDA from your FROM statement.

and what are your bind parms?
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 Replacing FILLER with FILLER<SeqNu... DFSORT/ICETOOL 2
No new posts Error to invoke MPP program through B... IMS DB/DC 3
No new posts Compile Sp Cobol base COBOL Programming 1
No new posts SQLCODE=-311 in Cobol SP-DB2. COBOL Programming 2
No new posts Unload and Load ISPF Table TSO/ISPF 4
Search our Forums:

Back to Top