View previous topic :: View next topic |
Author |
Message |
cappertan Beginner
Joined: 20 May 2003 Posts: 15 Topics: 10
|
Posted: Wed Feb 16, 2005 10:12 am Post subject: varchar key with COBOL to DB2 |
|
|
HI:
I want to do a DB2 read with cobol using a varchar key of 18.
My cobol WS layout is:
01 key.
49 key-comp pic S9(04) comp.
49 key-first-9 pic x(9).
49 key-rest-9 pic x(9).
The key to my table, unfortunately, is defined as VARCHAR 18.
If I move +11 to key-comp, key info to key-first-9, spaces to key-rest-9,
I should get a satisfactory read from DB2. Meaning if the data and key are correct. I should, in theory, get a hit. Right _________________ Capp |
|
Back to top |
|
 |
CZerfas Intermediate
Joined: 31 Jan 2003 Posts: 211 Topics: 8
|
Posted: Thu Feb 17, 2005 9:47 am Post subject: |
|
|
The DB2 precompiler to my knowledge is very peckish concerning the usability of host variables. As far as I know, you have to use the layout for variable definitions documented in the "DB2 application programmer's guide" to be able to fill DB2 varchar data into your COBOL variables.
regards
Christian |
|
Back to top |
|
 |
Sarangadhar Beginner
Joined: 14 Oct 2004 Posts: 130 Topics: 43 Location: virtual village
|
Posted: Fri Mar 18, 2005 8:58 am Post subject: |
|
|
Generating DCLGEN will help, right? _________________ Thanks |
|
Back to top |
|
 |
|
|