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
 

 

Error code -206 while fetching record from table

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

New User


Joined: 10 May 2009
Posts: 72
Location: bangalore

PostPosted: Mon May 11, 2009 10:41 am    Post subject: Error code -206 while fetching record from table
Reply with quote

Hi All,

I am getting sqlcode -206 in the following fetch query:

EXEC SQL
SELECT EMPLOYER_NAME, PRODUCT_ID
INTO :DCLPLCY-EMPLOYER-NAME,:DCLPLCY-PRODUCT-ID
FROM POLICY
WHERE :DCLPLCY-POLICY-NBR = WS-POLICY-NBR
END-EXEC

i checked the reason as - name IS NOT VALID IN THE CONTEXT WHERE IT IS USED

please help me in debugging this.
Back to top
View user's profile Send private message

Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Mon May 11, 2009 11:00 am    Post subject:
Reply with quote

Hi,
Please verify the column names in the query.

Code:
WHERE :DCLPLCY-POLICY-NBR = WS-POLICY-NBR
Back to top
View user's profile Send private message
sm_2009

New User


Joined: 10 May 2009
Posts: 72
Location: bangalore

PostPosted: Mon May 11, 2009 11:02 am    Post subject:
Reply with quote

In DCLGEN

DCLPLCY-POLICY-NBR is PIC S9(9) USAGE COMP.

and ws-policy-nbr is PIC 9(9).

is it creating any problem?
Back to top
View user's profile Send private message
anandinmainframe

Active User


Joined: 31 May 2007
Posts: 171
Location: India

PostPosted: Mon May 11, 2009 11:29 am    Post subject: Reply to: Error code -206 while fetching record from table
Reply with quote

Sm,
The reason for -206 is
Quote:

column-name IS NOT A COLUMN OF AN INSERTED TABLE, UPDATED TABLE, OR ANY TABLE IDENTIFIED IN A FROM CLAUSE

so check whether the column name is correct or not.[/quote]
Back to top
View user's profile Send private message
sm_2009

New User


Joined: 10 May 2009
Posts: 72
Location: bangalore

PostPosted: Mon May 11, 2009 11:43 am    Post subject: Reply to: Error code -206 while fetching record from table
Reply with quote

okie, i removed the working storage variable from WHERE clause.

the error is debugged.

Thanks all.
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm


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