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
No new posts RULES(NOEVENPACK) in cobol jackzhang75 COBOL Programming 5 Wed Mar 29, 2017 12:47 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm


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