Saving Master Files in Memory for Reuse

How to:

Reference:

You can save up to 99 Master Files in memory after they have been used in a request. The saved Master Files are not re-parsed when referenced in subsequent requests, resulting in a significant performance improvement. The greatest improvement occurs in Master Files with a great many fields, where parsing is slowest.

Saving Master Files in memory is particularly helpful when running multiple requests against several Master Files. The most recently used Master File is stored in memory regardless of this setting. With each request that specifies a new Master File, the prior Master File is moved down on the saved list and the new Master File is placed at the top of the list. Once all of the slots on the list are full, parsing a new Master File causes the one at the bottom to drop off the list. If an already saved Master File is used in a request, it moves to the top of the list.

Only one occurrence of a Master File name is maintained on the list. Therefore, if you use an already saved Master File as the host file in a JOIN, in a HOLD command (with the same AS name), in a USE...AS command, or in a COMBINE command without specifying a unique name, the new version of the Master File replaces the previous version on the list. A JOIN CLEAR or USE CLEAR command purges the parsed Master File from memory.

If a Master File will be re-parsed multiple times, you can save the I/O needed to retrieve it from disk by loading it into memory using the LOAD command described in Loading a File.

Note: SAVEDMASTERS is not an effective technique to use with massive amounts of data because the amount of time saved by not re-parsing is small in comparison to the time for processing the data.


Top of page

x
Syntax: How to Save Parsed Master Files in Memory
SET SAVEDMASTERS = n

where:

n

Is an integer between 0 and 99 that specifies the maximum number of Master Files on the SAVEDMASTERS list. The default value is 0. Note that the most recently used Master File is always stored in memory, even with SAVEDMASTERS set to zero. However, the zero setting does not generate the list of saved Master Files.


Top of page

x
Syntax: How to Query the SAVEDMASTERS Setting

The following query command indicates the number of Master Files allowed on the list of saved Master Files and lists the names of the Master Files on the list.

? SET SAVEDMASTERS


Example: Saving and Querying Parsed Master Files

The following command specifies that up to three parsed Master Files can be saved:

SET SAVEDMASTERS = 3

Issue the Query command:

? SET SAVEDMASTERS

The output of the query command indicates that the list can contain up to three Master Files, but none are currently saved:

SAVEDMASTERS               3

The following procedure parses two Master Files, EMPLOYEE and MOVIES:

TABLE FILE EMPLOYEE
PRINT LAST_NAME FIRST_NAME BY EMP_ID
END
-RUN
TABLE FILE MOVIES
PRINT TITLE BY DIRECTOR
END
-RUN
? SET SAVEDMASTERS

In this example, the output of the query command indicates that the list can contain up to three Master Files and that the list currently consists of MOVIES and EMPLOYEE:

SAVEDMASTERS               3
 
  MOVIES
  EMPLOYEE

Top of page

x
Reference: Usage Notes for SET SAVEDMASTERS

Information Builders