View previous topic :: View next topic
|
Author |
Message |
vasif
New User
Joined: 11 Feb 2008 Posts: 35 Location: Chennai
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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 |
|
|
rsnram007
New User
Joined: 28 Jan 2009 Posts: 11 Location: chennai
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
vasif
New User
Joined: 11 Feb 2008 Posts: 35 Location: Chennai
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Dynamic/Static should not be the problem
unless your usage of the EXTERNAL keyword 'locked' you into such a situation.
- 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
- the logic (summarized) from both programs for I/O on the file
- 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 |
|
|
vasif
New User
Joined: 11 Feb 2008 Posts: 35 Location: Chennai
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
|