I am trying to compile a service program with a named activation group, for efficiency I would like to leave my (usropn) files open and have the job close the files when the job ends
Unfortunately, the compiler requires me to have some process that will close down my files (even if it is never called)
Is there a way round this? Or are we trying to do something fundamentally flawed here?
I don't think it makes any difference in this situation, but we are compiling under V5R4 here
Pinned topic Named activation groups and keeping files open
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2011-11-02T17:34:42Z at 2011-11-02T17:34:42Z by SystemAdmin
JonParis 1200007C6K206 Posts
Re: Named activation groups and keeping files open2011-11-02T16:30:15ZThis is the accepted answer. This is the accepted answer.What message are you seeing? I don't recall ever having to code a close with usropn files.
Even if the compiler whines just put the close in subr that never gets called.
barbara_morris 120000DX5W472 Posts
Re: Named activation groups and keeping files open2011-11-02T16:31:58ZThis is the accepted answer. This is the accepted answer.
- barbara_morris 120000DX5W
scott_klement 2700007QFX265 Posts
Re: Named activation groups and keeping files open2011-11-02T16:55:51ZThis is the accepted answer. This is the accepted answer.As Barbara has pointed out, the message is just a severity 10 -- you can ignore it, and your code will work fine.
However, I usually find myself sticking a "CLOSE *ALL" somewhere in the program (usually somewhere that's called rarely, or not at all) to suppress these warning messages.
Also, please understand that you do not need to use USROPN to keep the files open. They'll stay open until the activation group ends, or until you end your main procedure with *INLR=*ON. (Or, obviously, until you close them with the CLOSE opcode.) The USROPN doesn't affect whether they stay open or not.
SystemAdmin 110000D4XK535 Posts
Re: Named activation groups and keeping files open2011-11-02T17:34:42ZThis is the accepted answer. This is the accepted answer.
- scott_klement 2700007QFX
PS I've only used usropn because I have A LOT of sub procedures (and files) and I don't want to open lots of files I don't actually need