! Copyright © Oracle Corporation 1995. All Rights Reserved. 1 OPTION TYPE = EXPLICIT, SIZE = INTEGER LONG ON ERROR GOTO Error_routine DECLARE INTEGER I MAP (Input_buf) STRING Space = 1, & New_dept_code = 4, & New_dept_name = 30, & New_manag_id = 5, & Emp_ids(19) = 5 !array of employee ids MAP (Input_buf) STRING dummy = 140 100 open "newdepts.dat" for output as file #1, organization sequential fixed, & map input_buf, access append 150 PRINT "Entering data loop -- type ^z at any time to quit" 200 Dept_loop: WHILE -1% Dummy = "" INPUT "New Department code"; New_dept_code INPUT "Department name"; New_dept_name INPUT "Manager id"; New_manag_id Emp_loop: FOR I = 0% TO 59% INPUT "Employee id (type only when done)"; Emp_ids (I) EXIT Emp_loop IF Emp_ids(I) = "" NEXT I PUT #1 NEXT 300 GOTO Done 1000 Error_routine: IF ERR=11 THEN PRINT "All done" RESUME 32767 ELSE PRINT "Unexpected error number: "; ERR PRINT "At line "; ERL ON ERROR GO BACK END IF 32767 Done: END