View previous topic :: View next topic |
Author |
Message |
suggala_r Beginner
Joined: 07 Nov 2004 Posts: 12 Topics: 2
|
Posted: Sun Nov 07, 2004 1:37 am Post subject: Handling DB2 Varchar Bit type data to Char type format |
|
|
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 |
|
 |
suggala_r Beginner
Joined: 07 Nov 2004 Posts: 12 Topics: 2
|
Posted: Sun Nov 07, 2004 2:08 am Post subject: |
|
|
Added information to my question is Our DB2 version is 7. _________________ Raghu |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
|
Posted: Mon Nov 08, 2004 10:51 am Post subject: |
|
|
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 |
|
 |
suggala_r Beginner
Joined: 07 Nov 2004 Posts: 12 Topics: 2
|
Posted: Fri Nov 12, 2004 12:11 pm Post subject: |
|
|
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 |
|
 |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Mon Nov 29, 2004 6:03 am Post subject: |
|
|
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 |
|
 |
|
|