In this section: |
This section provides examples of MODIFY processing that add, update and delete data from a data source.
Each request indicates the data source it is modifying, the method of reading data, the transaction values it searches for in the data source, and the actions it takes depending on whether the values are in the data source or not. If it is reading a transaction data source, the request must indicate the name of the data source.
The following sample MODIFY request adds new employee data to the EMPLOYEE data source. When you run the request, it prompts you for an employee ID number, last name, and first name. After you enter these three values, the request adds the information to the data source and prompts you for three more values for the same fields. When you are finished entering data, end execution by entering the word END to any prompt.
The request is as follows:
1. MODIFY FILE EMPLOYEE 2. PROMPT EMP_ID LAST_NAME FIRST_NAME 3. MATCH EMP_ID 4. ON MATCH REJECT 5. ON NOMATCH INCLUDE 6. DATA
The parts of the request are as follows:
MODIFY requests can update data in a data source, replacing data source values with transaction (incoming data) values. The following sample request updates employee department assignments and salaries. When you run the request, it reads the data from a separate data source called EMPDEPT. Each record in the data source consists of three fields:
This is the EMPDEPT data source:
* * * TOP OF FILE * * * 071382660PRODUCTION27500.00 112847612SALES 24800.75 451123478MARKETING 26950.00 * * * END OF FILE * * *
The request is as follows:
MODIFY FILE EMPLOYEE 1. FIXFORM EMP_ID/9 DEPARTMENT/10 CURR_SAL/8 2. MATCH EMP_ID 2. ON NOMATCH REJECT 2. ON MATCH UPDATE DEPARTMENT CURR_SAL 3. DATA ON EMPDEPT 4. END
The parts of the request are as follows:
This sample request deletes information on employees from the data source. When you run the request, it prompts you for an employee ID. When you enter the ID, it deletes all information relating to that employee from the data source.
MODIFY FILE EMPLOYEE 1. PROMPT EMP_ID 2. MATCH EMP_ID ON MATCH DELETE ON NOMATCH REJECT 3. DATA
The parts of the request are as follows:
|
Information Builders |