View previous topic :: View next topic
|
Author |
Message |
diwakar_rao
New User
Joined: 04 Mar 2007 Posts: 14 Location: Chennai
|
|
|
|
Hi,
I have a DCLGEN declaration like this
DB2 declaration
empname VARCHAR(20)
---------------------------------------------------
cobol host variable declaration
01 emp.
05 hv-empname.
49 hv-emp-len PIC S9(4) COMP-2.
49 hv-emp-txt PIC X(20).
----------------------------------------------------
EXEC SQL DECLARE <cursorname> CURSOR FOR
SELECT empname from emp
END-EXEC.
then fetching the data
EXEC SQL FETCH <cursorname> INTO :hv-empname
My pbm is when i try displaying this hv-empname , i am getting <.<data in empname> (dot followed by data in empname)
Kindly update me how to display a VARCHAR db2 data in to host variable in cobol ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You cannot "display" the group variable - the first field will nearly always contain one or more undisplayable values.
To see the name and not the "unprintable" data, try displaying hv-emp-txt. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Something like
DISPLAY hv-emp-len '*' hv-emp-txt(1:hv-emp-len) '*'
should get you what you want..... |
|
Back to top |
|
|
diwakar_rao
New User
Joined: 04 Mar 2007 Posts: 14 Location: Chennai
|
|
|
|
Thanks it is working now |
|
Back to top |
|
|
|