Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

error during compilation

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: error during compilation
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: 1239
Location: Richfield, MN, USA

PostPosted: Mon Dec 28, 2009 12:17 am    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
No new posts Error during restore rename archanamuthukrishnan All Other Mainframe Topics 2 Fri Oct 14, 2016 3:30 pm
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us