Posted: Wed Dec 27, 2006 12:20 am Post subject: S0C6 Abend while Opening a Cursor in a DB2-PLI Proram
Hi,
I have a problem of a S0C6 Abend, in the OPEN CURSOR Statement in a DB2-PLI Program. (With a USER ABEND Error Message of 1500). The Job is Bombing with a S0C6 Abend.
Also, there is no statement in the Program forcing a USER ABEND of 1500. I have traced from the Offset Values as well as by temporarily putting display statements in the Program, that the Abend is happening exactly in the OPEN CURSOR Statement.
I am a bit clueless on why this is happening. Hence, I need help / suggestions / ideas on how this problem can be resolved. I am providing all the information below. I request help on this matter.
Declaration of Cursor in the DB2PLI Program.
Code:
------------------------------------------
EXEC SQL DECLARE UPDATE_CLOC1 CURSOR WITH HOLD FOR
SELECT CFL_ID,CFL_NM_TXT,CFL_DESC
FROM L03.FINL_LOCATION_V01
WHERE CFL_ID = :FINL_REC.WS_CFL_ID
FOR UPDATE OF CFL_NM_TXT,CFL_DESC;
L03.FINL_LOCATION_V01 is a SELECT * View on the DB2 Table, SHGG.FINL_LOCATION.
FINL_REC.WS_CFL_ID is a Working Storage Variable, where a valid value is being passed before CURSOR Declaration.
Open Cursor Ststement in the DB2PLI Program
--------------------------------------------
EXEC SQL OPEN UPDATE_CLOC1;
**** The Job is Abending in this Statement with a S0C6 Abend *******
Code:
DCLGEN for the View - L03.FINL_LOCATION_V01
-----------------------------------------------
EXEC SQL DECLARE L03.FINL_LOCATION_V01 TABLE
( CFL_ID CHAR(6) NOT NULL,
CFL_STRTDT DATE NOT NULL,
CFL_RPTG_IND CHAR(1) NOT NULL,
CFL_ENDDT DATE NOT NULL,
CFL_OWN_PCT DECIMAL(5,2),
CFL_OWN_ID CHAR(6),
CFL_LUID CHAR(10) NOT NULL,
CFL_LUDT TIMESTAMP NOT NULL,
CFLST_CD CHAR(10) NOT NULL,
GL_CD CHAR(9),
GLT_CD CHAR(,
CFL_PAR_ID CHAR(6),
CFL_PAR_STRTDT DATE,
CFLT_CD CHAR(10) NOT NULL,
CFL_NM_TXT VARCHAR(40) NOT NULL,
CFL_DESC VARCHAR(240) NOT NULL,
CFL_EVA_IND CHAR(1) NOT NULL,
CFL_SHORT_NM CHAR(,
CFL_ORG_CODE CHAR(2) NOT NULL
) ;
/************************************************** *******
/* PLI DECLARATION FOR TABLE L03.FINL_LOCATION_V01 */
/************************************************** *******
DCL 1 DCLFINL_LOCATION_V01,
5 CFL_ID CHAR(6),
5 CFL_STRTDT CHAR(10),
5 CFL_RPTG_IND CHAR(1),
5 CFL_ENDDT CHAR(10),
5 CFL_OWN_PCT DEC FIXED(5,2),
5 CFL_OWN_ID CHAR(6),
5 CFL_LUID CHAR(10),
5 CFL_LUDT CHAR(26),
5 CFLST_CD CHAR(10),
5 GL_CD CHAR(9),
5 GLT_CD CHAR(,
5 CFL_PAR_ID CHAR(6),
5 CFL_PAR_STRTDT CHAR(10),
5 CFLT_CD CHAR(10),
5 CFL_NM_TXT CHAR(40) VAR,
5 CFL_DESC CHAR(240) VAR,
5 CFL_EVA_IND CHAR(1),
5 CFL_SHORT_NM CHAR(,
5 CFL_ORG_CODE CHAR(2);
Also, I just temporarily modified my Program to get a different SQL CURSOR Executed in the Program, as follows. But, this is also failing in the exactly same way in the OPEN CURSOR Statement.
[code:1:6447f31989]
EXEC SQL DECLARE UPDATE_CLOC2 CURSOR WITH HOLD FOR
SELECT CFL_ID,CFL_NM_TXT,CFL_DESC
FROM L03.FINL_LOCATION_V01
WHERE
CFL_ENDDT _________________ Regards,
Karthik.
EXEC SQL DECLARE UPDATE_CLOC1 CURSOR WITH HOLD FOR
SELECT CFL_ID,CFL_NM_TXT,CFL_DESC
FROM L03.FINL_LOCATION_V01
WHERE CFL_ID = :FINL_REC.WS_CFL_ID
FOR UPDATE OF CFL_NM_TXT,CFL_DESC
END-EXEC;
EXEC SQL OPEN UPDATE_CLOC1 END-EXEC;
EXEC SQL FETCH UPDATE_CLOC2 INTO
CLFINL_LOCATION_V01.CFL_ID,
CLFINL_LOCATION_V01.CFL_NM_TXT,
CLFINL_LOCATION_V01.CFL_DESC
END-EXEC;
EXEC SQL CLOSE UPDATE_CLOC1 END-EXEC;
I guess you are not ending with END-EXEC; that is why you are getting the problem.Just try it. _________________ Shekar
Grow Technically
I have tried even this.But, it is giving a Compilation Error in the DB2 Pre-Compiler, when we add a END-EXEC Statement after an SQL Statement in the Program. Probably, our DB2 Pre-Compiler does not support this.
Also, I checked in many of the Production DB2PLI Programs in our System, and they do not use an END-EXEC Statement. They are working fine.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum