Concatenating Data Sources

How to:

If several FOCUS data sources are described by the same Master File, you can read all of them in one request by issuing a USE command that concatenates them.

You can also concatenate multiple files that cross-reference a common file. This is done by specifying the host files in the USE command, then specifying the cross-reference file.

Note: You cannot specify a concatenated file as a cross-reference file in a JOIN command.


Top of page

x
Procedure: How to Concatenate Data Sources 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 box.
    • Click Browse to search the network drives and directories for the file you want to add.
    • Type the Universal Naming Convention (UNC) name of the file in the Database Filename box. 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.

  2. Enter the Master File name to be associated with the data source in the Master File field. When concatenating data sources, use the same Master File name for each data source.
  3. If the data source is not located locally, enter the name of the server on which the file resides in the Database Server box.
  4. Click Add.
  5. Repeat steps 3 through 6 for any additional data sources you want to identify.
  6. 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.
  7. Click Run.
  8. Click Close. You are prompted to save your changes.

Top of page

x
Syntax: How to Concatenate Data Sources
USE 
fileid-1 AS mastername
fileid-2 AS mastername 
.
. 
fileid-n AS mastername 
END

where:

fileid-1...fileid-n

Are any valid file specifications for the files being concatenated.

mastername

Is the name of the Master File that describes the data sources.



Example: Concatenating Data Sources

The following command concatenates the FOCUS data sources EMP024, EMP025, and EMP026, all described by the Master File EMPLOYEE. You can then read all three data sources with a single TABLE FILE EMPLOYEE command.

Windows:

USE
C:\DATA\EMP024.FOC AS EMPLOYEE
C:\DATA\EMP025.FOC AS EMPLOYEE
C:\DATA\EMP026.FOC AS EMPLOYEE
END

z/OS:

USE
EMP024 AS EMPLOYEE
EMP025 AS EMPLOYEE
EMP026 AS EMPLOYEE
END

UNIX:

USE
/usr/mydata/emp024.foc AS EMPLOYEE
/usr/mydata/emp025.foc AS EMPLOYEE
/usr/mydata/emp026.foc AS EMPLOYEE
END


Example: Specifying Multiple Concatenations

The following command concatenates the EMP01 and EMP02 data sources described by the Master File EMPLOYEE, and concatenates the SALES01 and SALES02 data sources, described by the Master File SALES.

Windows:

USE
EMP01.FOC AS EMPLOYEE
EMP02.FOC AS EMPLOYEE
SALES01.FOC AS SALES
SALES02.FOC AS SALES
END

z/OS:

USE
EMP01 AS EMPLOYEE
EMP02 AS EMPLOYEE
SALES01 AS SALES
SALES02 AS SALES
END

UNIX:

USE
emp01.foc AS EMPLOYEE
emp02.foc AS EMPLOYEE
sales01.foc AS SALES
sales02.foc AS SALES
END

You can read the EMP01 and EMP02 data sources with the TABLE FILE EMPLOYEE command. You can read the SALES01 and SALES02 data sources with the TABLE FILE SALES command.


Top of page

x
Syntax: How to Concatenate Data Sources and a Single Cross-Reference File
USE 
fileid-1 AS mastername
fileid-2 AS mastername 
.
. 
fileid-n AS mastername
reffileEND

where:

fileid-1...fileid-n

Are any valid file specifications for the files being concatenated.

mastername

Is the name of the Master File that describes the data sources.

reffile

Is the cross-reference file for the files being concatenated.



Example: Concatenating Data Sources and a Single Cross-Reference File

EMPLOYEE is made up of the two files EMP01 and EMP02, both of which cross-reference the common file EDUCFILE. To read the files together, issue the USE command.

Windows:

USE
EMP01.FOC AS EMPLOYEE
EMP02.FOC AS EMPLOYEE
EDUCFILE.FOC
END

z/OS:

USE
EMP01 AS EMPLOYEE
EMP02 AS EMPLOYEE
EDUCFILE
END

UNIX:

USE
/usr/mydata/emp01.foc AS EMPLOYEE
/usr/mydata/emp02.foc AS EMPLOYEE
/usr/mydata/educfile.foc
END


Example: Concatenating Data Sources and Multiple Cross-Reference Files

If EMPLOYEE consists of two files, EMP01 and EMP02, and each has its own cross-reference file, ED01 and ED02, you can read all four files in one command. Issue the USE command in which each host file is followed by its cross-reference file.

Windows:

USE
EMP01.FOC AS EMPLOYEE
ED01.FOC AS EDUCFILE
EMP02.FOC AS EMPLOYEE
ED02.FOC AS EDUCFILE
END

z/OS:

USE
EMP01 AS EMPLOYEE
ED01  AS EDUCFILE
EMP02 AS EMPLOYEE
ED02  AS EDUCFILE
END

UNIX:

USE
/usr/mydata/emp01.foc AS EMPLOYEE
/usr/mydata/ed01.foc AS EDUCFILE
/usr/mydata/emp02.foc AS EMPLOYEE
/usr/mydata/ed02.foc AS EDUCFILE
END

WebFOCUS