Cliff Scott wrote:
>
> In the old days of Image, we used list processing. We would do a DBGET
> at the begining of the program for each set and then use the previous
> list for later DBGETS.
> I was told the other day not to do that because with the large amount of
> memory the 3K has, that I am just wasting CPU time.
> What is the proper way to handle this?
For what it's worth, from our old days (Series II) of optimizing Image
access, we used full-record reads combined with "previous list" and just
did bulk recompiles when items were added (all record definitions in a
COBOL copylib). We ended up with a couple of macros:
6 $DEFINE %SRSETINFO =
6.1 MOVE "!1" TO DB--INFO-ITEM,
6.2 PERFORM SR-DATASET-INITIALIZE,
6.3 MOVE DB--INFO-NUMBER TO SR-!1-SET#
6.4 $DEFINE %SRKEYINFO =
6.5 MOVE "!1" TO DB--INFO-ITEM,
6.6 PERFORM SR-ITEM-INITIALIZE,
6.7 MOVE DB--INFO-NUMBER TO !2#
Which in turn invoked the following COPY book specific to the database,
placed somewhere in the initialization section of the code:
001000**************************************************************
001100***** ROUTINES TO INITIALIZE SR DATA SETS AND ITEMS *****
001200**************************************************************
001300*
001400 SR-DATASET-INITIALIZE.
001500 CALL "DBINFO" USING DB--STUDENT, DB--INFO-ITEM,
001600 MODE--201, STATUS-WORDS,
001700 DB--INFO-NUMBER.
001800 IF DB--INFO-NUMBER < +0 THEN
001900 SUBTRACT DB--INFO-NUMBER FROM +0
002000 GIVING DB--INFO-NUMBER.
002100 CALL "DBGET" USING DB--STUDENT, DB--INFO-NUMBER, MODE--4,
002200 STATUS-WORDS, ITEM--LIST,
002300 BUFFER, DUMMY.
002400*
002500 SR-ITEM-INITIALIZE.
002600 CALL "DBINFO" USING DB--STUDENT, DB--INFO-ITEM,
002700 MODE--101, STATUS-WORDS,
002800 DB--INFO-NUMBER.
002900 IF DB--INFO-NUMBER < +0 THEN
003000 SUBTRACT DB--INFO-NUMBER FROM +0
003100 GIVING DB--INFO-NUMBER.
003200*
These routines are used to initialize all sets we use (replaces set name
with set number, does dummy directed DBGET to record zero, then replaces
item list with "*;") to get over the overhead of opening the set (they
aren't actually opened until they're referenced), the item list, and the
set number. The item initialization is used to get item numbers from
names, such as for DBFINDs and the like.
This may be ridiculous in these days of gigabyte RAMs and 12-way CPUs,
but it was measurably different in the Series II days (though granted we
didn't have the luxury of COBOL macros yet at that time, we PERFORMed
instead).
Jeff Kell <[log in to unmask]>
|