Generate Cross-Reference utility (rpsxref)
The Generate Cross-Reference utility generates a file that can be used by ReportWriter to access file relationships that are not explicitly defined in the repository. These relationships are based on name links between fields. Provided that corresponding data fields have the same name (or use the same template), this file can provide access to all potential relationships that exist within your repository. If a cross-reference file exists, you can add related files to a report even though a “relation” has not been explicitly defined.
You can also run this utility from the command line. See rpsxref command line syntax below. |
This utility generates a cross-reference file for the specified repository in its current state. If you add or modify fields, templates, or keys in the repository, you must regenerate the cross-reference file. |
1. | Select Utilities > Generate Cross-Reference. The default repository filenames displayed are determined by the logic discussed in Determining the repository files used. |
|
2. | Enter data in each field as instructed below. |
Repository main file
Enter or select the name of the repository main file to read.
Repository text file
Enter or select the name of the repository text file to read.
Cross-reference file
Enter or select the name of the file into which the cross-reference should be generated. The default cross-reference filename displayed is determined by the logic discussed in Determining the cross-reference file used, below. If you enter a different filename, you must set the RPSXFIL environment variable to access this file in ReportWriter.
3. | Exit the window to generate the file. |
When processing is complete, the name of the newly generated cross-reference file is displayed.
4. | To return to the Utilities menu, press Enter. |
Determining the cross-reference file used
Repository and ReportWriter search for the cross-reference file as follows:
- If the RPSXFIL environment variable is defined, the cross-reference filename is the value of RPSXFIL.
- If RPSXFIL is not defined, Repository and ReportWriter attempt to open the file as RPSDAT:rpsxref.ism.
- If RPSDAT:rpsxref.ism can’t be opened, Repository and ReportWriter attempt to open rpsxref.ism in the current directory.
How a cross-reference file is generated
Each field (and template) in the repository has a “name link” flag. This flag determines whether the field name itself or an alternate name link should be used to find matches. The alternate name link is the name of the field’s template or the name of the template’s parent if the name link flag is set.
Step 1: A name link is determined for each field in the repository. This name link could be the field name, its template’s name, its template’s parent’s name, and so forth, depending on how the name link flag is set. For more information, see the Do not name link for field templates or the Do not name link for fields.
Step 2: For each access key (in all structures), the name link is determined for the first segment of the key. If the first segment is the tag field, the name link for the second segment is used. (The tag must be defined as a Field type tag and must use the EQ [equal] connector.)
Step 3: The list of name links determined in step 1 is compared to every name link determined in step 2. Each match becomes a record in the cross-reference file (assuming they’re not in the same structure).
For information on how ReportWriter uses this file to access related data, see Determining the list of available secondary files based on name links.
rpsxref command line syntax
You can generate a cross-reference file by running rpsxref.dbr from the command line.
- On Windows and UNIX, use this syntax:
dbr rpsxref [-d main_file text_file] [-o output_file]
- On OpenVMS, define this symbol:
rpsxref:==$RPS:rpsxref.exe
and then use this syntax:
rpsxref [-d main_file text_file] [-o output_file]
Options
-d main_file text_file
(optional) Specify the names of the repository main and text files, overriding the defaults. The default repository filenames are determined by the logic discussed in Determining the repository files used. The main_file and text_file names can each have up to 255 characters.
-o output_file
Specify the name of the cross-reference file to create, overriding the default. The default cross-reference filename is determined by the logic discussed in Determining the cross-reference file used. The cross-reference filename can have up to 255 characters.
Examples
The command below generates the cross-reference file MYRPS:rpsxref.ism based on the repository files in MYRPS:rpsmain.ism and MYRPS:rpstext.ism.
dbr rpsxref -d MYRPS:rpsmain.ism MYRPS:rpstext.ism -o MYRPS:rpsxref.ism
Assuming that RPSMFIL, RPSTFIL, and RPSXFIL are not set, the following command generates the cross-reference file RPSDAT:rpsxref.ism based on the repository files RPSDAT:rpsmain.ism and RPSDAT:rpstext.ism.
dbr rpsxref