Using Alternative File Specifications

How to:

Issue the USE command to specify an alternate file specification for a FOCUS data source if:

Note: A data source named by the LOCATION attribute in a Master File assumes default values unless you issue a USE command. If the physical file has a specification or location other than the default, it must be in the USE directory.


Top of page

x
Procedure: How to Use an Alternative File Specification With the Use Tool in Developer Studio
  1. In the User tool, do one of the following:
    • Type the name of a FOCUS data source in the Database Filename field.
    • Click Browse to search the network drives and directories for the desired file.
    • Type the Universal Naming Convention (UNC) name of the file in the Database Filename field. For example:
      \\Server1\Disk1\employee.foc

      The Universal Naming Convention (UNC) allows you to enter the server name without entering the explicit path to the server. However, in order to take advantage of the UNC you must first attach to the server. For information on attaching to a server or mapping network drives, consult your Network Administrator.

      Enter the Master File name to associate with the data source in the Master File field.

  2. If the data source is not located locally, enter the name of the server on which the file resides in the Database Server field.
  3. Click Add.
  4. Repeat steps 3 through 6 for any additional data sources you want to identify.
  5. Select a USE action:
    • Clear/Replace current list of USE databases clears all entries or replaces the current list of USE data sources with those in the list box.
    • Append to the present database list adds data sources to the current Use directory.
    • Replace only specified files in list changes one or more data source assignments in the current USE directory.
  6. Click Run.
  7. Click Close. You are prompted to save your changes.

Top of page

x
Syntax: How to Use an Alternative File Specification
USE 
fileid AS mastername END

where:

fileid

Is any valid file name for the specific operating system.

mastername

Is the name of the Master File associated with the file ID.



Example: Specifying a Different File Name

To read the EMP026 data source described by the Master File EMPLOYEE, issue the USE command, then you can read EMP026 with the command TABLE FILE EMPLOYEE.

Operating System

Use Command Example

Windows:

USE
EMP026.FOC AS EMPLOYEE
END

z/OS:

USE
EMP026 AS EMPLOYEE
END

UNIX:

USE
emp026.foc AS EMPLOYEE
END


Example: Specifying a Different File Type or Extension

Windows:

To read the EMP026 data source with an extension of .DAT, described by the Master File EMPLOYEE, issue the command:

USE
EMP026.DAT AS EMPLOYEE
END

z/OS:

To read the emp026 data source with an extension of .dat, described by the Master File EMPLOYEE, issue the command:

USE
EMP026 AS EMPLOYEE
END

UNIX:

To read the emp026 data source with an extension of .dat, described by the Master File EMPLOYEE, issue the command:

USE
emp026.dat AS EMPLOYEE
END

After issuing the USE command, you can read EMP026 with the command TABLE FILE EMPLOYEE.



Example: Specifying a Different File Location

Windows:

To read the EMP026 data source located in the C:\ACCOUNTING\ directory, described by the Master File EMPLOYEE, issue the command:

USE
C:\ACCOUNTING\EMP026.FOC AS EMPLOYEE
END

UNIX:

To read the emp026 data source located in the /accounting/ directory, described by the Master File EMPLOYEE, issue the command:

USE
/accounting/emp026.foc AS EMPLOYEE
END

WebFOCUS