PROCEDURE DIVISION.
A0000-MAIN-PARA.
EXEC SQL
DECLARE MFCURSOR CURSOR FOR
SELECT MFID,NAME,SALARY,BIRTH,UPDATE
FROM MAINFRAME
END-EXEC
EXEC SQL
OPEN MFCURSOR
END-EXEC
PERFORM S0000-FETCH-CURSOR
EXEC SQL
CLOSE MFCURSOR
END-EXEC
STOP RUN.
S0000-FETCH-CURSOR.
MOVE 'N' TO WS-CURSOR-EOF
MOVE 'N' TO WS-CURSOR-FETCH-ERROR
EXEC SQL
FETCH MFCURSOR
INTO :MF-MFID,:MF-NAME,:MF-SALARY,:MF-BIRTH,:MF-UPDATE
END-EXEC
MOVE MF-MFID TO EMP-EMPID
MOVE MF-NAME TO EMP-NAME
MOVE MF-SALARY TO EMP-SALARY
MOVE MF-BIRTH TO EMP-BIRTH
MOVE MF-UPDATE TO EMP-UPDATE
MOVE -1 TO EMP-POSITION-IND
EXEC SQL
INSERT INTO EMP_EE(EMPID,NAME,SALARY,BIRTH,POSITION,UPDATE)
VALUES(:EMP-EMPID,:EMP-NAME,:EMP-SALARY,:EMP-BIRTH,
:EMP-POSITION:EMP-POSITION-IND,:EMP-UPDATE)
END-EXEC
IF SQLCODE NOT = 0
DISPLAY 'SQL ERROR(INSERT), ERROR CODE:' SQLCODE
END-IF
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
coria wrote:
Thank you everyone, why the SQLCODE is '00000092P' when i executing a COB/DB2 pgm by submiting a JCL
Being aware that 92P is actually -927, the FM says:
Quote:
-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:
but still, i am not very clear about the words: "In the TSO environment, DB2 application programs should be invoked under the RUN subcommand of the DSN command processor"
could you pls give me a suggestion that what i can do here?
i have bind the plan, also the pre-compile etc. has passed, is there any other thing i missed?
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
Quote:
could you pls give me a suggestion that what i can do here?
I would be rather more interested in your JCL Step being used to execute the DB2 program. You might want to use utilities like IKJEFT01 or IKJEFT1B to run the program.