Using Centrally Controlled Databases

How to:

Access Centrally Controlled Databases

Specify Additional USE Options for Centrally Controlled Databases

Example:

Accessing Both Centrally Controlled and Local Databases

The normal limitations of the USE command for SU apply. You cannot concatenate multiple files, rename files (using the AS option), or use the READ parameter for read only access.


Top of page

Syntax: How to Access Centrally Controlled Databases

To gain access to centrally controlled databases, specify the databases in an extended form of the FOCUS USE command:

USE
fileid1 ON sinkid
fileid2
ON sinkid
.
.
END

where:

fileid1, fileid2
Are the database file IDs: filename, filetype, and filemode. Database files under SU must have FOCUS as the filetype. The filemode is defined relative to the sink machine and is usually A.

sinkid
Is the user ID of the sink machine. The database must reside on a disk to which the sink machine has write access.

In the USE command, you must specify all of the databases you will use under SU, but you can also specify locally controlled databases.


Top of page

Example: Accessing Both Centrally Controlled and Local Databases

The following USE command accesses the CAR database residing on the A disk of the sink machine MULTID, the EMPLOYEE file residing on the A disk of the sink machine SUID, and the PRODUCT file residing on the source machine's J disk:

USE
CAR FOCUS A ON MULTID
EMPLOYEE FOCUS A ON SUID
PRODUCT FOCUS J
END

Notice that several sink machines can be active at the same time.


Top of page

Syntax: How to Specify Additional USE Options for Centrally Controlled Databases

ON may be used with AS in the USE command, if the keyword READ is included. The syntax is:

USE action
fileid
[READ|NEW] [AS mastername]

or

fileid AS mastername ON server READ

or

fileid LOCAL

or

fileid ON server 
.
.
.
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 the filename, filetype, and filemode of a FOCUS database.

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 user ID of the sink machine.

LOCAL
This option requires a previous directory entry for the file ID with the ON server option. For CMS, accesses an SU data source directly through the operating system. Before using this option, you must link and access the minidisk on which the SU data source resides in read-only mode.

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.

Unless you are using multi-threaded processing, you do not have to link to the disk containing the centrally controlled databases (CMS LINK and ACCESS commands) to access the FOCUS files. However, both the sink and the source machines must be able to read identical Master Files. If the descriptions are on the source machine user ID, the sink machine user ID should link and gain access to the disk containing the Master Files before the sink machine is started. Alternatively, both the sink and all source machines can link to a separate disk containing the Master Files.

For example, suppose the sink machine is reading Master Files on user ID MULTID. Then the source machine should gain read access to user ID MULTID to read the same descriptions as the sink machine. For example:

CP LINK MULTID 191 200 RR
ACCESS 200 D

At this point, the source and the sink machine are reading the same Master Files.

You can also use the LOCAL keyword to access sink databases directly through the operating system for reporting. Before issuing the USE command, link and access the minidisk containing the database in read-only mode. The USE command must specify the sink database with the ON option, as shown in the following example, followed by a second entry for the database using the LOCAL option. The filemode for the LOCAL option is the mode in which you accessed the disk:

CMS CP LINK MULTID 191 391 RR
CMS ACCESS 391 B
USE
EMPLOYEE FOCUS A ON MULTID
EMPLOYEE FOCUS B LOCAL
END

Information Builders