Loading a File

In this section:

How to:

Use the LOAD command to load the following types of files into memory for use within a FOCUS session:

Using memory-resident files decreases execution time because the files do not have to be read from the disk. Use the UNLOAD command to remove the files from memory.

The LOAD command loads unparsed Master Files into memory. To store parsed Master Files in memory, use the SET SAVEDMASTERS command described in Saving Master Files in Memory for Reuse.

Syntax: How to Load a File

LOAD filetype filename1... [filename2...]

where:

filetype

Specifies the type of file to be loaded (MASTER, FOCEXEC, FOCCOMP, MODIFY, or Access File). For a list of Access File Types, see Considerations for Loading a Master File, FOCUS Procedure, or Access File.

filename1...

Specifies one or more files to be loaded. Separate the file type and file name(s) with a space.

Example: Loading Multiple Files

The following command loads four FOCEXECs—CARTEST, FOCMAP1, FOCMAP2, and FOCMAP3—into memory:

>LOAD FOCEXEC CARTEST FOCMAP1 FOCMAP2 FOCMAP3

A subsequent reference to one of these files during the current FOCUS session will use the loaded, rather than the disk version.

Syntax: How to Unload a File

UNLOAD [*|filetype] [*| filename1... [filename2...] ]

where:

filetype

Specifies the type of file to be unloaded (MASTER, FOCEXEC, FOCCOMP, MODIFY, or Access File). For a list of Access File Types, see Considerations for Loading a Master File, FOCUS Procedure, or Access File.

To unload all files of all types, use an asterisk.

filename1...

Specifies one or more files to be unloaded. Separate the file type and file name(s) with a space. To unload all files of that file type, use an asterisk.

Example: Unloading Multiple Files

The following command unloads two memory-resident FOCEXECs— CARTEST and FOCMAP3:

>UNLOAD FOCEXEC CARTEST FOCMAP3

Any subsequent reference to one of these files will use the disk version.

Loading Master Files, FOCUS Procedures, and Access Files

Reference:

Loading Master Files, Access Files, and FOCEXECs into memory eliminates the I/Os required to read each time they are referenced. Whenever FOCUS requires a Master File, Access File, or executes a FOCEXEC, it first looks for a memory-resident MASTER, Access File, or FOCEXEC file. If FOCUS cannot find the file in memory, it then searches for a disk version in the normal way.

Reference: Considerations for Loading a Master File, FOCUS Procedure, or Access File

The following are considerations for loading a Master File, FOCUS procedure, and Access File:

  • If you load a Master File, Access File, or a FOCEXEC that has already been loaded into memory, the new copy replaces the old copy.
  • Do not load a Master File, Access File, or a FOCEXEC that you are developing because FOCUS will always use the memory-resident copy of the file (until you reload it), rather than the one you are developing. The copy that you are developing on TED or your system editor is the disk copy, not the memory-resident copy.
  • A loaded Master File, Access File, or FOCEXEC requires a maximum of 80 bytes of memory for each of its records plus a small amount of control information, rounded up to a multiple of 4200 bytes.
  • The following are the file types for the various Access Files:

Access File

File Type

ADABAS

FOCADBS

CA-DATACOM

FOCDTCM

DB2

FOCSQL

FOCUS

ACCESS

CA-IDMS

FOCIDMS

IDMS/SQL

FOCSQL

IMS/DB

ACCESS

Model 204

ACCESS

ORACLE

FOCSQL

TERADATA

FOCDBC

Loading a Compiled MODIFY Request

How to:

When you load a compiled MODIFY request, FOCUS loads the FOCCOMP file from disk into memory, then reads and parses the Master File and binds the description to the FOCCOMP file. You may then run the request by issuing the RUN command. The RUN command causes FOCUS to search for a memory-resident FOCCOMP file. If FOCUS cannot find the file, it searches for a disk version in the normal way.

Loading FOCCOMP files not only eliminates the I/Os required to read large FOCCOMP files and the associated Master Files, but also causes another, more subtle effect. When issuing the RUN command to execute a FOCCOMP file from disk, virtual storage must be paged in to accommodate it. If the FOCCOMP file is large, it may require many pages (and a large virtual storage area) in a very short time. If you load the FOCCOMP file first, the initial surge of paging occurs only once at LOAD time. After that, each execution of the loaded file requires a lower paging rate.

Syntax: How to Execute a Compiled Request

RUN request

where:

request

Is the name of the compiled request stored in memory.

Loading a MODIFY Request

The LOAD MODIFY command is similar to the COMPILE command (described in the Maintaining Databases manual) except that instead of writing the compiled output to a FOCCOMP file on disk, FOCUS writes the output into memory as a pre-loaded, compiled MODIFY. FOCUS then reads the Master File associated with the MODIFY command from disk and translates it into an internal table that is tightly bound with the compiled MODIFY. Thus the command

>LOAD MODIFY NEWTAX

has substantially the same effect as

>COMPILE NEWTAX
>LOAD FOCCOMP NEWTAX

except that the compiled code is never written to disk.

After you enter a LOAD MODIFY command, the resulting compiled MODIFY is indistinguishable from code loaded with LOAD FOCCOMP. Thus the UNLOAD MODIFY and ? LOAD MODIFY commands produce exactly the same results as the UNLOAD FOCCOMP and ? LOAD FOCCOMP commands. Note that the UNLOAD FOCCOMP and UNLOAD MODIFY commands unload the bound Master File as well.

When you issue the RUN command to invoke a MODIFY procedure, FOCUS looks for a memory-resident compiled procedure (created by a LOAD FOCCOMP or LOAD MODIFY command) of that name. If the procedure cannot be found, FOCUS then searches for a disk version of the FOCCOMP file in the normal way.

The benefits of the LOAD MODIFY command are that disk space is not used to store the FOCCOMP file, disk I/Os are reduced, the FOCEXEC cannot get out of step with the compiled version, and the paging rate is reduced as it is with FOCCOMP files.

Displaying Information About Loaded Files

How to:

The ? LOAD command displays the file type, file name, and resident size of currently loaded files.

Syntax: How to Display Information About Loaded Files

? LOAD [filetype]

where:

filetype

Specifies the type of file (MASTER, Access File, FOCEXEC, FOCCOMP, or MODIFY) on which information will be displayed. For a list of Access File Types, see Considerations for Loading a Master File, FOCUS Procedure, or Access File.

To display information on all memory-resident files, omit the file type.

Example: Displaying Information About Loaded Files

Issuing the command

? LOAD

produces information similar to the following:

FILES CURRENTLY LOADED
 
   CAR        MASTER   4200   BYTES
   EXPERSON   MASTER   4200   BYTES
   CARTEST    FOCEXEC  8400   BYTES

Information Builders