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
 

 

S0C6 Abend in Batch Cobol pgm

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging
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    Post subject: S0C6 Abend in Batch Cobol pgm
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

Senior Member


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

PostPosted: Mon Mar 09, 2009 4:02 pm    Post subject:
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    Post subject: The S0C6 ABEND may occur one of the following reason
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

Site Director


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

PostPosted: Tue Mar 10, 2009 9:32 am    Post subject:
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    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Sun Apr 19, 2009 5:46 pm    Post subject:
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    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Wed Apr 22, 2009 4:42 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts C03 ABEND sjiraga PL/I & Assembler 1 Thu Jun 01, 2017 4:51 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am


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