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
 

 

Cobol Host Variables not populated

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
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

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

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

Site Director


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

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

Active User


Joined: 15 Dec 2009
Posts: 365
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
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
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts COBOL Programming Sandpit? jodrisco COBOL Programming 6 Wed Apr 12, 2017 3:47 am


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