|
Is FOP active on the stack when the called program ends? In other words, do you call FOP with a program name, then it opens the files, then calls the top-level program? Does the problem occur when a program somewhere in the stack ends with LR on thus closing some of the files? Is FOP still active on the stack? Did FOP actually open the files itself or did it call a little program to do it? Richard Jackson mailto:richardjackson@richardjackson.net http://www.richardjacksonltd.com Voice: 1 (303) 808-8058 Fax: 1 (303) 663-4325 -|-----Original Message----- -|From: owner-rpg400-l@midrange.com [mailto:owner-rpg400-l@midrange.com]On -|Behalf Of Len Lester -|Sent: Tuesday, October 17, 2000 11:43 AM -|To: RPG400-L@midrange.com -|Subject: closing shared files -| -| -|I'm having a problem with shared open data paths... -| -|The company standard is SHARE(*YES) on all files. Most programs do not -|SETON *INLR when ending. There is a file opener program (FOP) by which -|programs are called. The program to be run is a parameter to the FOP. -| -|There is a database of programs and files which contains the -|files used by a -|program and the programs called by a program. Each file and -|program has a -|number between 1 and 9999. The FOP contains two size 9999 by 1 -|byte arrays -|for programs and files. When a file or program is opened, it's -|byte is set -|to 'X' in the array so a second open is not attempted. -| -|When the FOP is called it will open all files for the program and any -|programs called by the program and so on and then call the program. The -|files are all opened for *ALL (IOUD) by the opener. So if program A uses -|file F as input only and then calls program B to update file F, -|the file is -|open for update and program B will work. -| -|Most programs can call an inquiry. Files used by the inquiries are not -|opened by the FOP before it calls the program. However, the inquiry -|programs are called using the FOP. So, in program B above, if the -|user wants -|his inquiry program C, the files it uses are opened for *ALL by the FOP. -|The user may return to the menu and select an option to update one of the -|files the inquiry program used. That file will already be open -|for *ALL so -|the update can take place. -| -|THE PROBLEM is with a program which sets on LR. When this -|program ends, any -|files opened by the inquiry process are closed. The tables in -|the FOP are -|not changed so it doesn't attempt to open these files again. If -|these files -|are opened, they are opened by the application programs and may be input -|only. If an update is later attempted, it will bomb. -| -|MY QUESTIONS are: -|A. Is this new? Program FOP opens files and calls program A -|which calls -|program B which calls FOP which opens more files and calls -|program C. Then -|these program end. Program A ends with LR *ON. The files opened by the -|second invocation of FOP or by program C are closed. I don't -|think it used -|to be this way. -| -|B. Is there a way to keep those files open? -| -| -| -|_________________________________________________________________________ -|Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -| -|Share information about yourself, create your own public profile at -|http://profiles.msn.com. -| -|+--- -|| This is the RPG/400 Mailing List! -|| To submit a new message, send your mail to RPG400-L@midrange.com. -|| To subscribe to this list send email to RPG400-L-SUB@midrange.com. -|| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. -|| Questions should be directed to the list owner/operator: -|david@midrange.com -|+--- +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.