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
This topic has been locked.
5 replies Latest Post - 2011-11-02T17:34:42Z by SystemAdmin
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 1200007C6K90 PostsACCEPTED ANSWER
Re: Named activation groups and keeping files open2011-11-02T16:30:15Z in response to SystemAdminWhat 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 120000DX5W337 Posts
scott_klement 2700007QFX215 PostsACCEPTED ANSWER
Re: Named activation groups and keeping files open2011-11-02T16:55:51Z in response to SystemAdminAs 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 PostsACCEPTED ANSWER
Re: Named activation groups and keeping files open2011-11-02T17:34:42Z in response to scott_klementThanks guys and gals - your right it is only a level 10 which is good
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