Re: Help on SC03 abend
On Jun 25, 2005, at 8:03 AM, Stephen McColley wrote: It wasn't 10 years ago, it was more like 15 or 20, I remember doing a system upgrade almost 20 years ago now, pre-xa anyway when we got clobbered with a new set of abends that all turned out to be programs not closing the dcb's before ending. I am sure the restriction has been loosened since then... Stephen McColley Stephan... I vaguely remember it starting in 3.8 and that was 20++ years ago. Ed -- 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
Re: CLOSING of files OPEN at program exit. Re: Help on SC03 abend
In [EMAIL PROTECTED], on 06/23/2005 at 11:04 AM, Rolf Ernst [EMAIL PROTECTED] said: the question is to which lengths COBOL goes to determine which files were opened. No, the question is to what lengths a program should go in an attempt to work around a broken subroutine; the issue would be the same if the caller were written in another language. Since you indicated the files were opened (and not closed) by a BAL subroutine, No he didn't. the COBOL code may not even be aware of it. Nor should it be. It does take a bit of poking around to find the DECBs anyhow. He doesn't need the (nonexistent for QSAm and VSAM) DECB's; he needs the ACB's and DCB's, which are presumably already gone. However, since you indicate that you are dealing with VSAM files - are the ACBs that the subroutine used around at all? I doubt that he would have gotten the C03 if they were. -- Shmuel (Seymour J.) Metz, SysProg and JOAT ISO position; see http://patriot.net/~shmuel/resume/brief.html We don't care. We don't have to care, we're Congress. (S877: The Shut up and Eat Your spam act of 2003) -- 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
Re: Help on SC03 abend
In !~!UENERkVCMDkAAQACABgA9al6NfmUnEOS37fVfUZGYeKQ8Op/[EMAIL PROTECTED], on 06/22/2005 at 03:55 PM, Lizette Koehler [EMAIL PROTECTED] said: If my old addled brain is thinking correctly, I believe over 10 years ago IBM decided to no longer be nice to programs and require that all programs close any files they open. IBM has always required that programs close any files they open prior to freeing the DCB. They are nice in that they attempt to clean up after programs that break the rules. There was a change decades ago to maintain a copy of the DCB. And if they did not close them, the system would then issue a SC03 abend. My recollection is that EXIT only gives a C03 if the CLOSE attempt fails. Or am I getting too forgetful??? Partially. -- Shmuel (Seymour J.) Metz, SysProg and JOAT ISO position; see http://patriot.net/~shmuel/resume/brief.html We don't care. We don't have to care, we're Congress. (S877: The Shut up and Eat Your spam act of 2003) -- 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
CLOSING of files OPEN at program exit. Re: Help on SC03 abend
On 22 Jun 2005 15:56:11 -0700, in bit.listserv.ibm-main you wrote: If my old addled brain is thinking correctly, I believe over 10 years ago IBM decided to no longer be nice to programs and require that all programs close any files they open. And if they did not close them, the system would then issue a SC03 abend. Probably true for Assembler. The 85 COBOL standard requires COBOL to clean up after itself and close all OPEN files on a STOP RUN. By implication GOBACK from a main program probably also does the same thing but I don't have a compiler and system to test it. Still it is bad practice not to close all files. Of course I am wondering what the need for an assembler routine is in the case that prompted the original posting. Or am I getting too forgetful??? Lizette Koehler -- 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
Re: CLOSING of files OPEN at program exit. Re: Help on SC03 abend
... Since you indicated the files were opened (and not closed) by a BAL subroutine, the COBOL code may not even be aware of it. ... My Mother used to say: You use it; you clean it. Put it back where you got it from. Always wear clean underwear, in case you get hit by a bus. The point is: A programme, sub-routine, etc. that opens a file should (must) close it. You can't leave artifacts around for callers to trip over. (At least, that's what I was taught at the UoW in the 1970's) -teD (The secret to success is sincerity. If you can fake that, you've got it made!) -- 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
Re: CLOSING of files OPEN at program exit. Re: Help on SC03 abend
The origional statement was that a different program calling the subroutine didn't have the abend. If the different program was also ASM and didn't clean up modules loaded or was linked as a static call, then the storage would still be available for the system to close the ACB. sort of an example of how 2 wrongs can run correctly. Mike On 6/22/05, Ted MacNEIL [EMAIL PROTECTED] wrote: ... Since you indicated the files were opened (and not closed) by a BAL subroutine, the COBOL code may not even be aware of it. ... My Mother used to say: You use it; you clean it. Put it back where you got it from. Always wear clean underwear, in case you get hit by a bus. The point is: A programme, sub-routine, etc. that opens a file should (must) close it. You can't leave artifacts around for callers to trip over. (At least, that's what I was taught at the UoW in the 1970's) -teD (The secret to success is sincerity. If you can fake that, you've got it made!) -- 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 -- Mike -- 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
Re: CLOSING of files OPEN at program exit. Re: Help on SC03 abend
On 23 Jun 2005 09:04:13 -0700, in bit.listserv.ibm-main you wrote: Clark, the question is to which lengths COBOL goes to determine which files were opened. Since you indicated the files were opened (and not closed) by a BAL subroutine, the COBOL code may not even be aware of it. It does take a bit of poking around to find the DECBs anyhow. However, since you indicate that you are dealing with VSAM files - are the ACBs that the subroutine used around at all? Has this storage not been freed? As long as you have no activity you would not find out until it's closing time, whether COBOL intends to clean up or someone else. Obviously, I have been less than clear. I was referring to the requirements for COBOL to CLOSE any files OPENed by a COBOL program. This would not apply to the files in the original posting by someone else since the problem was occurring with an Assembler subroutine. It becomes very murky when we are dealing with a DB2 COBOL program since it is running under the batch TMP and probably a DB2 service. The 85 COBOL standard recognizes only STOP RUN and EXIT PROGRAM so the issue of GOBACK confuses the issue further. The 2002 standard recognizes GOBACK so I would assume that the requirement for termination of the RUN unit to close the files would still apply. I also suspect but haven't researched the whether a COBOL calling program issuing a CANCEL for a CALLed program must implicitly cause the CLOSING of any files OPENed by the CALLed program. CANCEL in COBOL terms mean to DELETE the program from the calling stack and free the memory and does not imply ABEND. Clark Morris wrote: On 22 Jun 2005 15:56:11 -0700, in bit.listserv.ibm-main you wrote: If my old addled brain is thinking correctly, I believe over 10 years ago IBM decided to no longer be nice to programs and require that all programs close any files they open. And if they did not close them, the system would then issue a SC03 abend. Probably true for Assembler. The 85 COBOL standard requires COBOL to clean up after itself and close all OPEN files on a STOP RUN. By implication GOBACK from a main program probably also does the same thing but I don't have a compiler and system to test it. Still it is bad practice not to close all files. Of course I am wondering what the need for an assembler routine is in the case that prompted the original posting. snip -- 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
Re: Help on SC03 abend
In [EMAIL PROTECTED], on 06/22/2005 at 12:11 PM, Kok, Howi [EMAIL PROTECTED] said: I'm not sure if I should post this in this list. Yes; it's the most appropriate list for your question. I'm not sure if I should post this in this list. Anyway, I hope some of you can help me out. We have a batch DB2 COBOL program PGMA that calls an assembler program PGMB to open, read, and close four VSAM files. I don't know why PGMB closes only two of the files. PGMB is broken. Instead of trying to live with the bug, why not try to get it fixed? Upon PGMA termination we would get SC03 abends with messages IEC999I IFG0TC0A,IFG0TC0B,jobname,stepname,DEB ADDR = debaddr,DSN = VSAM data set name for the two closed files. ITYM for the two files that are not closed. According to the programmer there is no problem when the PGMB is called from a non-DB2 COBOL program. He's mistaken. What should be done differently when the assembler program is called from a DB2 COBOL program? Nothing in this case. Should we not close any files and let the system detect the DEBs and close them? No, PGMB should close all files that it opens. If the programmer refuses to do so, discuss it with your and his management. -- Shmuel (Seymour J.) Metz, SysProg and JOAT ISO position; see http://patriot.net/~shmuel/resume/brief.html We don't care. We don't have to care, we're Congress. (S877: The Shut up and Eat Your spam act of 2003) -- 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
Re: Help on SC03 abend
If my old addled brain is thinking correctly, I believe over 10 years ago IBM decided to no longer be nice to programs and require that all programs close any files they open. And if they did not close them, the system would then issue a SC03 abend. Or am I getting too forgetful??? Lizette Koehler -- 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
Re: Help on SC03 abend
Generally you can get away with not closing DCBs and the system will close them. The problem occurs when the DCB is either in GETMAINed storage, or in a secondary load module brought in by the jobstep program with a LOAD (which is pretty much the same thing) - AND the storage gets freed before end of jobstep. MVS goes to close the DCB and - ta-da! - it's not there. SC03 will also happen if a DCB gets overlaid or clobbered in some way before the system can close it. I think that a job's behavior in this regard can be a little unpredictable because things may depend on whether the storage gets reused or not. That's probably why he is seeing different results depending on whether or not DB2 is in the picture. It's not DB2 per se, but the fact that DB2 coincidentally changes the storage allocation picture in some way. He might get different results, for example, with a different region size. Shmuel is 100% correct though - it's like your mom said: if you open the DCB, you close it. Charles -Original Message- From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf Of Lizette Koehler Sent: Wednesday, June 22, 2005 3:55 PM To: IBM-MAIN@BAMA.UA.EDU Subject: Re: Help on SC03 abend If my old addled brain is thinking correctly, I believe over 10 years ago IBM decided to no longer be nice to programs and require that all programs close any files they open. And if they did not close them, the system would then issue a SC03 abend. Or am I getting too forgetful??? -- 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