DB_JUNKEY

COMMAND TYPE : JUNCTION

PURPOSE:

Merges the fields of two catalogues with same identification key.

DESCRIPTION:

With this command the user can merge the fields of two catalogues when the same identification key ( e.g., HD name, 3C name ) is present in both of them. The user can create a 'merged' catalogue with each record containing some fields taken from the first catalogue and other fields taken from the second one. In this way, by successive iterations, one can 'upgrade' each object of his catalogue with values coming from other catalogues. At least the original catalogue must be in the Personal Data Base, while the target catalogue can be either a public or a private catalogue.

When the catalogues are not already sorted on the identification key, a sort is executed and temporary files are written in the user disk space. In the junction of big catalogues the user must verify to have available disk space, or he can reduce the amount of data by a selection command, and work on the PDB selected data set. Sorting (with DB_SORT command) the original catalogue is a way to speed up the work when the user needs to made junctions between one catalogue and many target catalogues.

INPUT FIELDS of the command:

From: PDB Catalogue 1

The name of the first input catalogue used for merge. This must be in the Personal Data Base.

Example : CATAL1

Key 1

The user must enter the name of the field of the first catalogue which is the comparison key in the junction.

Example : MCG

From: PDB ?

The user must enter Y when the second catalogue is in the Personal Data Base.

Example : Y

Catalogue 2

The name of the second input catalogue used as target in the junction.

Example : CATAL2

Key 2

The user must enter the name of the field in the second catalogue which is the comparison key for the junction with the first catalogue.

Example : MCG

Select: Cat.1

The user must enter the name of the fields coming from the first catalogue that will be written in the output file. The junction key is always written. The field names must be divided by space or by comma. The following special keywords can be used:

%ALL Returns all the fields of the first catalogue

%REC Adds the record number of the first catalogue

Example : RA DEC MAG %REC

The CTRL-L key provides more rows to write field names.

Cat.2

The user must enter the name of the fields coming from the second catalogue that will be written in the output file. The junction key is always written. The field names must be divided by space or by comma. The following special keywords can be used:

%ALL Return all the fields of the second catalogue

%REC Add the record number of the second catalogue

Example : RA DEC MAG %REC

The CTRL-L key provides more rows to write field names.

Junction type ?

In the junction of two catalogues there are objects present in both catalogues (that have the same key), objects that are present in a catalogue only without counterparts on the other one. The user can have in the output file, by entering the appropriate junction type, only the objects that are present in both catalogues, or all the objects of the first catalogue, or the sum of the objects of the two catalogues.

The codes used to select the junction type are:

code Description

0 Objects on both catalogues only

1 All objects presents in the first catalogue

2 All objects of the two catalogues

When the user selects type = 0, he will have fields from both the input catalogues, because only the objects that are in both the catalogues are written in the output file. But when the user select type = 1 or 2 in the output there are records that contain only the fields coming from one catalogue, because in the other one there is not a counterpart object. In the output records, the fields relative to the missing data, will be filled with the blank string.

When the user leaves this field, on the screen the values of identifier keys to help in the answers at the next query will be shown.

Values of KEY1 | Values of KEY2 |03-01-015 |MCG+03-01-014 |03-01-018 |MCG+01-01-013 |01-01-014 |MCG+03-01-016 |04-01-013 |MCG+03-01-015 |03-01-019 |MCG+03-01-017 |03-01-020 |MCG+03-01-018 |123456789-123456789-1234567|123456789-123456789-12345789-

Start pos. Key1

In the two catalogues the key fields can have different length; the user must define the subset of the key field that he needs to use in the comparison. The size of this substring must be the same in the two catalogues, and will be defined later on. Here the user must enter the starting position of the substring, of the key field of the first catalogue. To make an example: if in a key field only the characters from four to ten are valid for the comparison, then 4 must be entered here. Examine the list of the key's values to have this number.

Example : 1

Start pos. Key2

As in the previous field, here the user must enter the starting position of the substring, of the key field of the second catalogue. Example: if in a key field only the characters from four to ten are meaningful for the comparison then 4 must be entered here. Examine the list of the key's values to have this number.

Example : 5

Keys size

Size of the keys used in the comparison. In the two previous values the starting positions of the fields was defined, here the user must enter the length, in characters of the substring that will be evaluated. Examine the list of the key's values to have this number.

Example : 9

Output: File Name

The name of the output file that contains the fields selected from the two catalogues.

Example : NEWCATJ.DAT

PDB Catalogue Name

The name of the new catalogue in the Personal Data Base. When this field is filled an entry in the PDB for this new catalogue is created and the user can continue to work on these new data with DIRA. Otherwise only the output file will be written. Valid catalogue names are strings of 12 or less characters that do not contain special symbols.

Example : NEWCATJ

NOTE:

When the user merges the fields of two catalogues he can have more fields with the same name. In this case the job will ask to change the names of some fields.

In the output record the key used for the merge will be written in the first column, then there are all the fields selected from the first catalogues and then the fields selected from the second catalogues.



Previous: DB_INSTAB
Up: Commands
Next: DB_LINK
Previous Page: DB_INSTAB
Next Page: DB_LINK