Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2011
    Posts
    13

    Unanswered: -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...

  2. #2
    Join Date
    May 2009
    Posts
    508
    Provided Answers: 1
    It depends on what you are trying to do.

  3. #3
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    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/

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Shouldn't that minus sign be an equal sign?

    Andy

  5. #5
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    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/

  6. #6
    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....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •