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

S0C6 Abend in Batch Cobol pgm


IBM Mainframe Forums -> ABENDS & Debugging
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vasif

New User


Joined: 11 Feb 2008
Posts: 35
Location: Chennai

PostPosted: Mon Mar 09, 2009 1:39 pm
Reply with quote

Hi All,
I have 2 programs, A & B. Pgm A is CALLing Pgm B inside a loop. Both pgms are using the same file using an EXTERNAL declaration. The first call to the Pgm B runs well. But for the 2nd iteration, the CALL statement to Pgm B is abending with S0C6 abend.

Please let me know how to resolve this abend.

Asif.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Mar 09, 2009 4:02 pm
Reply with quote

Hi,

This ABEND is caused by a specification exception all one can say, with the information in hand : Correct the program logic error that caused the specification exception and resubmit the job.

So, it would be wise if you please post the SYSOUT or complete diagnostic information from the failed JOB.
Back to top
View user's profile Send private message
rsnram007

New User


Joined: 28 Jan 2009
Posts: 11
Location: chennai

PostPosted: Tue Mar 10, 2009 8:49 am
Reply with quote

This ABEND is caused by a specification exception. One of
the following occurred:

1) A data, instruction, or control-word address does not
specify the proper storage boundary alignment.

2) An instruction specifies an odd register number when it
should specify the even numbered register of an even-
odd register pair.

3) A floating point register other than 0, 2, 4, or 6 was
specified in a floating point instruction.
4) The multiplier or divisor in a decimal (packed)
arithmetic instruction exceeds 15 digits and sign.

5) The first operand field is shorter than or equal to
the second operand field in a decimal (packed)
multiplication or division instruction.

6) The block address in a SET STORAGE KEY or INSERT
STORAGE KEY instruction has the four low-order bits
not all zero.

7) A PSW with a non-zero protection key was encountered
when protection was not installed.

Thanks,
Suresh
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Mar 10, 2009 9:32 am
Reply with quote

Hello Vasif and welcome to the forum,

As an experiment, suggest you set up a run that processes A then calls B (just like the start of your posted process. Then call B again, displaying "footprints" as the code continues. Pay special attantion to the use of the "same" file. heck the file-status for each action.

It may help if you post the select, fd, and jcl for the external file.
Back to top
View user's profile Send private message
vasif

New User


Joined: 11 Feb 2008
Posts: 35
Location: Chennai

PostPosted: Sun Apr 19, 2009 5:21 pm
Reply with quote

Hi All,
Thanks for your suggestions. But i figured out that the problem was because of calling B dynamically. when i put a static call i.e CALL 'B' using ..., it ran successfully. Do i conclude that EXTERNAL use of a file is only possible thru a STATIC call? Please share your observations.

Asif.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sun Apr 19, 2009 5:46 pm
Reply with quote

Dynamic/Static should not be the problem
unless your usage of the EXTERNAL keyword 'locked' you into such a situation.
  1. show us from both programs old (if you changed more than the CALL syntax) or new (if you only changed the CALL syntax):
    • FD section
    • Select clause
    • Record description entries
    • how/where you have coded the EXTERNAL keyword
  2. the logic (summarized) from both programs for I/O on the file
  3. The JCL for the Step executing your program


by the way, thanks for getting back.
In order to answer your question, the above mentioned info is necessary.
Back to top
View user's profile Send private message
vasif

New User


Joined: 11 Feb 2008
Posts: 35
Location: Chennai

PostPosted: Wed Apr 22, 2009 4:01 pm
Reply with quote

Here are the FD and SELECT statements declared exactly in the same way in both the programs.
Code:


SELECT    ERR-RPT-FILE          ASSIGN  TO ERREPORT.

FD  ERR-RPT-FILE IS    EXTERNAL                       
    LABEL RECORDS ARE STANDARD                 
    RECORDING MODE F                           
    BLOCK  CONTAINS 0 RECORDS                   
    DATA RECORD IS  ERR-RPT-REC.               
                                               
01  ERR-RPT-REC                     PIC X(133).


The logic is pretty simple
Pgm A
Code:

PERFORM 5 TIMES
IF VAR-A > 3 
    WRITE ERR-RPT-REC FROM  ERR-HDR1
END-IF
CALL PGM-B USING PARMS   --> had to replace with a static call
END-PERFORM.


In Pgm B,
Code:

IF VAR-B > 10 
    WRITE ERR-RPT-REC FROM  ERR-DET.
GO BACK.


The first call goes well, from the 2nd comes the problem. Can this info help?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Apr 22, 2009 4:42 pm
Reply with quote

I apologize,

apparently they must be statically CALLed.
the examples in the book are all static CALLs.
everything seems to depend on being a run-unit, the definition of which is:


Quote:
Each ILE COBOL compilation unit must be compiled and then bound into a single program object.


if others have had experiences contrary, please post.

I myself have never used external.
I always try to work in a dynamic environment.
I always use a separate dynamically CALLed module to perform the necessary i/o for each file.
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 -> ABENDS & Debugging

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts ISAM and abend S03B JCL & VSAM 9
Search our Forums:

Back to Top