View Full Version : Keeping a COBOL program and file resident in memory
05-02-2002, 04:53 AM
Check the SETOBJACC command. Terry
05-03-2002, 04:58 AM
Do not use the STOP RUN verb to end the program. Instead either use GOBACK or EXIT PROGRAM. This will keep the program resident. Dave
05-03-2002, 07:28 AM
Everyone has to get a fresh copy of working storage; how would this be handled on the 400? bobh
05-03-2002, 07:47 AM
Bob, you're correct. But there is some benefit ON A "LOCAL" level or just for the one user. About 4 or 5 yrs ago, I attended one of John Sears' seminars about COBOL/400 performance and design issues. Amongst so many minor details that can lead to better performance, if I remember correctly STOP RUN causes a full "flush" from memory of the WORKING STORAGE. The actual MI of the code can stay in memory for all CALLers to use so that a new copy is not fetched on each CALL. Without STOP RUN, variables in WORKING STORAGE that do not have a VALUE initializing the contents, can retain their contents on subsequent calls (and these programs can execute faster without the initialization instructions happenning on each CALL). But this is on each USERs own session. HTH Phil
05-03-2002, 07:53 AM
There are some downsides to SETOBJACC for files. The file may be larger than the actual memory available, leading to constant thrashing of parts in & out of memory if access of records is in different areas of the object that are currently in memory. The file may not even be loaded if it is larger than the available memory. I believe it is a copy of the file and UPDATES don't happen in REAL-TIME to the real object on disk. If the job for the SETOBJACC is not the only one running on the system, another job may cause the file to be taken in & out of memory as each session is attended to by the CPU. Your mileage may vary. HTH Phil
05-07-2002, 10:00 AM
Does anyone know how to keep a COBOL program resident in memory so that if it is called several times, it is not re loaded from disk? Also, is there a way of keeping a physical file resident in memory?
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.