Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us