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 

varchar key with COBOL to DB2

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


Joined: 20 May 2003
Posts: 15
Topics: 10

PostPosted: Wed Feb 16, 2005 10:12 am    Post subject: varchar key with COBOL to DB2 Reply with quote

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
View user's profile Send private message Send e-mail
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Thu Feb 17, 2005 9:47 am    Post subject: Reply with quote

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
View user's profile Send private message
Sarangadhar
Beginner


Joined: 14 Oct 2004
Posts: 130
Topics: 43
Location: virtual village

PostPosted: Fri Mar 18, 2005 8:58 am    Post subject: Reply with quote

Generating DCLGEN will help, right?
_________________
Thanks
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