USE Command

How to:

When you issue a FOCUS command to access a FOCUS data source, such as TABLE FILE filename, FOCUS searches for a Master File with the specified file name, and then searches for a data source allocated to the same ddname.

For example, the command TABLE FILE EMPLOYEE uses the data source allocated to ddname EMPLOYEE.

If the FOCUS data source has a file ID different from these defaults, you must issue the USE command to identify the data source, with its file specifications, and associate it with a specific Master File.

The USE command specifies the names and locations of FOCUS data sources for the following conditions:

When you identify FOCUS data sources with the USE command, a USE directory is created, which is a list of data source definitions. When a USE directory is in effect, FOCUS will locate data sources using the information in the directory, instead of searching for the data source using default names. A USE directory enables you to access up to 1022 data sources. The USE directory applies only to FOCUS data sources.


Top of page

x
Syntax: How to Issue a USE Command
USE action
fileid [READ|NEW] [AS mastername]  

or

fileid AS mastername ON server READ

or

fileid LOCAL

or

fileid ON server 
.
.
. 
ind {WITH|INDEX} mastername 
END

where:

action

Is one of the following:

ADD appends one or more new file IDs to the present directory. If you issue the USE command without the ADD parameter, the list of data sources you specify replaces the existing USE directory.

CLEAR erases the USE directory. The keyword END is not required with this option. Any other options specified will be ignored.

REPLACE replaces an existing file ID in the USE directory. This option enables you to change the file specification for the file ID and the options following the file ID.

fileid

Is a valid ddname allocated to the data set containing your FOCUS data source.

READ

Restricts data sources to read-only access.

NEW

Indicates that the data source has yet to be created.

AS mastername

Specifies the name of the Master File to be associated with the file ID.

ON server

Specifies the communications data set of the FOCUS Database Server.

LOCAL

This option requires a previous directory entry for the file ID with the ON server option.

This option accesses an SU data source using the Multi-Threaded SU Reporting Facility. Before using this option, you must allocate the SU data source in SHR mode.

ind

Is the ddname of an external index.

WITH|INDEX

Establishes the relationship between an external index and the component data source. INDEX is a synonym for WITH.

The following options after the file ID are valid together:

READ and AS
NEW and AS
AS and ON and READ

Any other combination of options after the file ID is not valid.


Top of page

x
Syntax: How to Specify Multiple Data Sources

You can specify several data sources in one USE command, each with different parameters. For example:

USE 
fileid1 ON MULTID 
fileid2 AS PRODUCTS 
fileid3 READ AS ACCOUNTS
END

Top of page

x
Syntax: How to Erase USE Specifications

To erase the USE specifications, enter the following command:

USE CLEAR

Information Builders