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
 

 

Undeclared table problem in COBOL DB2 program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Undeclared table problem in COBOL DB2 program
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    Post subject: Re: Undeclared table problem in COBOL DB2 program
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    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Thu Aug 19, 2010 5:36 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem commiting to DB2 from IMS MPP Ole Soerensen IMS DB/DC 2 Wed Jul 26, 2017 5:19 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm


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