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.

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.

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