If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > -927 sqlcode in db2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-12-11, 13:54
thamin thamin is offline
Registered User
 
Join Date: Jul 2011
Posts: 13
-927 sqlcode in db2

Hello
I am running db2 cobol program and its giving me a sql code of 0927 while executing query

exec sql
set ws-date - current_date
end

anybody have idea on how to resolve this?

Thanks...
Reply With Quote
  #2 (permalink)  
Old 09-12-11, 16:17
Stealth_DBA Stealth_DBA is offline
Registered User
 
Join Date: May 2009
Posts: 472
It depends on what you are trying to do.
Reply With Quote
  #3 (permalink)  
Old 09-12-11, 16:37
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
Quote:
Originally Posted by thamin View Post
I am running db2 cobol program and it's giving me a sql code of 0927 while executing query

exec sql
set ws-date - current_date
end
An SQLCODE -927 indicates that you run your program directly instead of using the DB2 RUN command (actually: DSN subcommand).
Programs containing EXEC SQL should be run under supervision of DB2, not independently.
Have a look at the DB2 Command Reference Guide (SC18-9844) for the syntax of the DSN RUN subcommand. (It's on page 377.)
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/
Reply With Quote
  #4 (permalink)  
Old 09-12-11, 17:00
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Shouldn't that minus sign be an equal sign?

Andy
Reply With Quote
  #5 (permalink)  
Old 09-12-11, 17:37
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
Quote:
Originally Posted by ARWinner View Post
Shouldn't that minus sign be an equal sign?
Not just that: there is a colon ( : ) missing in front of the variable name:
Code:
EXEC SQL   SET :ws-date = current_date   END-EXEC
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/
Reply With Quote
  #6 (permalink)  
Old 09-14-11, 23:20
thamin thamin is offline
Registered User
 
Join Date: Jul 2011
Posts: 13
Hello, the issue got resolved by having a loadlib QSTART.LOADLIB (?) in STEPLIB of the DB2 cobol program.

Thanks for all your responses... Appreciate it.

Thanks....
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On