HP3000-L Archives

April 2010, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Roy Brown <[log in to unmask]>
Reply To:
Roy Brown <[log in to unmask]>
Date:
Wed, 21 Apr 2010 13:57:51 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (62 lines)
In message <[log in to unmask]>, Brian Donaldson 
<[log in to unmask]> writing at 02:51:27 in his/her local time opines:-
>Hi All:
>
>I have a little problem going on with two Cobol programs. I am sure I
>already know the answer but
>I will run it by everyone on the list in case there is a solution.
>
>Cobol program #1 (mainline) and Cobol program #2 (also a mainline)
>
>#1 program runs program #2 with the RUN command via the COMMAND  intrinsic.
>
>#1 FOPENS a file (pm file, fopens ok) and the file number returns a value
>of +0010
>
>#2 FOPEN's a different file and the returned file number is also a value of
> +0010
>
>Ouch. This isn't exactly what I had been hoping for. When control returns
>to program #1
>
>I "FCLOSE" the file opened by #1 -- the bad news is that the file opened by
> program #2 is being closed!
>
>
>Is there any way of "forcing" the file system to give me different file
>numbers so that the correct files
>
>are being closed?
>
>TIA,
>Brian Donaldson.

If program #1 launches program #2 with COMMAND, then it gets control 
back immediately, and the two run concurrently, if I don't miss my 
guess.

I take it program #1 has already opened its file +0010 before this?

So how do you know, unless you put a PAUSE in program #1, that program 
#2 has even had time to open its file +0010?

And what does program #2 think when it has its file +0010 whipped away 
from under it - can you add a test to gets its opinion?

And how about program #1 - if you CLOSE the file +0010 a second time, 
does it close the file you first though of, or do something else 
entirely?

So - when you close +0010 in program #1, is program #2 still running? If 
not, I'd expect that it has closed it file on termination.

But if program #2 *is* still running - then how do you know that program 
#1 is closing program ##2's file, and not its own?

-- 
Roy Brown        'Have nothing in your houses that you do not know to be
Kelmscott Ltd     useful, or believe to be beautiful'  William Morris

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2