Here is a simple but effect way to handle this scenario:

COMMON /NAMED_COM/ NAMED_COM.REC(10)
EQUATE NAMED_COM.FLAG TO NAMED_COM.REC(1)
EQUATE F.OPEN.FILE    TO NAMED_COM.REC(2)
Etc.

IF NAMED_COM.FLAG NE @WHO:@DATE THEN
   ;* Open Files, Set Variables and NAMED_COM.FLAG if everything is OK.
   GOSUB INIT.NAMED.COM
END

---

If you are concerned about closing files or deleting a temp file or record
then you can call your subroutine with a "Final" call via a Call Type
argument.  Normally this Call Type would be "I" for Initializing, "N" for
Normal, "F" for Final.

Thanks,
David A. Green
www.dagconsulting.com
(480) 813-1725


-----Original Message-----
I have a subroutine that WRITESEQ to a record in a type 1 file called
INTEGRITY. 

Is there anyway I can open the file once (in the subroutine) and thereafter
use the same file handle (to avoid opening the file each time the subroutine
is called) ?
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to