IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

S0C4 Abend in Stored Procedure


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rahuindo

New User


Joined: 09 Apr 2008
Posts: 83
Location: Chennai

PostPosted: Tue Sep 16, 2014 7:04 pm
Reply with quote

Hi,
I am facing a strange issue. I get a S0C4 abend sometimes (not regularly) when I execute my DB2 COBOL Stored Procedure. Please find the details below:
1. The SP takes XML as Input into a CLOB variable. The I/P parm for the field is as below:

Code:

IN SP_IP_PARM CLOB(60000) CCSID EBCDIC FOR SBCS DATA   


2. The following is the XML example received:
Code:

<?xml version="1.0" encoding="UTF-8"?><UpdateList>
<UpdateRow>
<CRTTS>2014-09-05-15.28.30.000986</CRTTS>
<PRODNUM>123456</PRODCONTRACTNUM>
<RELNEWENDATE>0001-01-01</RELNEWENDATE>
</UpdateRow>
</UpdateList>


3. This is the CLOB variable definition to which the XML is moved internally:
Code:

01 WS-SP-IP-CLOB              USAGE IS SQL TYPE IS         
                                    XML AS CLOB(60000).     


4. This is the statement to move the Input XML to WS-SP-IP-CLOB:
Code:

MOVE SP-IP-PARM      TO WS-SP-IP-CLOB             


5. This is the DB2 statement which is been used to parse the XML:
Code:

     EXEC SQL                                                     
           INSERT INTO SESSION.XML_VIEW                           
              SELECT T.XMLCRTTS,
                         ,T.XMLCNTRNUM                                 
                         ,T.XMLNEWENDATE                               
                  from XMLTABLE('$C/UpdateList/UpdateRow'             
                   PASSING XMLPARSE(:WS-SP-IP-CLOB) AS "C"       
                 COLUMNS                                           
                  XMLCRTTS      CHAR(26)   PATH 'CRTTS',         
                  XMLCNTRNUM    CHAR(06)   PATH 'PRODNUM',
                  XMLNEWENDATE  CHAR(10)   PATH 'RELNEWENDATE',   
              )                                                   
              AS T                                               
     END-EXEC       


Now, I don't receive abend frequently but sometimes. For the same input, the SP will be running fine. But then suddenly it will abend with S0C4 Reason 11.

This is the output from the SYSUDUMP:
Code:

0COMPLETION CODE      SYSTEM = 0C4      REASON CODE = 00000011         
                                                                       
   PSW AT ENTRY TO ABEND   078D1000  A0C7AA0A  ILC  04  INTC  0011     
0PSW LOAD MODULE             ADDRESS = 20C73D30  OFFSET = 00006CDA   


The Abend-Aid shows that the problem occurs at the following command:

Code:

           MOVE SP-IP-PARM      TO WS-SP-IP-CLOB                   


Please let me know if something is wrong here?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Wed Sep 17, 2014 12:04 am
Reply with quote

Can you tell us what do you have here, AMODE(?), RMODE(?)?
Back to top
View user's profile Send private message
rahuindo

New User


Joined: 09 Apr 2008
Posts: 83
Location: Chennai

PostPosted: Wed Sep 17, 2014 12:13 am
Reply with quote

Hi Rohit,
The AMODE is 31 and RMODE is ANY.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Wed Sep 17, 2014 12:20 am
Reply with quote

I suspect by removing RMODE(31), RMODE(ANY) , the problem should go away. please let us know.

fyi..
pic.dhe.ibm.com/infocenter/ratdevz/v8r0/index.jsp?topic=%2Fcom.ibm.ent.cbl.zos.doc%2Ftopics%2FMG%2Figymch1912.htm
Back to top
View user's profile Send private message
rahuindo

New User


Joined: 09 Apr 2008
Posts: 83
Location: Chennai

PostPosted: Wed Sep 17, 2014 1:23 am
Reply with quote

Hi Rohit,
Though I am skeptical, I am still changing that because I am calling no other COBOL module from ym stored procedure. However, I do see that calls are being made some internal DB2 modules and hence maybe you're right. I will wait for 24 hours to see if there is any problem even after that.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Wed Sep 17, 2014 1:42 am
Reply with quote

