Update for the archives: The problem seems to have been some very crude (and in hindsight incorrect) coding in the FILE SECTION. The original coding used a single fixed-length record definition for the variable-length input file and for each of the variable-length output files. Changing that coding to use record definitions with "OCCURS DEPENDING ON length-variable" and FD's using the COBOL clause "RECORD VARYING 1 TO max-length-constant DEPENDING ON length-variable" has solved the problem.
"Doctor! Doctor! It hurts when I do that!" "Well, don't do that!" Peter -----Original Message----- From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of Farley, Peter x23353 Sent: Tuesday, September 10, 2019 5:48 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: COBOL runtime routine abend S0C4 or IEC036I 002-08 message and abend 002 closing VB file never written to I am getting an error I don't ever remember seeing before. Environment is Enterprise COBOL V5.2 batch, z/OS V2.2. This is a pretty simple COBOL program that splits an input file into four parts: Header record, trailer record, records matching criteria 1, records matching criteria 2. If input records do not match any criteria they are dropped. All input and output files are RECFM=VB, all with the same value for LRECL and all use BLKSIZE=0 If NONE of the input records match any of the criteria (i.e., all input records are dropped) then the program abends S0C4 in COBOL / LE subroutine IGZ@Q24 when the "records matching criteria 1" file is CLOSEd. I am positive (via tracing) that the two record output files are successfully opened and are never written to. When I tried recompiling with the older COBOL V4.2 compiler that we still have on license and running the same JCL I get an IEC036I message instead IEC036I 002-08,IGC0005E,TSOUSERZ,STEP110,FILEOP,A536,XYZ123, 162 TSOUSER.PGMNAME.THIRDNM.LASTNM Shouldn't COBOL CLOSE simply write an EOF if a file is just OPENed and then CLOSEd with no WRITE ever being issued? Is this an issue reportable to IBM COBOL or LE Support? TIA for any advice or help you can offer. Peter -- This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN