IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

what is the equivalent data type of SMALLINT of DB2 in Easy?


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vijayalayancse

New User


Joined: 29 Aug 2005
Posts: 25
Location: Chennai

PostPosted: Sat Apr 05, 2008 4:44 am
Reply with quote

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

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sat Apr 05, 2008 5:55 am
Reply with quote

As far as I know, the "W 02 B" should be correct, but beyond that, I have no idea......
Back to top
View user's profile Send private message
pranav yadav

New User


Joined: 04 Apr 2008
Posts: 9
Location: Noida, India

PostPosted: Sat Apr 05, 2008 7:06 pm
Reply with quote

For Binary variable , you always need to intialise the variable,
so the definition would be ,
W 2 B 0.
I hope this should work.
icon_smile.gif
Back to top
View user's profile Send private message
vijayalayancse

New User


Joined: 29 Aug 2005
Posts: 25
Location: Chennai

PostPosted: Mon Apr 07, 2008 8:38 am
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Apr 07, 2008 8:52 am
Reply with quote

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

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Apr 07, 2008 4:49 pm
Reply with quote

How is WS-CNT defined? What is the table definition of TP_123?
Back to top
View user's profile Send private message
keyarika

New User


Joined: 24 May 2008
Posts: 10
Location: bangalore

PostPosted: Mon Sep 08, 2008 11:25 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts JCL EXEC PARM data in C Java & MQSeries 2
Search our Forums:

Back to Top