Right, please let us know.

--Additionally what I also know.

Quote:
A 24 bit program can call a 31 bit program with no problem.
A 31 bit program can call a 24 bit program, but will usually have problems.
If the called program is 24 bit, then compile the calling program with AMODE(24).



Quote:
Every program that runs in MVS/ESA is assigned two attributes,
an AMODE (addressing mode) and an RMODE (residency mode):

AMODE Specifies the addressing mode in which the program is
designed to receive control. Generally, the program is also designed to run
in that mode, although a program can switch modes and can have different
AMODE attributes for different entry points within a program module.
MVS/ESA uses a program's AMODE attribute to determine whether a
program invoked using ATTACH, LINK, or XCTL is to receive control in
24-bit or 31-bit addressing mode.

RMODE Indicates where the program can reside in virtual storage.
MVS/ESA uses the RMODE attribute to determine whether a program
must be loaded into virtual storage below 16 megabytes, or can reside
anywhere in virtual storage (above or below 16 megabytes).
Back to top
View user's profile Send private message
rahuindo

New User


Joined: 09 Apr 2008
Posts: 83
Location: Chennai

PostPosted: Wed Sep 17, 2014 9:00 am
Reply with quote

Hi,
It abended again. Here is the Compiler Options which I;ve:
Options in effect:
Code:

NOADATA           
  ADV             
  QUOTE           
  ARITH(COMPAT)   
  AWO             
NOBLOCK0           
  BUFSIZE(12288)   
NOCICS             
  CODEPAGE(37)     
NOCOMPILE(E)       
NOCURRENCY         
  DATA(31)         
NODATEPROC         
NODBCS             
NODECK             
  DIAGTRUNC       
NODLL             
NODUMP               
NODYNAM             
NOEXIT               
NOEXPORTALL         
  FASTSRT           
  FLAG(I,I)         
  FLAGMIG4           
NOFLAGSTD           
  INTDATE(ANSI)     
  LANGUAGE(EN)       
  LIB               
  LINECOUNT(60)     
  LIST               
  MAP               
NOMDECK             
NONAME               
  NSYMBOL(DBCS)     
NONUMBER                                               
  NUMPROC(MIG)                                         
  OBJECT                                               
NOOFFSET                                               
  OPTIMIZE(FULL)                                       
  OUTDD(UTSPRRU1)                                       
  PGMNAME(COMPAT)                                       
  RENT                                                 
  RMODE(AUTO)                                           
NOSEQUENCE                                             
  SIZE(4096000)                                         
  SOURCE                                               
  SPACE(1)                                             
  SQL('SQL(DB2),APOSTSQL')                             
  SQLCCSID                                             
NOSSRANGE                                               
  TERM                       
NOTEST                       
NOTHREAD                     
  TRUNC(BIN)                 
NOVBREF                     
NOWORD                       
  XMLPARSE(XMLSS)           
  XREF(FULL)                 
  YEARWINDOW(1900)           
  ZWB                       


SQL Options in effect:
Code:

 APOSTSQL                         
 ATTACH(TSO)                     
 CCSID(37)                       
 CONNECT(2)                       
 DEC(31)                         
 DECP(DSNHDECP)                   
 NEWFUN(V10)                     
 ONEPASS                         
 PERIOD                           
 STDSQL(NO)                       
 SQL(DB2)                         
 NOXREF                           
 NO SOURCE


AMODE is 31. I am using DSNRLI for the RRSAF attachment.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Wed Sep 17, 2014 10:02 pm
Reply with quote

Again, Did you verify above link Vs your current version and make the changes to the DATA(?) accodingly?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts ISAM and abend S03B JCL & VSAM 10
No new posts Abend S0C4 11 (Page Translation Excep... PL/I & Assembler 16
No new posts WER999A - UNSUCCESSFUL SORT 8ED U Ab... SYNCSORT 5
No new posts the system or user abend SF0F R=NULL COBOL Programming 0
No new posts Need to get an DLI abend like U0200 IMS DB/DC 2
Search our Forums:

Back to Top