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
 

 

Problem with varchar datatype while comparing in the cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Problem with varchar datatype while comparing in the cobol
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    Post subject: hai
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    Post subject: Re: Problem with varchar datatype while comparing in the cob
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    Post subject:
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    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