Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1249
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts FUSE - IBM MQ - CICS integration error Kevin Vaz CICS 1 Mon Sep 18, 2017 4:31 pm
No new posts Reply MQ open error Vignesh Sid COBOL Programming 6 Thu Sep 07, 2017 6:02 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us