MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

S0C6 Abend while Opening a Cursor in a DB2-PLI Proram

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
karthik_desabhatla
Beginner


Joined: 26 Dec 2006
Posts: 2
Topics: 1

PostPosted: Wed Dec 27, 2006 12:20 am    Post subject: S0C6 Abend while Opening a Cursor in a DB2-PLI Proram Reply with quote

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);

DB2 PLan being Used
----------------------
Code:

BIND PLAN(SHGGCLT) OWNER(L03) +
MEMBER(SHGGCLT) +
ACTION(REPLACE) RETAIN +
VALIDATE(BIND) ISOLATION(CS) FLAG(I) DYNAMICRULES(RUN) +
ACQUIRE(USE) RELEASE(COMMIT) EXPLAIN(NO) +
NODEFER(PREPARE) +
CURRENTDATA(NO) +
NOREOPT(VARS) KEEPDYNAMIC(NO) +
DBPROTOCOL(PRIVATE) +
IMMEDWRITE(NO) ENCODING( 37) +
QUALIFIER(L03) +
CACHESIZE(1024) +
DEGREE(1) +
SQLRULES(DB2) +
DISCONNECT(EXPLICIT)
END


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.
Back to top
View user's profile Send private message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Wed Dec 27, 2006 3:08 am    Post subject: Reply with quote

Karthik,

Not exactly sure but can u try coding this way:
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
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
Back to top
View user's profile Send private message
karthik_desabhatla
Beginner


Joined: 26 Dec 2006
Posts: 2
Topics: 1

PostPosted: Wed Dec 27, 2006 6:58 am    Post subject: Reply with quote

Hi Shekhar,

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.

Regards,
Karthik.
_________________
Regards,
Karthik.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Dec 27, 2006 3:51 pm    Post subject: Reply with quote

karthik_desabhatla,

What module did you use to link edit your pgm? How are you running your pgm? Is it a BMP?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group