On Fri, Dec 1, 2017 at 3:42 PM, scott Ford <[email protected]> wrote:
> All: > > Sorry for the Cobol question but i have a question.. > I have s single thread STC calling a second Cobol program > that second program opens files ( sysprint - defined as sequential ) and > writes output. I need to close these files on termination of the STC. > We have built an API ...my thought is to pass a variable indicating to > close the files > and set a return-code and return back and have the STC check it.. > OK. Your COBOL program #1 is doing a COBOL dynamic CALL of this second program. The second program is doing an COBOL OPEN verb on an FD whose SELECT is for DD SYSPRINT,? Am I correct so far? The second program is not doing a COBOL CLOSE on the FD. When the second COBOL program does a GOBACK, it returns to the first program. When the first program terminates, the STC terminates. In this case, where some program does an OPEN but there is no corresponding CLOSE, z/OS itself will do a CLOSE on all still OPEN DDs when the __TCB__ under which some program did the OPEN terminates. This is because OPEN chains DEBs for all OPEN DDs on the TCB under which the OPEN was done. So if there are any DEBs left on this chain, task termination does a CLOSE on them. This is not good practice, but it generally works. VSAM data sets get an "abnormal close" set in the catalog for the DSN which causes an "automatic VERIFY" when the VSAM cluster is next OPEN'd. Or am I totally off base as to what you are asking? > > Am i thinking right ? > > -- > > *IDMWORKS * > > Scott Ford > > z/OS Dev. > -- I have a theory that it's impossible to prove anything, but I can't prove it. Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
