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 DB2 Stored Procedure

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
rahuindo

New User


Joined: 09 Apr 2008
Posts: 83
Location: Chennai

PostPosted: Thu Jan 23, 2014 3:41 am    Post subject: S0C4 Abend in DB2 Stored Procedure
Reply with quote

Hi,
I have a COBOL DB2 Stored Procedure which is having the following linkage variables:
Code:

01  SP-IP-1                        PIC X(09) .     
01  SP-IP-2                PIC X(100).     
01  SP-IP-3                   PIC X(06) .     
01  SP-IP-4                  PIC X(01) .     
01  SP-IP-5                  PIC X(02) .     
01  SP-IP-6          PIC X(02) .     
01  SP-IP-7                 PIC X(01) .     
01  SP-IP-8                  PIC X(03) .     
01  SP-IP-9                   PIC X(08) .     
01  SP-IP-10                PIC X(08) .     
01  SP-IP-11             PIC X(08) .     
01  SP-OP-SQL-CD                     PIC X(06).     
01  SP-OP-OUT-SQL-MSG.                               
     49  SP-OP-SQL-MSG-LTH           PIC S9(4) COMP.
     49  SP-OP-SQL-MSG-TXT           PIC X(1000).   
01  SP-OP-INFO-MSG.                                 
     49  SP-OP-INFO-MSG-LTH          PIC S9(4) COMP.
         49  SP-OP-INFO-MSG-TXT          PIC X(1200).         
    01  SP-OUT-CLOB     USAGE IS SQL TYPE IS CLOB(700000).


While compiling this Stored Procedure, I did not see any warnings from Compiler.
This Stored Procedure calls another Stored Procedure and then reformats the output and generates XML and moves the XML to the CLOB variable SP-OUT-CLOB.

With the above layout, I face a 0C4 abend whenever I try to move any values to the O/P variables.
this is a sample code of where I face the abend:

Code:

MOVE ' ' TO SP-OP-INFO-MSG-TXT
MOVE 1 TO SP-OP-INFO-MSG-LTH


I can confirm that since I debugged using the Xpeditor.

However, the strange fact is that the Stored Procedure does not abend when I remove the following variables from the output parameters:
Code:
01  SP-OP-OUT-SQL-MSG.                               
     49  SP-OP-SQL-MSG-LTH           PIC S9(4) COMP.
     49  SP-OP-SQL-MSG-TXT           PIC X(1000).   


Has it something to do with the fact that I've 2 VARCHARs in my O/P parameters?
Back to top
View user's profile Send private message

rahuindo

New User


Joined: 09 Apr 2008
Posts: 83
Location: Chennai

PostPosted: Thu Jan 23, 2014 4:19 am    Post subject: Reply to: S0C4 Abend in DB2 Stored Procedure
Reply with quote

I looked at the Compiler warnings and I found this:
"SP-OP-INFO-MSG" or one of its subordinates was referenced, but
"SP-OP-INFO-MSG" was a "LINKAGE SECTION" item that did not have
addressability. This reference will not be resolved successfully at
execution.

This error implied that the SP-OP-INFO-MSG should also be referenced in the PROCEDURE division. I was not referencing this variable in the PROCEDURE division.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7254

PostPosted: Thu Jan 23, 2014 5:27 am    Post subject: Reply to: S0C4 Abend in DB2 Stored Procedure
Reply with quote

You mean the PROCEDURE DIVISION USING...?

The parameter also needs to be supplied by the CALLing program. else you'll still have a problem.
Back to top
View user's profile Send private message
rahuindo

New User


Joined: 09 Apr 2008
Posts: 83
Location: Chennai

PostPosted: Thu Jan 23, 2014 6:09 am    Post subject: Reply to: S0C4 Abend in DB2 Stored Procedure
Reply with quote

Hi Bill,
Yes, I meant the PROCEDURE DIVISION Using.. The Calling program was passing this parameter. It was just not defined in the PROCEDURE DIVISION Using.
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 -> COBOL Programming 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