Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Cobol Host Variables not populated

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
Author Message
aq16

New User


Joined: 04 Mar 2006
Posts: 3

PostPosted: Sun Feb 07, 2010 9:57 pm    Post subject: Cobol Host Variables not populated
Reply with quote

Hi All,

I have a COBOL+DB2 batch program having a SQL SELECT statement with 'WHERE' clause on Primary key.

I pass the primary key into host variable before EXEC SQL SELECT statement , after returning from DB2 the SQLCODE is 0 but the sleected column host variables are not getting populated.

What may be the problem?

Thanks in advance,
Shishir
Back to top
View user's profile Send private message
References
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 1746
Location: At my desk

PostPosted: Sun Feb 07, 2010 10:34 pm    Post subject:
Reply with quote

How about posting the select and the host variables?
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 13596
Location: 221 B Baker St

PostPosted: Mon Feb 08, 2010 12:31 am    Post subject:
Reply with quote

Hello,

In addition to posting the requested code, what happens if you run this query in spufi?
Back to top
View user's profile Send private message
Kjeld

New User


Joined: 15 Dec 2009
Posts: 82
Location: Denmark

PostPosted: Wed Feb 17, 2010 6:29 pm    Post subject:
Reply with quote

You failure to follow up the request for the actual SQL you intend to execute may indicate that you have found the solution, but anyway:

A common mistake made by programmers is that they expect values for host variables used in the where statement to be updated with the actual value for a fetched row.

You should include the wanted column in the select into a host variable to get the actual value.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1