COMPILATION LISTING OF SEGMENT sort_sort Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/11/82 1231.8 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* * Copyright (c) 1972 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* *********************************************************** */ 9 10 sort_sort: proc (input_file, output_file, sort_desc, 11 temp_dir, user_out_sw_par, file_size_par, sort_code); 12 13 /* PARAMETERS */ 14 dcl (input_file (*) char (*), /* Input file pathnames or attach descriptions (Input). */ 15 output_file char (*), /* Output file pathnames or attach description (Input). */ 16 sort_desc (*) ptr, /* Pointer to Sort Description (source form) (Input). */ 17 temp_dir char (*), /* Pathname of directory for work files (Input). */ 18 user_out_sw_par char (*), /* Switchname for diagnostics and Sort Report (Input). */ 19 file_size_par float bin (27), /* File size specified by user - millions of bytes (Input). */ 20 sort_code fixed bin (35), /* Status code (Output). */ 21 merge_order_par fixed bin (35), /* Merge order specified by caller of sort_private (Input). */ 22 string_size_par fixed bin (35)) parameter; /* String size specified by caller of sort_private (Input). */ 23 24 /* EXTERNAL ENTRIES */ 25 dcl clock_ entry returns (fixed bin (71)); 26 dcl convert_status_code_ entry (fixed bin (35), char (8) aligned, char (100) aligned); 27 dcl cpu_time_and_paging_ entry (fixed bin, fixed bin (71), fixed bin); 28 dcl expand_path_ entry (ptr, fixed bin, ptr, ptr, fixed bin (35)); 29 dcl get_pdir_ entry returns (char (168) aligned); 30 dcl hcs_$get_process_usage entry (ptr, fixed bin (35)); 31 dcl hcs_$make_seg entry (char (*) aligned, char (*) aligned, char (*), fixed bin (5), ptr, fixed bin (35)); 32 dcl hcs_$status_minf entry (char (*) aligned, char (*) aligned, fixed bin (1), fixed bin (2), 33 fixed bin (24), fixed bin (35)), 34 hcs_$initiate_count entry (char (*) aligned, char (*) aligned, char (*), 35 fixed bin (24), fixed bin (2), ptr, fixed bin (35)); 36 dcl hcs_$truncate_seg entry (ptr, fixed bin (24), fixed bin (35)), 37 hcs_$delentry_seg entry (ptr, fixed bin (35)); 38 dcl hmu entry; 39 dcl ioa_$ioa_stream entry options (variable); 40 dcl ioa_$rsnnl entry options (variable); 41 dcl sub_err_ entry options (variable); 42 dcl translator_temp_$release_segment entry (ptr, fixed bin (35)); 43 dcl unique_chars_ entry (bit (*)) returns (char (15)); 44 45 dcl sort_initiate$initiate_private entry (char (*), ptr, ptr, char (*), float bin (27), 46 fixed bin (35), fixed bin (35), fixed bin (35)); 47 dcl (sort_input_proc, 48 sort_output_proc) entry (fixed bin (35)); 49 dcl sort_commence$commence entry (fixed bin (35)), 50 sort_merge_terminate$terminate entry (fixed bin (35)); 51 dcl sort_cleanup_work entry; 52 dcl sort_merge_subroutine entry ((*)char (*), char (*), (*)ptr, char (*), 53 entry, entry, bit (1), bit (1), 54 ptr, ptr, 55 ptr, ptr); 56 dcl sort_merge_print_report entry; 57 58 /* EXTERNAL STATIC */ 59 1 1 dcl 1 sort_ext$acl(1) ext, 1 2 2 x_user_id char(32), 1 3 2 x_modes bit(36), 1 4 2 x_pad bit(36), 1 5 2 x_acl_code fixed bin(35); 1 6 dcl 1 acl(1) 1 7 defined(sort_ext$acl), 1 8 2 user_id char(32), 1 9 2 modes bit(36), 1 10 2 pad bit(36), 1 11 2 acl_code fixed bin(35); 1 12 dcl sort_ext$b(0: 31) fixed bin(30) ext; /* keys - bit offset (usually) for sort_comp */ 1 13 dcl b(0: 31) fixed bin(30) 1 14 defined (sort_ext$b); 1 15 dcl sort_ext$compares_counter fixed bin(34) ext; /* compares executed, excluding sequence checker */ 1 16 dcl compares_counter fixed bin(34) 1 17 defined(sort_ext$compares_counter); 1 18 dcl sort_ext$compare_sw fixed bin(1) ext; /* 1 = user compare exit specified */ 1 19 dcl compare_sw fixed bin(1) 1 20 defined (sort_ext$compare_sw); 1 21 dcl sort_ext$curr_input_file_attach char(256) ext; /* attach description, current input file (Sort) */ 1 22 dcl curr_input_file_attach char(256) 1 23 defined(sort_ext$curr_input_file_attach); 1 24 dcl sort_ext$curr_input_file_name char(256) ext; /* pathname, current input file (Sort) */ 1 25 dcl curr_input_file_name char(256) 1 26 defined (sort_ext$curr_input_file_name); 1 27 dcl sort_ext$curr_input_file_num fixed bin(17) ext; /* number for current input file (Sort) */ 1 28 dcl curr_input_file_num fixed bin(17) 1 29 defined (sort_ext$curr_input_file_num); 1 30 dcl sort_ext$curr_output_file_attach char(256) ext; /* attach description, output file */ 1 31 dcl curr_output_file_attach char(256) 1 32 defined(sort_ext$curr_output_file_attach); 1 33 dcl sort_ext$curr_output_file_name char(256) ext; /* pathname, output file */ 1 34 dcl curr_output_file_name char(256) 1 35 defined (sort_ext$curr_output_file_name); 1 36 dcl sort_ext$debug_sw bit(1) ext; /* 1 = -debug argument specified */ 1 37 dcl debug_sw bit(1) 1 38 defined(sort_ext$debug_sw); 1 39 dcl sort_ext$disaster2 fixed bin(17) ext; /* 0 = first call to sort_return or merge_return */ 1 40 dcl disaster2 fixed bin(17) 1 41 defined (sort_ext$disaster2); 1 42 dcl sort_ext$dt(0: 31) fixed bin(30) ext; /* keys - datatype for sort_comp */ 1 43 dcl dt(0: 31) fixed bin(30) 1 44 defined (sort_ext$dt); 1 45 dcl sort_ext$input_driver_is_sort bit(1) ext; /* 1 = Sort reads input files, 0 = input_file exit */ 1 46 dcl input_driver_is_sort bit(1) 1 47 defined(sort_ext$input_driver_is_sort); 1 48 dcl sort_ext$input_file_exit_sw bit(1) ext; /* 1 = user input_file exit specified */ 1 49 dcl input_file_exit_sw bit(1) 1 50 defined(sort_ext$input_file_exit_sw); 1 51 dcl sort_ext$input_file_max fixed bin(17) ext; /* number of input files specified [init(10)] */ 1 52 /* must also change merge_return: merge_read_count & input_file_len */ 1 53 dcl input_file_max fixed bin(17) 1 54 defined(sort_ext$input_file_max); 1 55 dcl sort_ext$input_record_exit_sw fixed bin(1) ext; /* 1 = user input_record exit specified */ 1 56 dcl input_record_exit_sw fixed bin(1) 1 57 defined(sort_ext$input_record_exit_sw); 1 58 dcl sort_ext$input_rec_deleted fixed bin(30) ext; /* number of records deleted at input_record exit */ 1 59 dcl input_rec_deleted fixed bin(30) 1 60 defined(sort_ext$input_rec_deleted); 1 61 dcl sort_ext$input_rec_inserted fixed bin(30) ext; /* number of records inserted _record exit */ 1 62 dcl input_rec_inserted fixed bin(30) 1 63 defined(sort_ext$input_rec_inserted); 1 64 dcl sort_ext$in_buff_ptr ptr ext; /* buffer for an input record (Sort or Merge reading) */ 1 65 dcl in_buff_ptr ptr 1 66 defined (sort_ext$in_buff_ptr); 1 67 dcl sort_ext$leng(0: 31) fixed bin(30) ext; /* keys - length or precision for sort_comp */ 1 68 dcl leng(0: 31) fixed bin(30) 1 69 defined (sort_ext$leng); 1 70 dcl sort_ext$max1 fixed bin(30) ext; /* limits size of unsorted string SS (sort_release) */ 1 71 dcl max1 fixed bin(30) 1 72 defined (sort_ext$max1); 1 73 dcl sort_ext$max2 fixed bin(30) ext; /* limits size of unsorted string SS (sort_release) */ 1 74 dcl max2 fixed bin(30) 1 75 defined (sort_ext$max2); 1 76 dcl sort_ext$max3 fixed bin(30) ext; /* maximum number of records per string SS */ 1 77 dcl max3 fixed bin(30) 1 78 defined (sort_ext$max3); 1 79 dcl sort_ext$max4 fixed bin(30) ext; /* maximum merge order allowed (sort_presort) */ 1 80 dcl max4 fixed bin(30) 1 81 defined (sort_ext$max4); 1 82 dcl sort_ext$max_rec_length fixed bin(30) ext; /* maximum record length permitted by Sort or Merge; */ 1 83 /* slightly less than sys_info$max_seg_size */ 1 84 dcl max_rec_length fixed bin(30) 1 85 defined (sort_ext$max_rec_length); 1 86 dcl sort_ext$merge_compares fixed bin(34) ext; /* number of compares in merge */ 1 87 dcl merge_compares fixed bin(34) 1 88 defined(sort_ext$merge_compares); 1 89 dcl sort_ext$merge_in_iocb_ptrs(10) ptr ext; /* iox_ iocb's for Merge input files */ 1 90 dcl merge_in_iocb_ptrs(10) ptr 1 91 defined(sort_ext$merge_in_iocb_ptrs); 1 92 dcl sort_ext$merge_input_file_attaches(10) char(256) ext; /* attach descriptions, Merge input files */ 1 93 dcl merge_input_file_attaches(10) char(256) 1 94 defined(sort_ext$merge_input_file_attaches); 1 95 dcl sort_ext$merge_input_file_names(10) char(256) ext; /* pathnames, Merge input files */ 1 96 dcl merge_input_file_names(10) char(256) 1 97 defined(sort_ext$merge_input_file_names); 1 98 dcl sort_ext$mii fixed bin(17) ext; /* merge order for Sort [init(0)] */ 1 99 dcl mii fixed bin(17) 1 100 defined (sort_ext$mii); 1 101 dcl sort_ext$min_rec_length fixed bin(30) ext; /* record length required to include all key fields */ 1 102 dcl min_rec_length fixed bin(30) 1 103 defined (sort_ext$min_rec_length); 1 104 dcl sort_ext$mip (1000) fixed bin(30) ext; /* number of records in each string MS for merge */ 1 105 dcl mip (1000) fixed bin(30) 1 106 defined (sort_ext$mip); 1 107 dcl sort_ext$msp (1000) ptr ext; /* sorted strings MS(1:mii) to be merged */ 1 108 dcl msp (1000) ptr 1 109 defined (sort_ext$msp); 1 110 dcl sort_ext$no_of_keys fixed bin(30) ext; /* number of keys specified */ 1 111 dcl no_of_keys fixed bin(30) 1 112 defined(sort_ext$no_of_keys); 1 113 dcl sort_ext$old_input_file_num fixed bin(17) ext; /* used for identifying files with bad key data */ 1 114 dcl old_input_file_num fixed bin(17) /* (illegal_procedure handler in sort_presort) */ 1 115 defined(sort_ext$old_input_file_num); 1 116 dcl sort_ext$output_driver_is_sort bit(1) ext; /* 1 = Sort or Merge writes output file; */ 1 117 dcl output_driver_is_sort bit(1) /* 0 = output_file exit */ 1 118 defined(sort_ext$output_driver_is_sort); 1 119 dcl sort_ext$output_file_exit_sw bit(1) ext; /* 1 = user output_file exit specified */ 1 120 dcl output_file_exit_sw bit(1) 1 121 defined(sort_ext$output_file_exit_sw); 1 122 dcl sort_ext$output_rec_deleted fixed bin(30) ext; /* number of records deleted at output_record exit */ 1 123 dcl output_rec_deleted fixed bin(30) 1 124 defined(sort_ext$output_rec_deleted); 1 125 dcl sort_ext$output_rec_inserted fixed bin(30) ext; /* number of record inserted at output_record exit */ 1 126 dcl output_rec_inserted fixed bin(30) 1 127 defined(sort_ext$output_rec_inserted); 1 128 dcl sort_ext$output_record_exit_sw fixed bin(1) ext; /* 1 = user output_record exit specified */ 1 129 dcl output_record_exit_sw fixed bin(1) 1 130 defined(sort_ext$output_record_exit_sw); 1 131 dcl sort_ext$presort_compares fixed bin(34) ext; /* number of compares in presort */ 1 132 dcl presort_compares fixed bin(34) 1 133 defined(sort_ext$presort_compares); 1 134 dcl 1 sort_ext$pu(5) ext, 1 135 2 x_n fixed bin, /* [init((5) 1)] */ 1 136 2 x_rcpu fixed bin(71); 1 137 dcl 1 pu(5) 1 138 defined(sort_ext$pu), 1 139 2 n fixed bin, 1 140 2 rcpu fixed bin(71); 1 141 dcl sort_ext$read_count fixed bin(30) ext; /* number of records read by Sort (or by Merge) */ 1 142 dcl read_count fixed bin(30) 1 143 defined (sort_ext$read_count); 1 144 dcl sort_ext$rec_ptr_a ptr ext; /* buffer for output_record exit and sequence checker */ 1 145 dcl rec_ptr_a ptr 1 146 defined(sort_ext$rec_ptr_a); 1 147 dcl sort_ext$rec_ptr_b ptr ext; /* buffer for output_record exit and sequence checker */ 1 148 dcl rec_ptr_b ptr 1 149 defined(sort_ext$rec_ptr_b); 1 150 dcl sort_ext$release_count fixed bin(30) ext; /* number of records released to Sort (Merge) */ 1 151 dcl release_count fixed bin(30) 1 152 defined (sort_ext$release_count); 1 153 dcl sort_ext$report_sw bit(2) ext; /* 00 = print summary report, 01 = suppress */ 1 154 dcl report_sw bit(2) 1 155 defined (sort_ext$report_sw); 1 156 dcl sort_ext$return_count fixed bin(30) ext; /* number of records returned from Sort (Merge) */ 1 157 dcl return_count fixed bin(30) 1 158 defined (sort_ext$return_count); 1 159 dcl sort_ext$rev(0: 31) fixed bin(1) ext; /* keys - descending indicator for sort_comp */ 1 160 dcl rev(0: 31) fixed bin(1) 1 161 defined (sort_ext$rev); 1 162 dcl sort_ext$sii fixed bin(30) ext; /* number of records, current string (sort_release) */ 1 163 dcl sii fixed bin(30) 1 164 defined (sort_ext$sii); 1 165 dcl sort_ext$sip ptr ext; /* SI - tree of indices (subscripts) for records */ 1 166 dcl sip ptr /* being sorted or merged */ 1 167 defined (sort_ext$sip); 1 168 dcl sort_ext$sort_compare_exit variable /* entry point, user compare exit procedure */ 1 169 entry(ptr, ptr) returns(fixed bin(1)) ext; 1 170 dcl sort_ext$sort_desc_pn char(168) ext; /* pathname, Sort (Merge) Description segment */ 1 171 dcl sort_desc_pn char(168) 1 172 defined(sort_ext$sort_desc_pn); 1 173 dcl sort_ext$sort_input_record_exit variable /* entry point, user input_record exit procedure */ 1 174 entry(ptr, fixed bin(21), fixed bin, bit(1)) ext; 1 175 dcl sort_input_record_exit variable 1 176 entry(ptr, fixed bin(21), fixed bin, bit(1)) 1 177 defined(sort_ext$sort_input_record_exit); 1 178 dcl sort_ext$sort_output_record_exit variable /* entry point, user output_record exit procedure */ 1 179 entry(ptr, fixed bin(21), ptr, fixed bin(21), fixed bin, fixed bin(1), bit(1), bit(1), bit(1)) ext; 1 180 dcl sort_output_record_exit variable 1 181 entry(ptr, fixed bin(21), ptr, fixed bin(21), fixed bin, fixed bin(1), bit(1), bit(1), bit(1)) 1 182 defined(sort_ext$sort_output_record_exit); 1 183 dcl sort_ext$srp ptr ext; /* SR - position and length of each record */ 1 184 dcl srp ptr /* in SS string for presort */ 1 185 defined (sort_ext$srp); 1 186 dcl sort_ext$ssi fixed bin(30) ext; /* char offset in SS of current record (sort_release) */ 1 187 dcl ssi fixed bin(30) 1 188 defined (sort_ext$ssi); 1 189 dcl sort_ext$ssp ptr ext; /* SS - unsorted string during presort */ 1 190 dcl ssp ptr 1 191 defined (sort_ext$ssp); 1 192 dcl sort_ext$state fixed bin(17) ext; /* state variable controlling sequence of calls to */ 1 193 dcl state fixed bin(17) /* the various stages of the Sort (Merge) [init(0)] */ 1 194 defined (sort_ext$state); 1 195 dcl sort_ext$terminate_print_sw bit(1) ext; /* 0 = command prints (sort_merge_print_report) */ 1 196 dcl terminate_print_sw bit(1) /* 1 = subroutine prints (sort_merge_terminate) */ 1 197 defined (sort_ext$terminate_print_sw); 1 198 dcl 1 sort_ext$time_info(5) ext, /* used for -time information */ 1 199 2 x_etime fixed bin(71), 1 200 2 x_vtime fixed bin(71), 1 201 2 x_pf fixed bin, 1 202 2 x_pd_f fixed bin; 1 203 dcl 1 time_info(5) 1 204 defined(sort_ext$time_info), 1 205 2 etime fixed bin(71), 1 206 2 vtime fixed bin(71), 1 207 2 pf fixed bin, 1 208 2 pd_f fixed bin; 1 209 dcl sort_ext$time_sw bit(1) ext; /* 1 = -time argument specified */ 1 210 dcl time_sw bit(1) 1 211 defined(sort_ext$time_sw); 1 212 dcl sort_ext$user_out_sw char(32) ext; /* I/O switch for summary report, diagnostics: */ 1 213 dcl user_out_sw char(32) /* "user_output", "" = suppress, other = user switch */ 1 214 defined(sort_ext$user_out_sw); 1 215 dcl sort_ext$unique_prefix char(16) ext; /* unique to each invocation, for temporary names */ 1 216 dcl unique_prefix char(16) 1 217 defined (sort_ext$unique_prefix); /* -4- */ 1 218 dcl sort_ext$w(0: 31) fixed bin(30) ext; /* keys - word (sometimes char) offset for sort_comp */ 1 219 dcl w(0: 31) fixed bin(30) 1 220 defined (sort_ext$w); 1 221 dcl sort_ext$wf_dir_name char(168) aligned ext; /* -td directory pathname argument */ 1 222 dcl wf_dir_name char(168) aligned 1 223 defined(sort_ext$wf_dir_name); 1 224 dcl sort_ext$wf_full_name char(168) ext; /* absolute -td directory pathname */ 1 225 dcl wf_full_name char(168) 1 226 defined (sort_ext$wf_full_name); /* -42- */ 1 227 dcl sort_ext$whoami char(6) ext; /* "sort", "merge", "sort_", "merge_" called */ 1 228 dcl whoami char(6) 1 229 defined (sort_ext$whoami); /* -2- */ 1 230 dcl sort_ext$write_count fixed bin(30) ext; /* number of records written by Sort (Merge) */ 1 231 dcl write_count fixed bin(30) 1 232 defined (sort_ext$write_count); 60 61 62 dcl (error_table_$out_of_sequence, 63 error_table_$fatal_error, 64 error_table_$bad_arg) external static fixed bin (35); 65 66 /* INTERNAL STATIC (constants only) */ 67 dcl (on init ("1"b), 68 off init ("0"b)) bit (1) internal static; 69 70 /* AUTOMATIC AND BASED */ 71 dcl temp_dir_temp char (168), 72 keys_ptr ptr, 73 exits_ptr ptr, 74 user_out_sw_temp char (32), 75 code fixed bin (35), /* work location for status codes returned from calls made by driver */ 76 merge_order_temp fixed bin (35), 77 string_size_temp fixed bin (35); 78 79 dcl file_size_user_val fixed bin (71), /* Value given by user - bytes. */ 80 file_size_computed fixed bin (71), /* Amount of input data in storage system - bytes. */ 81 file_size_pass float bin (27); /* Passed to sort_initiate - millions of bytes. */ 82 dcl some_not_found bit (1); 83 84 dcl (temp_sd_int, 85 temp_sd_lex) ptr init (null ()); 86 87 dcl (sort_input_exit, 88 sort_output_exit) entry (fixed bin (35)) variable; 89 90 dcl state_code fixed bin (35); 91 92 dcl arg_err_sw bit (1), 93 fatal_sw bit (1); 94 95 dcl j fixed bin (17); /* Used for do loop calling input file procedure. */ 96 dcl hcs_code fixed bin (35); 97 98 dcl expand_code fixed bin (35); 99 dcl in_dir char (168) aligned, 100 in_ename char (32) aligned, 101 in_bit_count fixed bin (24), 102 in_ptr ptr, 103 type fixed bin (2), 104 component char (32) aligned, 105 comp_len fixed bin (17); 106 107 dcl shortinfo char (8) aligned, 108 longinfo char (100) aligned; 109 110 dcl retval fixed bin (35); 111 dcl cleanup condition; 112 113 /* Start. */ 114 115 call state_test (state_code); /* Test state variable. */ 116 if state_code ^= 0 then do; 117 sort_code = error_table_$out_of_sequence; 118 return; /* to caller without resetting state variable */ 119 end; 120 state = 2; 121 merge_order_temp = 0; /* Merge order not specified. */ 122 string_size_temp = 0; /* String_size not specified. */ 123 time_sw = off; /* Timing not specified. */ 124 debug_sw = off; /* Debug option not specified. */ 125 arg_err_sw = off; /* Not done in common_start; see sort_private entry. */ 126 common_start: 127 sort_code = 0; 128 mii = 0; /* Used by sort_cleanup_work */ 129 sip = null (); /* Used by sort_cleanup_work */ 130 in_buff_ptr = null (); /* Used by cleanup procedure */ 131 temp_sd_lex, 132 temp_sd_int = null (); /* used by cleanup procedure */ 133 on cleanup call cleanup_proc; 134 user_out_sw_temp = user_out_sw_par; /* Pass on. */ 135 temp_dir_temp = temp_dir; /* Pass on to sort_$initiate. */ 136 137 call sort_merge_subroutine (input_file, output_file, sort_desc, user_out_sw_temp, 138 sort_input_exit, sort_output_exit, arg_err_sw, fatal_sw, 139 keys_ptr, exits_ptr, 140 temp_sd_lex, temp_sd_int); 141 call create_in_buff; 142 file_size_user_val = file_size_par * 10**6; /* File size specified by user. */ 143 call set_file_size; 144 145 /* Driver: 5 steps. */ 146 /* (1) Initiate. */ 147 if fatal_sw = off then 148 call sort_initiate$initiate_private (temp_dir_temp, keys_ptr, exits_ptr, user_out_sw_temp, file_size_pass, 149 code, merge_order_temp, string_size_temp); 150 if arg_err_sw = on | fatal_sw = on then do; 151 sort_code = error_table_$bad_arg; 152 go to exit; 153 end; 154 if code ^= 0 then do; 155 if code = error_table_$out_of_sequence then do; 156 call sub_err_ (code, whoami, "c", null (), retval, 157 "Calling sort_$initiate."); 158 sort_code = error_table_$fatal_error; 159 end; 160 else sort_code = code; 161 go to exit; 162 end; 163 if time_sw = on then do; /* Beginning of Presort. */ 164 etime (2) = clock_ (); 165 call cpu_time_and_paging_ (pf (2), vtime (2), pd_f (2)); 166 call hcs_$get_process_usage (addr (pu (2)), hcs_code); 167 end; 168 169 /* (2) Call an input file procedure. */ 170 if input_driver_is_sort = on then /* Call Sort's input file procedure, once per input file. */ 171 do j = 1 to dimension (input_file, 1); 172 curr_input_file_name = input_file (lbound (input_file, 1) + j - 1); 173 curr_input_file_num = j; 174 call scan_for_pn_or_attach (curr_input_file_name, curr_input_file_attach); 175 call sort_input_proc (code); 176 if code ^= 0 then do; 177 if code ^= error_table_$fatal_error then do; 178 call sub_err_ (code, whoami, "c", null (), retval, 179 "Sort's input_file procedure."); 180 end; 181 sort_code = error_table_$fatal_error; 182 go to exit; 183 end; 184 end; 185 else do; /* Call user's input file procedure. */ 186 call sort_input_exit (code); 187 if code ^= 0 then do; 188 if code ^= error_table_$fatal_error 189 then call sub_err_ (code, whoami, "c", null (), retval, 190 "User input_file exit procedure."); 191 sort_code = error_table_$fatal_error; 192 go to exit; 193 end; 194 end; 195 196 /* (3) Commence. */ 197 call sort_commence$commence (code); 198 if code ^= 0 then do; 199 if code = error_table_$out_of_sequence then 200 call sub_err_ (code, whoami, "c", null (), retval, 201 "Calling sort_$commence."); 202 sort_code = error_table_$fatal_error; 203 go to exit; 204 end; 205 if time_sw = on then do; /* End of Presort - beginning of Merge */ 206 etime (3) = clock_ (); 207 call cpu_time_and_paging_ (pf (3), vtime (3), pd_f (3)); 208 call hcs_$get_process_usage (addr (pu (3)), hcs_code); 209 call hmu; 210 end; 211 212 /* (4) Call an output file procedure. */ 213 if output_driver_is_sort = on then /* Call Sort's output file procedure. */ 214 do; 215 /* sort_merge_subroutine has set up curr_output_file_name & curr_output_file_attach. */ 216 call sort_output_proc (code); 217 if code ^= 0 then do; 218 if code ^= error_table_$fatal_error then do; 219 call sub_err_ (code, whoami, "c", null (), retval, 220 "Sort's output_file procedure."); 221 end; 222 sort_code = error_table_$fatal_error; 223 go to exit; 224 end; 225 end; 226 else do; /* Call user's output file procedure. */ 227 call sort_output_exit (code); /* User's output procedure. */ 228 if code ^= 0 then do; 229 if code ^= error_table_$fatal_error 230 then call sub_err_ (code, whoami, "c", null (), retval, 231 "User output_file exit procedure."); 232 sort_code = error_table_$fatal_error; 233 go to exit; 234 end; 235 end; 236 if time_sw = on then do; /* End of Merge. */ 237 etime (4) = clock_ (); 238 call cpu_time_and_paging_ (pf (4), vtime (4), pd_f (4)); 239 call hcs_$get_process_usage (addr (pu (4)), hcs_code); 240 end; 241 242 /* (5) Terminate. */ 243 call sort_merge_print_report; 244 call sort_merge_terminate$terminate (code); 245 if code ^= 0 then do; 246 if code = error_table_$out_of_sequence then 247 call sub_err_ (code, whoami, "c", null (), retval, 248 "Calling sort_$terminate."); 249 sort_code = error_table_$fatal_error; 250 go to exit; 251 end; 252 exit: 253 call cleanup_proc; 254 state = 8; 255 return; /* to caller of sort_ */ 256 257 258 /* ENTRY sort_$sort_private called only by sort command. */ 259 sort_private: entry (input_file, output_file, sort_desc, temp_dir, user_out_sw_par, file_size_par, sort_code, 260 merge_order_par, string_size_par); 261 state = 2; 262 if sort_code ^= 0 then arg_err_sw = on; /* sort has encountered some error already */ 263 else arg_err_sw = off; 264 merge_order_temp = merge_order_par; /* Pass on merge order from sort. */ 265 string_size_temp = string_size_par; /* Pass on string_size from sort. */ 266 go to common_start; 267 268 269 state_test: proc (state_code); /* Test state variable: */ 270 dcl state_code fixed bin (35) parameter; 271 if state = 0 272 | (state = 8 & index (whoami, "_") ^= 0) /* Subroutine called last */ 273 then do; 274 whoami = "sort_"; 275 unique_prefix = before (unique_chars_ ("0"b), " ")||"."; /* Get unique character string. */ 276 state_code = 0; 277 end; 278 else do; 279 state_code = 1; 280 return; 281 end; 282 end state_test; 283 284 285 scan_for_pn_or_attach: proc (name, attach); 286 dcl (name char (*), 287 attach char (*)) parameter; 288 dcl (j, k) fixed bin (17); 289 k = 1; 290 do while (substr (name, k, 1) = " " & k < length (name)); 291 k = k + 1; 292 end; 293 j = k; 294 do while (substr (name, k, 1) ^= " " & k < length (name)); 295 k = k + 1; 296 end; 297 do while (substr (name, k, 1) = " " & k < length (name)); 298 k = k + 1; 299 end; 300 if substr (name, j, 4) = "-if " | substr (name, j, 12) = "-input_file " then do; 301 name = substr (name, k); 302 attach = ""; 303 end; 304 else if substr (name, j, 5) = "-ids " | substr (name, j, 19) = "-input_description " then do; 305 attach = substr (name, k); 306 end; 307 end scan_for_pn_or_attach; 308 309 310 set_file_size: proc; 311 /* Decide on input file size to use for sorting */ 312 dcl (i, j) fixed bin (17); 313 dcl pn char (256); 314 dcl att char (4); /* Unused. */ 315 316 /* First, compute the amount of input data which is in the storage system. */ 317 some_not_found = off; 318 if input_driver_is_sort = off then do; /* All input data unknown. */ 319 some_not_found = on; 320 file_size_computed = 0; 321 end; 322 else do; /* Input files specified. */ 323 file_size_computed = 0; 324 do j = lbound (input_file, 1) to hbound (input_file, 1); /* For each input file. */ 325 if substr (input_file (j), 1, 4) = "-if " 326 | substr (input_file (j), 1, 12) = "-input_file" then do; 327 pn = input_file (j); 328 call scan_for_pn_or_attach (pn, att); 329 call expand_path_ (addr (pn), length (pn), addr (in_dir), 330 addr (in_ename), expand_code); 331 if expand_code ^= 0 then do; /* Cannot expand pathname. */ 332 some_not_found = on; 333 end; 334 else do; /* Try to find file in storage system. */ 335 call hcs_$status_minf (in_dir, in_ename, 1 /* chase links */, type, in_bit_count, hcs_code); 336 if hcs_code ^= 0 | type = 0 /* link */ then do; /* Cannot get at file. */ 337 some_not_found = on; 338 end; 339 else if type = 1 then do; /* single segment file */ 340 if file_size_computed > 10**9 then do; 341 call file_too_large; 342 return; 343 end; 344 file_size_computed = file_size_computed + divide (in_bit_count, 9, 71); 345 end; 346 else do i = 0 to (in_bit_count - 1); /* multi segment file */ 347 if file_size_computed > 10**9 then do; 348 call file_too_large; 349 return; 350 end; 351 call ioa_$rsnnl ("^d", component, comp_len, i); 352 call hcs_$initiate_count (before (in_dir, " ") || ">" || in_ename, component, "", 353 in_bit_count, 0, in_ptr, hcs_code); 354 if in_ptr = null () then do; /* component missing. */ 355 some_not_found = on; 356 end; 357 else /* Component found. */ 358 file_size_computed = file_size_computed + divide (in_bit_count, 9, 71); 359 end; /* of do for components of multisegment file */ 360 end; /* of else do (expand_code = 0) */ 361 end; /* of else do (file is specified by pathname) */ 362 else some_not_found = on; /* This file not in storage system. */ 363 end; /* of do j = lbound ... */ 364 end; /* of computation of input data which is in storage system */ 365 366 /* Second, decide whether to use file size specified by user, 367* or value computed to be in storage system, 368* or default to 1.0 million bytes. */ 369 if file_size_user_val < 50 then do; /* User did not specify file size */ 370 if some_not_found = off /* All input is in the storagee system */ 371 then file_size_pass = file_size_computed; 372 else /* Some input is not in the storage system */ 373 file_size_pass = file_size_computed + 1.04*10**6; 374 /* Amount in storage system plus allowance for amount not in storage system */ 375 end; 376 else do; /* User did specify file size */ 377 if input_record_exit_sw = 1 /* User can insert or delete records */ 378 then file_size_pass = file_size_user_val; 379 /* user knows best, since records can be inserted or deleted */ 380 else do; /* User cannot insert or delete records */ 381 if some_not_found = on /* Some input is not in the storage system */ 382 then file_size_pass = max (file_size_computed, file_size_user_val); 383 /* Take user value unless amount in storage system is greater */ 384 else /* All input is in the storage system */ 385 file_size_pass = file_size_computed; 386 end; 387 end; 388 file_size_pass = divide (file_size_pass, 10**6, 63); 389 end set_file_size; 390 391 392 file_too_large: proc; 393 if user_out_sw ^= "" then call ioa_$ioa_stream (user_out_sw, 394 "^a: Amount of input data too large. Must be < 10**9 bytes.", whoami); 395 arg_err_sw = on; 396 end file_too_large; 397 398 399 create_in_buff: proc; 400 call hcs_$make_seg (get_pdir_ (), unique_prefix||"sort_in_buff_", "", 8+2, /* : rw */ in_buff_ptr, hcs_code); 401 if in_buff_ptr = null () then do; 402 arg_err_sw = on; 403 call convert_status_code_ (hcs_code, shortinfo, longinfo); 404 if user_out_sw ^= "" then call ioa_$ioa_stream (user_out_sw, 405 "^a: ^a Unable to create temporary segment [pd]>^asort_in_buff_", 406 whoami, longinfo, unique_prefix); 407 end; 408 end create_in_buff; 409 410 411 cleanup_proc: proc; 412 dcl code fixed bin (35); 413 if debug_sw = off then do; 414 if temp_sd_lex ^= null () then call translator_temp_$release_segment (temp_sd_lex, code); 415 if temp_sd_int ^= null () then call hcs_$delentry_seg (temp_sd_int, code); 416 if in_buff_ptr ^= null () then call hcs_$delentry_seg (in_buff_ptr, code); 417 end; 418 else do; 419 if temp_sd_lex ^= null () then call hcs_$truncate_seg (temp_sd_lex, 0, code); 420 if temp_sd_int ^= null () then call hcs_$truncate_seg (temp_sd_int, 0, code); 421 if in_buff_ptr ^= null () then call hcs_$truncate_seg (in_buff_ptr, 0, code); 422 end; 423 call sort_cleanup_work; 424 state = 8; 425 end cleanup_proc; 426 427 428 end sort_sort; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/11/82 1025.0 sort_sort.pl1 >spec>on>11/11/82>sort_sort.pl1 60 1 12/20/77 1614.2 sort_ext.incl.pl1 >ldd>include>sort_ext.incl.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. arg_err_sw 000215 automatic bit(1) unaligned dcl 92 set ref 125* 137* 150 262* 263* 395* 402* att 000514 automatic char(4) unaligned dcl 314 set ref 328* attach parameter char unaligned dcl 286 set ref 285 302* 305* cleanup 000356 stack reference condition dcl 111 ref 133 clock_ 000012 constant entry external dcl 25 ref 164 206 237 code 000100 automatic fixed bin(35,0) dcl 412 in procedure "cleanup_proc" set ref 414* 415* 416* 419* 420* 421* code 000166 automatic fixed bin(35,0) dcl 71 in procedure "sort_sort" set ref 147* 154 155 156* 160 175* 176 177 178* 186* 187 188 188* 197* 198 199 199* 216* 217 218 219* 227* 228 229 229* 244* 245 246 246* comp_len 000321 automatic fixed bin(17,0) dcl 99 set ref 351* component 000311 automatic char(32) dcl 99 set ref 351* 352* convert_status_code_ 000014 constant entry external dcl 26 ref 403 cpu_time_and_paging_ 000016 constant entry external dcl 27 ref 165 207 238 curr_input_file_attach defined char(256) unaligned dcl 1-22 set ref 174* curr_input_file_name defined char(256) unaligned dcl 1-25 set ref 172* 174* curr_input_file_num defined fixed bin(17,0) dcl 1-28 set ref 173* debug_sw defined bit(1) unaligned dcl 1-37 set ref 124* 413 error_table_$bad_arg 000142 external static fixed bin(35,0) dcl 62 ref 151 error_table_$fatal_error 000140 external static fixed bin(35,0) dcl 62 ref 158 177 181 188 191 202 218 222 229 232 249 error_table_$out_of_sequence 000136 external static fixed bin(35,0) dcl 62 ref 117 155 199 246 etime defined fixed bin(71,0) array level 2 dcl 1-203 set ref 164* 206* 237* exits_ptr 000154 automatic pointer dcl 71 set ref 137* 147* expand_code 000221 automatic fixed bin(35,0) dcl 98 set ref 329* 331 expand_path_ 000020 constant entry external dcl 28 ref 329 fatal_sw 000216 automatic bit(1) unaligned dcl 92 set ref 137* 147 150 file_size_computed 000174 automatic fixed bin(71,0) dcl 79 set ref 320* 323* 340 344* 344 347 357* 357 370 372 381 384 file_size_par parameter float bin(27) dcl 14 ref 10 142 259 file_size_pass 000176 automatic float bin(27) dcl 79 set ref 147* 370* 372* 377* 381* 384* 388* 388 file_size_user_val 000172 automatic fixed bin(71,0) dcl 79 set ref 142* 369 377 381 get_pdir_ 000022 constant entry external dcl 29 ref 400 400 hcs_$delentry_seg 000036 constant entry external dcl 36 ref 415 416 hcs_$get_process_usage 000024 constant entry external dcl 30 ref 166 208 239 hcs_$initiate_count 000032 constant entry external dcl 32 ref 352 hcs_$make_seg 000026 constant entry external dcl 31 ref 400 hcs_$status_minf 000030 constant entry external dcl 32 ref 335 hcs_$truncate_seg 000034 constant entry external dcl 36 ref 419 420 421 hcs_code 000220 automatic fixed bin(35,0) dcl 96 set ref 166* 208* 239* 335* 336 352* 400* 403* hmu 000040 constant entry external dcl 38 ref 209 i 000412 automatic fixed bin(17,0) dcl 312 set ref 346* 351* in_bit_count 000304 automatic fixed bin(24,0) dcl 99 set ref 335* 344 346 352* 357 in_buff_ptr defined pointer dcl 1-65 set ref 130* 400* 401 416 416* 421 421* in_dir 000222 automatic char(168) dcl 99 set ref 329 329 335* 352 in_ename 000274 automatic char(32) dcl 99 set ref 329 329 335* 352 in_ptr 000306 automatic pointer dcl 99 set ref 352* 354 input_driver_is_sort defined bit(1) unaligned dcl 1-46 ref 170 318 input_file parameter char array unaligned dcl 14 set ref 10 137* 170 172 172 259 324 324 325 325 327 input_record_exit_sw defined fixed bin(1,0) dcl 1-56 ref 377 ioa_$ioa_stream 000042 constant entry external dcl 39 ref 393 404 ioa_$rsnnl 000044 constant entry external dcl 40 ref 351 j 000413 automatic fixed bin(17,0) dcl 312 in procedure "set_file_size" set ref 324* 325 325 327* j 000402 automatic fixed bin(17,0) dcl 288 in procedure "scan_for_pn_or_attach" set ref 293* 300 300 304 304 j 000217 automatic fixed bin(17,0) dcl 95 in procedure "sort_sort" set ref 170* 172 173* k 000403 automatic fixed bin(17,0) dcl 288 set ref 289* 290 290 291* 291 293 294 294 295* 295 297 297 298* 298 301 305 keys_ptr 000152 automatic pointer dcl 71 set ref 137* 147* longinfo 000324 automatic char(100) dcl 107 set ref 403* 404* merge_order_par parameter fixed bin(35,0) dcl 14 ref 259 264 merge_order_temp 000167 automatic fixed bin(35,0) dcl 71 set ref 121* 147* 264* mii defined fixed bin(17,0) dcl 1-99 set ref 128* name parameter char unaligned dcl 286 set ref 285 290 290 294 294 297 297 300 300 301* 301 304 304 305 off constant bit(1) initial unaligned dcl 67 ref 123 124 125 147 263 317 318 370 413 on constant bit(1) initial unaligned dcl 67 ref 150 150 163 170 205 213 236 262 319 332 337 355 362 381 395 402 output_driver_is_sort defined bit(1) unaligned dcl 1-117 ref 213 output_file parameter char unaligned dcl 14 set ref 10 137* 259 pd_f 5 defined fixed bin(17,0) array level 2 dcl 1-203 set ref 165* 207* 238* pf 4 defined fixed bin(17,0) array level 2 dcl 1-203 set ref 165* 207* 238* pn 000414 automatic char(256) unaligned dcl 313 set ref 327* 328* 329 329 329 329 pu defined structure array level 1 unaligned dcl 1-137 set ref 166 166 208 208 239 239 retval 000355 automatic fixed bin(35,0) dcl 110 set ref 156* 178* 188* 199* 219* 229* 246* shortinfo 000322 automatic char(8) dcl 107 set ref 403* sip defined pointer dcl 1-166 set ref 129* some_not_found 000177 automatic bit(1) unaligned dcl 82 set ref 317* 319* 332* 337* 355* 362* 370 381 sort_cleanup_work 000066 constant entry external dcl 51 ref 423 sort_code parameter fixed bin(35,0) dcl 14 set ref 10 117* 126* 151* 158* 160* 181* 191* 202* 222* 232* 249* 259 262 sort_commence$commence 000062 constant entry external dcl 49 ref 197 sort_desc parameter pointer array dcl 14 set ref 10 137* 259 sort_ext$curr_input_file_attach 000074 external static char(256) unaligned dcl 1-21 ref 174 174 sort_ext$curr_input_file_name 000076 external static char(256) unaligned dcl 1-24 set ref 172* 172 174 174 sort_ext$curr_input_file_num 000100 external static fixed bin(17,0) dcl 1-27 set ref 173* 173 sort_ext$debug_sw 000102 external static bit(1) unaligned dcl 1-36 set ref 124* 124 413 413 sort_ext$in_buff_ptr 000110 external static pointer dcl 1-64 set ref 130* 130 400 400 401 401 416 416 416 416 421 421 421 421 sort_ext$input_driver_is_sort 000104 external static bit(1) unaligned dcl 1-45 ref 170 170 318 318 sort_ext$input_record_exit_sw 000106 external static fixed bin(1,0) dcl 1-55 ref 377 377 sort_ext$mii 000112 external static fixed bin(17,0) dcl 1-98 set ref 128* 128 sort_ext$output_driver_is_sort 000114 external static bit(1) unaligned dcl 1-116 ref 213 213 sort_ext$pu 000116 external static structure array level 1 unaligned dcl 1-134 ref 166 166 166 166 166 166 166 166 208 208 208 208 208 208 208 208 239 239 239 239 239 239 239 239 sort_ext$sip 000120 external static pointer dcl 1-165 set ref 129* 129 sort_ext$state 000122 external static fixed bin(17,0) dcl 1-192 set ref 120* 120 254* 254 261* 261 271 271 271 271 424* 424 sort_ext$time_info 000124 external static structure array level 1 unaligned dcl 1-198 set ref 164* 164 165 165 165 165 165 165 206* 206 207 207 207 207 207 207 237* 237 238 238 238 238 238 238 sort_ext$time_sw 000126 external static bit(1) unaligned dcl 1-209 set ref 123* 123 163 163 205 205 236 236 sort_ext$unique_prefix 000132 external static char(16) unaligned dcl 1-215 set ref 275* 275 400 400 404 404 sort_ext$user_out_sw 000130 external static char(32) unaligned dcl 1-212 ref 393 393 393 393 404 404 404 404 sort_ext$whoami 000134 external static char(6) unaligned dcl 1-227 set ref 156 156 178 178 188 188 199 199 219 219 229 229 246 246 271 271 274* 274 393 393 404 404 sort_initiate$initiate_private 000054 constant entry external dcl 45 ref 147 sort_input_exit 000204 automatic entry variable dcl 87 set ref 137* 186 sort_input_proc 000056 constant entry external dcl 47 ref 175 sort_merge_print_report 000072 constant entry external dcl 56 ref 243 sort_merge_subroutine 000070 constant entry external dcl 52 ref 137 sort_merge_terminate$terminate 000064 constant entry external dcl 49 ref 244 sort_output_exit 000210 automatic entry variable dcl 87 set ref 137* 227 sort_output_proc 000060 constant entry external dcl 47 ref 216 state defined fixed bin(17,0) dcl 1-193 set ref 120* 254* 261* 271 271 424* state_code parameter fixed bin(35,0) dcl 270 in procedure "state_test" set ref 269 276* 279* state_code 000214 automatic fixed bin(35,0) dcl 90 in procedure "sort_sort" set ref 115* 116 string_size_par parameter fixed bin(35,0) dcl 14 ref 259 265 string_size_temp 000170 automatic fixed bin(35,0) dcl 71 set ref 122* 147* 265* sub_err_ 000046 constant entry external dcl 41 ref 156 178 188 199 219 229 246 temp_dir parameter char unaligned dcl 14 ref 10 135 259 temp_dir_temp 000100 automatic char(168) unaligned dcl 71 set ref 135* 147* temp_sd_int 000200 automatic pointer initial dcl 84 set ref 84* 131* 137* 415 415* 420 420* temp_sd_lex 000202 automatic pointer initial dcl 84 set ref 84* 131* 137* 414 414* 419 419* time_info defined structure array level 1 unaligned dcl 1-203 time_sw defined bit(1) unaligned dcl 1-210 set ref 123* 163 205 236 translator_temp_$release_segment 000050 constant entry external dcl 42 ref 414 type 000310 automatic fixed bin(2,0) dcl 99 set ref 335* 336 339 unique_chars_ 000052 constant entry external dcl 43 ref 275 unique_prefix defined char(16) unaligned dcl 1-216 set ref 275* 400 404* user_out_sw defined char(32) unaligned dcl 1-213 set ref 393 393* 404 404* user_out_sw_par parameter char unaligned dcl 14 ref 10 134 259 user_out_sw_temp 000156 automatic char(32) unaligned dcl 71 set ref 134* 137* 147* vtime 2 defined fixed bin(71,0) array level 2 dcl 1-203 set ref 165* 207* 238* whoami defined char(6) unaligned dcl 1-228 set ref 156* 178* 188* 199* 219* 229* 246* 271 274* 393* 404* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. acl defined structure array level 1 unaligned dcl 1-6 b defined fixed bin(30,0) array dcl 1-13 compare_sw defined fixed bin(1,0) dcl 1-19 compares_counter defined fixed bin(34,0) dcl 1-16 curr_output_file_attach defined char(256) unaligned dcl 1-31 curr_output_file_name defined char(256) unaligned dcl 1-34 disaster2 defined fixed bin(17,0) dcl 1-40 dt defined fixed bin(30,0) array dcl 1-43 input_file_exit_sw defined bit(1) unaligned dcl 1-49 input_file_max defined fixed bin(17,0) dcl 1-53 input_rec_deleted defined fixed bin(30,0) dcl 1-59 input_rec_inserted defined fixed bin(30,0) dcl 1-62 leng defined fixed bin(30,0) array dcl 1-68 max1 defined fixed bin(30,0) dcl 1-71 max2 defined fixed bin(30,0) dcl 1-74 max3 defined fixed bin(30,0) dcl 1-77 max4 defined fixed bin(30,0) dcl 1-80 max_rec_length defined fixed bin(30,0) dcl 1-84 merge_compares defined fixed bin(34,0) dcl 1-87 merge_in_iocb_ptrs defined pointer array dcl 1-90 merge_input_file_attaches defined char(256) array unaligned dcl 1-93 merge_input_file_names defined char(256) array unaligned dcl 1-96 min_rec_length defined fixed bin(30,0) dcl 1-102 mip defined fixed bin(30,0) array dcl 1-105 msp defined pointer array dcl 1-108 no_of_keys defined fixed bin(30,0) dcl 1-111 old_input_file_num defined fixed bin(17,0) dcl 1-114 output_file_exit_sw defined bit(1) unaligned dcl 1-120 output_rec_deleted defined fixed bin(30,0) dcl 1-123 output_rec_inserted defined fixed bin(30,0) dcl 1-126 output_record_exit_sw defined fixed bin(1,0) dcl 1-129 presort_compares defined fixed bin(34,0) dcl 1-132 read_count defined fixed bin(30,0) dcl 1-142 rec_ptr_a defined pointer dcl 1-145 rec_ptr_b defined pointer dcl 1-148 release_count defined fixed bin(30,0) dcl 1-151 report_sw defined bit(2) unaligned dcl 1-154 return_count defined fixed bin(30,0) dcl 1-157 rev defined fixed bin(1,0) array dcl 1-160 sii defined fixed bin(30,0) dcl 1-163 sort_desc_pn defined char(168) unaligned dcl 1-171 sort_ext$acl external static structure array level 1 unaligned dcl 1-1 sort_ext$b external static fixed bin(30,0) array dcl 1-12 sort_ext$compare_sw external static fixed bin(1,0) dcl 1-18 sort_ext$compares_counter external static fixed bin(34,0) dcl 1-15 sort_ext$curr_output_file_attach external static char(256) unaligned dcl 1-30 sort_ext$curr_output_file_name external static char(256) unaligned dcl 1-33 sort_ext$disaster2 external static fixed bin(17,0) dcl 1-39 sort_ext$dt external static fixed bin(30,0) array dcl 1-42 sort_ext$input_file_exit_sw external static bit(1) unaligned dcl 1-48 sort_ext$input_file_max external static fixed bin(17,0) dcl 1-51 sort_ext$input_rec_deleted external static fixed bin(30,0) dcl 1-58 sort_ext$input_rec_inserted external static fixed bin(30,0) dcl 1-61 sort_ext$leng external static fixed bin(30,0) array dcl 1-67 sort_ext$max1 external static fixed bin(30,0) dcl 1-70 sort_ext$max2 external static fixed bin(30,0) dcl 1-73 sort_ext$max3 external static fixed bin(30,0) dcl 1-76 sort_ext$max4 external static fixed bin(30,0) dcl 1-79 sort_ext$max_rec_length external static fixed bin(30,0) dcl 1-82 sort_ext$merge_compares external static fixed bin(34,0) dcl 1-86 sort_ext$merge_in_iocb_ptrs external static pointer array dcl 1-89 sort_ext$merge_input_file_attaches external static char(256) array unaligned dcl 1-92 sort_ext$merge_input_file_names external static char(256) array unaligned dcl 1-95 sort_ext$min_rec_length external static fixed bin(30,0) dcl 1-101 sort_ext$mip external static fixed bin(30,0) array dcl 1-104 sort_ext$msp external static pointer array dcl 1-107 sort_ext$no_of_keys external static fixed bin(30,0) dcl 1-110 sort_ext$old_input_file_num external static fixed bin(17,0) dcl 1-113 sort_ext$output_file_exit_sw external static bit(1) unaligned dcl 1-119 sort_ext$output_rec_deleted external static fixed bin(30,0) dcl 1-122 sort_ext$output_rec_inserted external static fixed bin(30,0) dcl 1-125 sort_ext$output_record_exit_sw external static fixed bin(1,0) dcl 1-128 sort_ext$presort_compares external static fixed bin(34,0) dcl 1-131 sort_ext$read_count external static fixed bin(30,0) dcl 1-141 sort_ext$rec_ptr_a external static pointer dcl 1-144 sort_ext$rec_ptr_b external static pointer dcl 1-147 sort_ext$release_count external static fixed bin(30,0) dcl 1-150 sort_ext$report_sw external static bit(2) unaligned dcl 1-153 sort_ext$return_count external static fixed bin(30,0) dcl 1-156 sort_ext$rev external static fixed bin(1,0) array dcl 1-159 sort_ext$sii external static fixed bin(30,0) dcl 1-162 sort_ext$sort_compare_exit external static entry variable dcl 1-168 sort_ext$sort_desc_pn external static char(168) unaligned dcl 1-170 sort_ext$sort_input_record_exit external static entry variable dcl 1-173 sort_ext$sort_output_record_exit external static entry variable dcl 1-178 sort_ext$srp external static pointer dcl 1-183 sort_ext$ssi external static fixed bin(30,0) dcl 1-186 sort_ext$ssp external static pointer dcl 1-189 sort_ext$terminate_print_sw external static bit(1) unaligned dcl 1-195 sort_ext$w external static fixed bin(30,0) array dcl 1-218 sort_ext$wf_dir_name external static char(168) dcl 1-221 sort_ext$wf_full_name external static char(168) unaligned dcl 1-224 sort_ext$write_count external static fixed bin(30,0) dcl 1-230 sort_input_record_exit defined entry variable dcl 1-175 sort_output_record_exit defined entry variable dcl 1-180 srp defined pointer dcl 1-184 ssi defined fixed bin(30,0) dcl 1-187 ssp defined pointer dcl 1-190 terminate_print_sw defined bit(1) unaligned dcl 1-196 w defined fixed bin(30,0) array dcl 1-219 wf_dir_name defined char(168) dcl 1-222 wf_full_name defined char(168) unaligned dcl 1-225 write_count defined fixed bin(30,0) dcl 1-231 NAMES DECLARED BY EXPLICIT CONTEXT. cleanup_proc 003140 constant entry internal dcl 411 ref 133 252 common_start 000316 constant label dcl 126 ref 266 create_in_buff 002776 constant entry internal dcl 399 ref 141 exit 001607 constant label dcl 252 ref 152 161 182 192 203 223 233 250 file_too_large 002741 constant entry internal dcl 392 ref 341 348 scan_for_pn_or_attach 002000 constant entry internal dcl 285 ref 174 328 set_file_size 002141 constant entry internal dcl 310 ref 143 sort_private 001626 constant entry external dcl 259 sort_sort 000241 constant entry external dcl 10 state_test 001701 constant entry internal dcl 269 ref 115 NAMES DECLARED BY CONTEXT OR IMPLICATION. addr builtin function ref 166 166 208 208 239 239 329 329 329 329 329 329 before builtin function ref 275 352 dimension builtin function ref 170 divide builtin function ref 344 357 388 hbound builtin function ref 324 index builtin function ref 271 lbound builtin function ref 172 324 length builtin function ref 290 294 297 329 329 max builtin function ref 381 null builtin function ref 84 84 129 130 131 156 156 178 178 188 188 199 199 219 219 229 229 246 246 354 401 414 415 416 419 420 421 substr builtin function ref 290 294 297 300 300 301 304 304 305 325 325 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 4140 4304 3345 4150 Length 4632 3345 144 311 573 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME sort_sort 658 external procedure is an external procedure. on unit on line 133 64 on unit state_test internal procedure shares stack frame of external procedure sort_sort. scan_for_pn_or_attach internal procedure shares stack frame of external procedure sort_sort. set_file_size internal procedure shares stack frame of external procedure sort_sort. file_too_large internal procedure shares stack frame of external procedure sort_sort. create_in_buff internal procedure shares stack frame of external procedure sort_sort. cleanup_proc 80 internal procedure is called by several nonquick procedures. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME cleanup_proc 000100 code cleanup_proc sort_sort 000100 temp_dir_temp sort_sort 000152 keys_ptr sort_sort 000154 exits_ptr sort_sort 000156 user_out_sw_temp sort_sort 000166 code sort_sort 000167 merge_order_temp sort_sort 000170 string_size_temp sort_sort 000172 file_size_user_val sort_sort 000174 file_size_computed sort_sort 000176 file_size_pass sort_sort 000177 some_not_found sort_sort 000200 temp_sd_int sort_sort 000202 temp_sd_lex sort_sort 000204 sort_input_exit sort_sort 000210 sort_output_exit sort_sort 000214 state_code sort_sort 000215 arg_err_sw sort_sort 000216 fatal_sw sort_sort 000217 j sort_sort 000220 hcs_code sort_sort 000221 expand_code sort_sort 000222 in_dir sort_sort 000274 in_ename sort_sort 000304 in_bit_count sort_sort 000306 in_ptr sort_sort 000310 type sort_sort 000311 component sort_sort 000321 comp_len sort_sort 000322 shortinfo sort_sort 000324 longinfo sort_sort 000355 retval sort_sort 000402 j scan_for_pn_or_attach 000403 k scan_for_pn_or_attach 000412 i set_file_size 000413 j set_file_size 000414 pn set_file_size 000514 att set_file_size THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_cs cat_realloc_cs call_var call_ext_out_desc call_ext_out call_int_this call_int_other return fl2_to_fx2 enable shorten_stack ext_entry_desc int_entry real_to_real_rd real_to_real_tr divide_fx1 THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. clock_ convert_status_code_ cpu_time_and_paging_ decimal_exp_ expand_path_ get_pdir_ hcs_$delentry_seg hcs_$get_process_usage hcs_$initiate_count hcs_$make_seg hcs_$status_minf hcs_$truncate_seg hmu ioa_$ioa_stream ioa_$rsnnl sort_cleanup_work sort_commence$commence sort_initiate$initiate_private sort_input_proc sort_merge_print_report sort_merge_subroutine sort_merge_terminate$terminate sort_output_proc sub_err_ translator_temp_$release_segment unique_chars_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$bad_arg error_table_$fatal_error error_table_$out_of_sequence sort_ext$curr_input_file_attach sort_ext$curr_input_file_name sort_ext$curr_input_file_num sort_ext$debug_sw sort_ext$in_buff_ptr sort_ext$input_driver_is_sort sort_ext$input_record_exit_sw sort_ext$mii sort_ext$output_driver_is_sort sort_ext$pu sort_ext$sip sort_ext$state sort_ext$time_info sort_ext$time_sw sort_ext$unique_prefix sort_ext$user_out_sw sort_ext$whoami LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 84 000226 10 000233 115 000274 116 000276 117 000300 118 000304 120 000305 121 000310 122 000311 123 000312 124 000314 125 000315 126 000316 128 000320 129 000322 130 000324 131 000325 133 000330 134 000352 135 000360 137 000365 141 000446 142 000447 143 000505 147 000506 150 000553 151 000563 152 000567 154 000570 155 000572 156 000575 158 000637 159 000643 160 000644 161 000646 163 000647 164 000654 165 000663 166 000677 170 000713 172 000735 173 000760 174 000762 175 000775 176 001004 177 001006 178 001011 181 001053 182 001057 184 001060 186 001063 187 001071 188 001073 191 001140 192 001144 197 001145 198 001154 199 001156 202 001223 203 001227 205 001230 206 001235 207 001244 208 001260 209 001274 213 001301 216 001306 217 001314 218 001316 219 001321 222 001363 223 001367 225 001370 227 001371 228 001377 229 001401 232 001446 233 001452 236 001453 237 001460 238 001467 239 001503 243 001517 244 001524 245 001533 246 001535 249 001602 250 001606 252 001607 254 001613 255 001616 259 001617 261 001661 262 001664 263 001672 264 001674 265 001676 266 001700 269 001701 271 001703 274 001722 275 001726 276 001770 277 001773 279 001774 280 001776 282 001777 285 002000 289 002016 290 002020 291 002032 292 002033 293 002034 294 002036 295 002050 296 002051 297 002052 298 002064 299 002065 300 002066 301 002077 302 002110 303 002115 304 002116 305 002126 307 002140 310 002141 317 002142 318 002143 319 002147 320 002151 321 002153 323 002154 324 002156 325 002167 327 002213 328 002217 329 002222 331 002251 332 002253 333 002255 335 002256 336 002315 337 002321 338 002323 339 002324 340 002326 341 002355 342 002356 344 002357 345 002365 346 002366 347 002375 348 002424 349 002425 351 002426 352 002454 354 002550 355 002555 356 002557 357 002560 359 002566 361 002570 362 002571 363 002573 369 002575 370 002601 372 002610 375 002653 377 002654 381 002665 384 002700 388 002704 389 002740 392 002741 393 002742 395 002773 396 002775 399 002776 400 002777 401 003054 402 003061 403 003063 404 003075 408 003136 411 003137 413 003145 414 003150 415 003165 416 003203 417 003220 419 003221 420 003241 421 003262 423 003302 424 003307 425 003312 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved