Extraction Syntax Examples

Archive all records from a single Source File

EXTRACT PEOPLE(*)
{
    ARCHIVE MOVE PEOPLE [*];
}

In the above example the business object represents a single file and the Extraction Syntax simply archives all the records from the PEOPLE Source File.

Archive selected records from a single Source File

EXTRACT PEOPLE(PEOPLE.CITY == "DERBY")
{
    ARCHIVE MOVE PEOPLE [*];
}

In the above example the business object represents a single file and the Extraction Syntax selects all the records from the PEOPLE Source File where the CITY field equals DERBY and archives the records.

Archive and Transfer selected records from multiple related Source Files

EXTRACT PEOPLE(PEOPLE.CITY == ["DERBY", "PARIS", "DETROIT"])
{
    EXTRACT CARS(CARS.PERSONNEL_ID == PEOPLE.PERSONNEL_ID)
    {
        ARCHIVE MOVE CARS[*];
    }

    EXTRACT OTHER(OTHER.PERSONNEL_ID== PEOPLE.PERSONNEL_ID)
    {
        ARCHIVE MOVE OTHER[*];
    }
    TRANSFER PEOPLE[*] TO PEOPLE_2;
    ARCHIVE MOVE PEOPLE[*];
}

In the above example the business object represents a person and the Extraction Syntax processes all the records related to a person selected from 3 related Source Files CARS, PEOPLE and OTHER, as follows:

  1. The Extraction Syntax first finds all the records from the PEOPLE Source File belonging to everyone that lives in Derby, Paris or Detroit.

  2. It then selects all the records from the CARS Source File where the PERSONNEL_ID field matches and archives the CARS record.

  3. All the records from the OTHER Source File where the PERSONNEL_ID field matches are then selected and the OTHER record archived.

  4. Finally the selected record from the PEOPLE Source file is transferred to the Adabas Target File PEOPLE_2 and then archived.