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

Problem with varchar datatype while comparing in the cobol


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

New User


Joined: 18 Aug 2005
Posts: 2

PostPosted: Thu Aug 18, 2005 6:28 pm
Reply with quote

Here I have a problem with an sql query involving a VARCHAR variable.

Eg: select count(*) from table_name where
cond1... and
cond2... and
sample_text <> : host-variable;


Here sample_text is a varchar variable of max lenght 500;

while executing this query I am getting -134 as SQL RETURN code.

Please help me out to over come this situation. I need to execute this query in a COBOL program using host-variable (COBOL host variables) in the condition against the sample_text (DB2 variable). Please give me the declaration for the COBOL host variable and how can I use this in my program.
Back to top
View user's profile Send private message
Para BB400

New User


Joined: 04 Aug 2005
Posts: 1

PostPosted: Fri Aug 19, 2005 2:41 pm
Reply with quote

HAI NANDU,

PLEASE FIND THE BELOW HOST VARIABLE DECLARATION FORVARCHAR FIELDS

DECLARED DB2 TABLE FIELD
====================

INPUT_DATA VARCHAR(1000) NOT NULL




HOST VARIABLE DECLARATION
====================

01 HOST-INPUT-DATA.
49 HOST-INPUT-DATA-LEN PIC S9(04) COMP.
49 HOST-INPUT-DATA-TEXT PIC X(1000).
Back to top
View user's profile Send private message
nandu_d

New User


Joined: 18 Aug 2005
Posts: 2

PostPosted: Fri Aug 19, 2005 3:51 pm
Reply with quote

Hi

Thanks for ur quick response. I tried the same but we are getting the
-134 error. Any alternative solution for this problem.
Back to top
View user's profile Send private message
mainframesguru

New User


Joined: 24 Jun 2005
Posts: 36
Location: Hyderabad

PostPosted: Fri Aug 19, 2005 5:37 pm
Reply with quote

Hi Nandu,


Eg: select count(*) from table_name where
cond1... and
cond2... and
sample_text <> : host-variable;

01 HOST-INPUT-DATA.
49 HOST-INPUT-DATA-LEN PIC S9(04) COMP.
49 HOST-INPUT-DATA-TEXT PIC X(1000).

In the example, try to find out the HOST-INPUT-DATA-TEXT actual length
(the length of data it is holding) and move it to HOST-INPUT-DATA-LEN
and then use it.


Thanks And Regards
Vamshi
ICC-ISH
Chennai
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top