* Copyright © Oracle Corporation 1995. All Rights Reserved. IDENTIFICATION DIVISION. PROGRAM-ID. Call_other. ********************************************************************* * This subroutine is passed the dbkey and transaction handle * * from the DELETE_RECORD subroutine. With this information, it * * can find and display the employee record associated with an * * employee_id specified in DELETE_RECORD and then return program * * control to the DELETE_RECORD subroutine. * ********************************************************************* DATA DIVISION. WORKING-STORAGE SECTION. * Because the database was invoked in the main program with * GLOBAL attributes, refer to it here as EXTERNAL. &RDB& DATABASE EXTERNAL pers = FILENAME "MF_PERSONNEL" DBKEY SCOPE IS FINISH 01 employees. 02 employee_id PIC X(5). 02 last_name PIC X(14). 02 first_name PIC X(10). 02 middle_initial PIC X. 02 address_data_1 PIC X(25). 02 address_data_2 PIC X(25). 02 city PIC X(20). 02 state PIC X(2). 02 postal_code PIC X(5). 02 birthday PIC S9(11)V9(7) COMP. LINKAGE SECTION. 01 db_key PIC X(8). 01 trans_1 PIC S9(9) COMP. PROCEDURE DIVISION USING db_key, trans_1. Begin. * The transaction was started in the DELETE_RECORD subroutine, * so there is no need to start a transaction here. Use the * transacton handle to identify this request with the transaction * started in DELETE_RECORD. Use the dbkey found in the DELETE_RECORD * subroutine to locate the correct employee record. &RDB& FOR (TRANSACTION_HANDLE trans_1) E IN EMPLOYEES WITH &RDB& E.RDB$DB_KEY = db_key &RDB& GET &RDB& employee_id = E.EMPLOYEE_ID; &RDB& last_name = E.LAST_NAME; &RDB& first_name = E.FIRST_NAME; &RDB& middle_initial = E.MIDDLE_INITIAL; &RDB& address_data_1 = E.ADDRESS_DATA_1; &RDB& address_data_2 = E.ADDRESS_DATA_2; &RDB& city = E.CITY; &RDB& state = E.STATE; &RDB& postal_code = E.POSTAL_CODE; &RDB& birthday = E.BIRTHDAY &RDB& END_GET * Display the EMPLOYEES record. Use SYS$ASCTIM to convert * the data stored in the database in binary format to * ASCII format. DISPLAY SPACE DISPLAY "Employee id: " employee_id DISPLAY "Last name: " last_name DISPLAY "First name: " first_name DISPLAY "Middle init: " middle_initial DISPLAY "Address: " address_data_1, SPACE address_data_2 DISPLAY "City: " city DISPLAY "State: " state DISPLAY "Postal code: " postal_code &RDB& END_FOR EXIT PROGRAM. * Return program control to the DELETE_RECORD subroutine. END PROGRAM Call_other.