MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Handling DB2 Varchar Bit type data to Char type format

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
suggala_r
Beginner


Joined: 07 Nov 2004
Posts: 12
Topics: 2

PostPosted: Sun Nov 07, 2004 1:37 am    Post subject: Handling DB2 Varchar Bit type data to Char type format Reply with quote

Hi,
We use Varchar Bit type data for storing Unicode descriptions(multi lingual). So far we are able to manage everything(inserts,updates etc) through Cobol stored proc via ASP/java front end.We are successful in using this datatype for storing multilingual data(French,Hindi,Spanish,Italian etc).


Now need arised to compare Char Type descritons to this Varchar Bit Desc with in Cobol/DB2 . Since the storage is different in both data types for English Language (Ex. a Word "MVSFORUM" in English gets stored
differently - as long as Table values concerned) . If we compare the word in Both datatypes , the result is different.

Is there any way to compare the values in these datatypes.Like functions etc (ex like Date variable can be converted to Char by
Char(date_column)).

or any ideas in this regard are helpful in completion of my project


Note : reason for this is Our application has to sync the Domain data/Desc related to English language with other application which is a DB2 app.

Thank you in advance...
_________________
Raghu
Back to top
View user's profile Send private message Yahoo Messenger
suggala_r
Beginner


Joined: 07 Nov 2004
Posts: 12
Topics: 2

PostPosted: Sun Nov 07, 2004 2:08 am    Post subject: Reply with quote

Added information to my question is Our DB2 version is 7.
_________________
Raghu
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Mon Nov 08, 2004 10:51 am    Post subject: Reply with quote

Raghu,

How did you store the data in the varchar column? If you used to cobol-db2 subroutine then you must have defined the variable to store in the table.

For ex: we have a varchar column of length 3000 bytes. we use that to store 3 varibles in an array of 250 times with each occurance for a length of 12 bytes

Code:

 01 DB2-VAR-CHAR-AREA1.                               
 05 DB2-VAR-CHAR-ARRAY1 OCCURS  250 TIMES INDEXED BY IDX1.       
    10  VAR-CHAR-DATE1      PIC S9(09) COMP-3.       
*                           FORMAT: YYYYMMDD         
    10  VAR-CHAR-QTY        PIC S9(09) COMP-3.       
    10  VAR-CHAR-IND        PIC  X(02).               


Now if we want to validate any of of the fields then we simply retrieve into the varchar column into host variable and then validate each individual field treating it as an array of 12 bytes each

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
suggala_r
Beginner


Joined: 07 Nov 2004
Posts: 12
Topics: 2

PostPosted: Fri Nov 12, 2004 12:11 pm    Post subject: Reply with quote

Hi Kolusu,
I did not understand your reply. May be description of my question is not proper.

We used Cobol-Db2 stored procedures for inserting the descriptions to the tables. But all along only through store proc and Web. Not thru
SPUFI etc. Because of data definition of column(Varchar by Bit type).

My question is is it possible to compare a value in Varchar by Bit to
value in Varchar(simple).

Hope this helps.
_________________
Raghu
Back to top
View user's profile Send private message Yahoo Messenger
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Mon Nov 29, 2004 6:03 am    Post subject: Reply with quote

Hi Raghu,
can u tell me whts ure application really want to do.
Quote:

Varchar by Bit type
.
Quote:

Char Type descritons to this Varchar Bit Desc with in Cobol/DB2
.comparison of char and varchar can be done thru cobol pgm and selecting data thru sql which u need.u can use Inspect verb.There r also tools available for data processing.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group