View previous topic :: View next topic
|
Author |
Message |
vijayalayancse
New User
Joined: 29 Aug 2005 Posts: 25 Location: Chennai
|
|
|
|
Team,
what is the equivalent data type of SMALLINT of DB2 in Easytrieve?
I have tried W 02 P and W 02 B..
Actually the length of the variable in DB2 is only 2..
I am getting the follwing error
14 SQL FETCH C1
INTO :WS-CNT,:WS-COMM-CD
14 *******B204 SQL - INVALID HOSTVAR DATATYPE 836
Any help would be greatly appreciated.. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
As far as I know, the "W 02 B" should be correct, but beyond that, I have no idea...... |
|
Back to top |
|
|
pranav yadav
New User
Joined: 04 Apr 2008 Posts: 9 Location: Noida, India
|
|
|
|
For Binary variable , you always need to intialise the variable,
so the definition would be ,
W 2 B 0.
I hope this should work.
|
|
Back to top |
|
|
vijayalayancse
New User
Joined: 29 Aug 2005 Posts: 25 Location: Chennai
|
|
|
|
Hi,
Thanks for ur response. I even tried that also. Still i am getting invalid declaration.
Any help would be greatly appreciated.
10 DEFINE WS-COMM-CD W 02 B 0
11 SQL DECLARE C1 CURSOR FOR + SELECT COUNT(*),TP_123+
FROM PRTHD.TP_XXYY_ + WHERE TP_COMM_STAT_CD=5 AND + LAST_UPD_TS < CURRENT TIMESTAMP - 60 MINUTE + GROUP BY TP_123 WITH UR
12 JOB INPUT NULL FINISH EOFPROC 0
0
13 SQL OPEN C1 0
0
14 SQL FETCH C1 + 0
INTO :WS-CNT,:WS-COMM-CD 0
14 *******B204 SQL - INVALID HOSTVAR DATATYPE 836
F1=HELP F2=SPLIT F3=END F4=RETURN F5=IFIND F6=BOOK
F7=UP F8=DOWN F9=SWAP F10=LEFT F11=RIGHT F12=RETRIEVE
. . . . . . . . . . . . . . . . . . . . . . . . . . . |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
This is a bit round-a-bout, but do you have some cobol code that successfully executes the same cursor? If not, might one be easily created and tested.
I'd be interested to see what the host variables that work in cobol might be. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
How is WS-CNT defined? What is the table definition of TP_123? |
|
Back to top |
|
|
keyarika
New User
Joined: 24 May 2008 Posts: 10 Location: bangalore
|
|
|
|
Hi,
you can check the sysprint to know the correct datatype. when you include a table in easytreive code, the datatypes for all the columns appear in the sysprint.
check the column name and see the datatype given there, then declare a variable with the same datatype and use that in the program.
thanks,
sagar keyarika |
|
Back to top |
|
|
|