John, Thanks a lot for your help. Howi Kok
-----Original Message----- <snip> I have had this happen as well, but I wasn't even using DB2 (but it may have been IMS batch). What the problem is, is that the DCB is "hard coded" in the assembler routine. When a DCB is OPENed, a DEB is created on the TCB DEB chain. This DEB points back to the DCB and the DCB points to the DEB (i.e. they point to each other). If you don't close the DCB yourself, at task termination, z/OS will attempt to do the CLOSE for you. It takes the DCB pointer from the DEB and checks that the the DEB pointer within the DCB still points to the DEB. If it does not, you get that abend and the message. What is happening is that on the first COBOL CALL, the COBOL run-time is doing a LOAD on the assembler program. When the COBOL run-unit finishes, the run-time does a DELETE on all LOADed modules. This releases the memory which was assigned to the assembler program. Most likely, this will result in a FREEMAIN of the page of memory containing the DCB. So, when task termination tries to access the memory, it either gets (and recovers from) an S0C4 or it gets "junk" (likely binary zeroes). In either case, the DCB is gone and you get the SC03 and the message. The assembler routine needs to be change to either (1) CLOSE all the DCBs or (2) create the DCB in an area outside itself using a GETMAIN (STORAGE OBTAIN), or (3) cheat like the dickens and do a LOAD on itself so that the load count is 2. But doing the last, the DELETE issued by the run-time will NOT result in the assembler program actually being deleted (just reduce its load count by 1). I do not know of any way to avoid this without modifying the assembler routine. Oh, wait, yes there is. Write another assembler subroutine. Have this subroutine do a LOAD on the original assembler routine. This will also increase the load count. -- John McKown Senior Systems Programmer UICI Insurance Center Information Technology ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.clearswift.com ********************************************************************** ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

