Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

S0C4 Abend in Stored Procedure

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: S0C4 Abend in Stored Procedure
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Wed Sep 17, 2014 12:04 am    Post subject:
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    Post subject: Reply to: S0C4 Abend in Stored Procedure
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

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

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

fyi..
http://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    Post subject: Reply to: S0C4 Abend in Stored Procedure
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Wed Sep 17, 2014 1:42 am    Post subject:
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    Post subject: Reply to: S0C4 Abend in Stored Procedure
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Wed Sep 17, 2014 10:02 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us