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

error during compilation


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
santosh100678

New User


Joined: 21 Sep 2009
Posts: 55
Location: Kolkatta

PostPosted: Sun Dec 27, 2009 3:41 pm
Reply with quote

working storage section
01 ws-count pic 9(01) value 0.
01 ws-co pic X(2).
01 ws-vend pic X(4).

Procedure divison.
SELECT COUNT(*) INTO :WS-COUNT
WHERE CO_CD = :WS-CO from table
AND VEND_NBR = :WS-VEND

this query is in procedure division WS-COUNT,WS-CO ,WS-VEND
are host veriable but during compilation some time copiler throw error message unusable veriable some time it shows sucessful .
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Mon Dec 28, 2009 12:17 am
Reply with quote

Please use copy/paste to show your SQL (instead of manually keying it), and show all relevant initializing statements for your host variables and the host variable definitions themselves, and the EXACT message you are receiving. Again, do not key the above info. Use copy/paste. And use BBCode (see FAQ).
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 Dec 28, 2009 1:15 am
Reply with quote

Suggest that you check the SQL manual for your version of DB2, PIC 9(01) would not be the proper format for the results of count(*)!
Back to top
View user's profile Send private message
ajeshrn

New User


Joined: 25 Mar 2009
Posts: 78
Location: India

PostPosted: Mon Dec 28, 2009 12:00 pm
Reply with quote

Hi santosh100678,

Please check your query. The syntax is wrong. U have put the where condition before the From.I guess the below query is what you are trying to get.

Code:

SELECT COUNT(*) INTO :WS-COUNT
 from table
WHERE CO_CD = :WS-CO
AND VEND_NBR = :WS-VEND
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Getting Error while trying to establi... DB2 3
Search our Forums:

Back to Top