View previous topic :: View next topic |
Author |
Message |
Anand_R Intermediate
Joined: 24 Dec 2002 Posts: 189 Topics: 60
|
Posted: Mon May 19, 2003 10:04 am Post subject: Cobol write problem.. |
|
|
Hi,
I have two programs , program1 & program2.
Program1 calls program2 . I have one output file , which is common to both the programs (I mean new records would be added from the both the programs). I have defined FILE description in both the programs, and I opened that file in program1.
My problem is when I was trying to write new record into output file from program2 , It is getting abended. Could someone tell me why it is happening?
Please let me know if I am not clear.
Thanks
Anand |
|
Back to top |
|
|
Glenn Beginner
Joined: 23 Mar 2003 Posts: 56 Topics: 3
|
Posted: Mon May 19, 2003 11:01 am Post subject: |
|
|
What is this abend? That might be a good start. |
|
Back to top |
|
|
Anand_R Intermediate
Joined: 24 Dec 2002 Posts: 189 Topics: 60
|
Posted: Mon May 19, 2003 11:14 am Post subject: |
|
|
Glenn,
Abend is S0C4 reason code 4
Thanks |
|
Back to top |
|
|
Glenn Beginner
Joined: 23 Mar 2003 Posts: 56 Topics: 3
|
Posted: Mon May 19, 2003 11:22 am Post subject: |
|
|
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/iea1h741/2.176?SHELF=&DT=20001023091127
Quote: |
0C4
One of the following exceptions occurred:
4
Protection exception. The key of the storage area that the running program tries to access is different from that of the running program. The key of the running program can be obtained from the PSW key field. The key of the storage can be obtained using the IPCS LIST subcommand. The programmer should determine whether the program is running with the correct key or whether the storage address is set up correctly.
The protection exception might have occurred when the program referenced a page that is protected with the PGSER PROTECT service, or is defined as shared by the IARVSERV service with a view of read-only.
|
It's likely you're doing something with your output file in each of the programs that is clashing with the other - like perhaps the duplicate FD definitions or other things.
You might start looking at your code to determine WHERE this abend is occurring in your coding. |
|
Back to top |
|
|
Anand_R Intermediate
Joined: 24 Dec 2002 Posts: 189 Topics: 60
|
Posted: Mon May 19, 2003 12:42 pm Post subject: |
|
|
Glenn,
I have only one output file in both calling & called program. Here is the file description that I had coded in both the programs.
FD OUPUT-FILE
BLOCK CONTAINS 0 RECORDS
RECORDING MODE IS F
LABEL RECORDS ARE STANDARD
DATA RECORD IS OUTPUT-REC.
01 OUTPUT-REC PIC X(60).
The abend had occured while writing into the output file.
WRITE OUTPUT-REC.
Thanks
Anand |
|
Back to top |
|
|
Glenn Beginner
Joined: 23 Mar 2003 Posts: 56 Topics: 3
|
Posted: Mon May 19, 2003 1:06 pm Post subject: |
|
|
OK so let me see if I have the situation correct? First program issues OUTPUT open and will write records. First program calls second program which will ALSO write records. Upon return from second program, first program may write more records or close the file? Is this the general scenario? And which program abends with the WRITE? |
|
Back to top |
|
|
Anand_R Intermediate
Joined: 24 Dec 2002 Posts: 189 Topics: 60
|
Posted: Mon May 19, 2003 1:25 pm Post subject: |
|
|
Glenn,
While writing record in the second program(Called), the JOB getting abended. Moreover, it is not returning to the first program . Becuase Job got abended in second program itself with s0c4, while writing the record.
thanks
Anand |
|
Back to top |
|
|
Glenn Beginner
Joined: 23 Mar 2003 Posts: 56 Topics: 3
|
|
Back to top |
|
|
Anand_R Intermediate
Joined: 24 Dec 2002 Posts: 189 Topics: 60
|
Posted: Mon May 19, 2003 2:25 pm Post subject: |
|
|
Glenn,
It did work "External".. Thanks a lot.. |
|
Back to top |
|
|
|
|