-927 THE LANGUAGE INTERFACE (LI) WAS CALLED WHEN THE CONNECTING
ENVIRONMENT WAS NOT ESTABLISHED. THE PROGRAM SHOULD BE INVOKED
UNDER THE DSN COMMAND
Explanation: In the TSO environment, the user has attempted to execute an application program without first establishing the correct execution environment by issuing the DSN command. In the IMS, CICS, or call attachment facility (CAF) environment, the user has attempted to execute an application program that is not using the correct language interface module.
System Action: The statement cannot be executed.
Programmer Response: In the TSO environment, DB2 application programs should be invoked under the RUN subcommand of the DSN command processor. In the IMS, CICS or CAF environment check that the application was link-edited with or is dynamically allocating the correct language interface module. The language interface modules required in each environment are as follows:
The DYNAM option can result in the incorrect language interface module being loaded at runtime.
I read a discussion on the web where it states an instance where you're likely to get -927. Please be warned that your situation could be different from this. Hope this would be of help:
If you're situation is that you're trying to execute a non-db2 cobol program that is calling a db2-calling program. You HAVE to use the IKJEFT01-JCL even if your main program doesn't use DB2-commands. And you have to bind a plan for this program. Ohterwise you cannot connect to the DB2-system an receive a SQL-Code -927.