COMPILATION LISTING OF SEGMENT sort_merge_subroutine Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/11/82 1308.3 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* *********************************************************** */ 6 7 /* *************************************** 8* * * 9* * * 10* * Copyright (c) 1975, 1976 by * 11* * Honeywell Information Systems, Inc. * 12* * * 13* * * 14* *************************************** */ 15 sort_merge_subroutine: proc(input_file, output_file, sort_desc, user_out_sw_par, 16 sort_input_exit, sort_output_exit, arg_err_sw, fatal_sw, 17 keys_ptr, exits_ptr, 18 temp_sd_lex, temp_sd_int); 19 20 /* PARAMETERS */ 21 dcl (input_file(*) char(*), /* Input file specs (Input) */ 22 output_file char(*), /* Output file spec (Input) */ 23 sort_desc(*) ptr, /* Sort/Merge Description (Input) */ 24 user_out_sw_par char(*), /* Switchname for Sort Report (Input) */ 25 sort_code fixed bin(35), /* Error code (Output) */ 26 sort_input_exit entry(fixed bin(35)) variable, /* User input_file proc (Output) */ 27 sort_output_exit entry(fixed bin(35)) variable, /* User output_file proc(Output) */ 28 arg_err_sw bit(1), /* Error(s) in arguments (Output) */ 29 fatal_sw bit(1), /* Fatal error encountered (Output) */ 30 keys_ptr ptr, /* Keys structure (Output) */ 31 exits_ptr ptr, /* Exits structure(Output) */ 32 temp_sd_int ptr , /* Temporary segment for lex_string_ (Output) */ 33 temp_sd_lex ptr ) parameter; /* Temporary segment for S/M.D. internal form (Output) */ 34 35 /* EXTERNAL ENTRIES */ 36 dcl check_star_name_$entry entry(char(*) aligned, fixed bin(35)); 37 dcl convert_status_code_ entry(fixed bin(35), char(8) aligned, char(100) aligned); 38 dcl expand_path_ entry(ptr, fixed bin, ptr, ptr, fixed bin(35)); 39 dcl get_equal_name_ entry(char(*) aligned, char(*) aligned, char(32) aligned, fixed bin(35)); 40 dcl get_pdir_ entry returns(char(168) aligned); 41 dcl hcs_$make_seg entry(char(*) aligned, char(*) aligned, char(*), fixed bin(5), ptr, fixed bin(35)), 42 hcs_$truncate_seg entry(ptr, fixed bin(24), fixed bin(35)), 43 hcs_$set_bc_seg entry(ptr, fixed bin(24), fixed bin(35)), 44 hcs_$status_mins entry(ptr, fixed bin(2), fixed bin(24), fixed bin(35)); 45 dcl ioa_$ioa_stream entry options(variable), 46 ioa_$rsnnl entry options(variable); 47 dcl sub_err_ entry options(variable); 48 dcl translator_temp_$get_segment entry(char(*) aligned, ptr, fixed bin(35)); 49 50 dcl sort_convert_internal entry(ptr, ptr, ptr, ptr, ptr, ptr, fixed bin(24), fixed bin(24), fixed bin(35)); 51 52 /* EXTERNAL STATIC */ 53 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); 54 55 56 dcl (error_table_$pathlong, 57 error_table_$out_of_sequence, 58 error_table_$dirseg) external static fixed bin(35); 59 60 /* INTERNAL STATIC (constants only) */ 61 dcl (on init("1"b), 62 off init("0"b) ) bit(1) internal static; 63 dcl io_exits_version_max fixed bin init(1) internal static; /* Currently only 1 version. */ 64 65 /* AUTOMATIC AND BASED */ 66 dcl user_out_sw_temp char(8); 67 68 dcl source_sort_desc ptr; 69 dcl seg_type fixed bin(2), 70 bit_count fixed bin(24), 71 seg_length fixed bin(24); 72 73 dcl convert_int_code fixed bin(35), 74 verify_input_files_code fixed bin(35); 75 76 2 1 /* Sort Description, internal format. */ 2 2 2 3 dcl 1 keys based(work_ptr), 2 4 2 version fixed bin init(1), 2 5 2 number fixed bin, 2 6 2 key_desc(0 refer(keys.number)), 2 7 3 datatype char(8), 2 8 3 len fixed bin(24), 2 9 3 word_offset fixed bin(18), 2 10 3 bit_offset fixed bin(6), 2 11 3 rv char(3), 2 12 2 dummy fixed bin(71); 2 13 2 14 dcl 1 io_exits based(work_ptr), 2 15 2 version fixed bin init(1), 2 16 2 input_file_exit entry, 2 17 2 output_file_exit entry, 2 18 2 dummy fixed bin(71); 2 19 2 20 dcl 1 exits based(work_ptr), 2 21 2 version fixed bin init(1), 2 22 2 compare_exit entry, 2 23 2 input_record_exit entry, 2 24 2 output_record_exit entry, 2 25 2 dummy fixed bin(71); 2 26 77 78 dcl io_exits_ptr ptr, 79 work_ptr ptr, 80 filesize float bin(27); 81 82 dcl hcs_code fixed bin(35); 83 dcl expand_code fixed bin(35); 84 dcl check_star_code fixed bin(35); 85 dcl equal_code fixed bin(35); 86 87 dcl in_dir char(168) aligned, 88 in_ename char(32) aligned, 89 first_in_ename char(32) aligned, 90 first_in_kw char(32), 91 first_in_pathname char(256), 92 res_dir char(168) aligned, 93 equal_name char(32) aligned, 94 res_ename char(32) aligned, 95 in_bit_count fixed bin(24), 96 in_ptr ptr, 97 type fixed bin(2), 98 component char(32) aligned, 99 comp_len fixed bin(17); 100 101 dcl shortinfo char(8) aligned, 102 longinfo char(100) aligned; 103 104 dcl retval fixed bin(35); 105 106 /* Start */ 107 108 if user_out_sw_par = "" then user_out_sw = "user_output"; 109 else if user_out_sw_par = "-bf" | user_out_sw_par = "-brief" then user_out_sw = ""; 110 else user_out_sw = user_out_sw_par; 111 fatal_sw = off; 112 keys_ptr, 113 io_exits_ptr, 114 exits_ptr = null(); 115 if dimension(sort_desc, 1) = 1 then do; 116 source_sort_desc = sort_desc(lbound(sort_desc, 1)); 117 call sd_is_source; 118 end; 119 else if dimension(sort_desc, 1) = 2 & substr(whoami, 1, 5) = "merge" then do; 120 keys_ptr = sort_desc(lbound(sort_desc, 1) + 0); 121 exits_ptr = sort_desc(lbound(sort_desc, 1) + 1); 122 end; 123 else if dimension(sort_desc, 1) = 3 & substr(whoami, 1, 4) = "sort" then do; 124 keys_ptr = sort_desc(lbound(sort_desc, 1) + 0); 125 exits_ptr = sort_desc(lbound(sort_desc, 1) + 1); 126 io_exits_ptr = sort_desc(lbound(sort_desc, 1) + 2); 127 end; 128 else do; 129 arg_err_sw = on; 130 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 131 "^a: ^a Description argument has an array dimension of ^d. Must be 1 or ^d.", 132 whoami, caps(whoami), dimension(sort_desc, 1), extent_sd()); 133 end; 134 /* Following calls must be done in sequence, so inter-relationships can be checked. */ 135 call check_io_exits; 136 call process_input_par; 137 call process_output_par; 138 user_out_sw_temp = user_out_sw_par; 139 read_count, 140 write_count = 0; 141 input_rec_deleted, /* Not used by Merge. */ 142 input_rec_inserted, /* Not used by Merge. */ 143 output_rec_deleted, 144 output_rec_inserted = 0; 145 146 return; /* to caller (sort_ or merge_) */ 147 148 149 150 extent_sd: proc returns(fixed bin); 151 if substr(whoami, 1, 4) = "sort" then return(3); 152 else return(2); 153 end extent_sd; 154 155 156 sd_is_source: proc; 157 call hcs_$status_mins(source_sort_desc, seg_type, bit_count, hcs_code); /* Get bit count. */ 158 if seg_type = 2 then hcs_code = error_table_$dirseg; /* Must not be a directory. */ 159 if hcs_code ^= 0 then do; 160 fatal_sw = on; 161 call convert_status_code_(hcs_code, shortinfo, longinfo); 162 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 163 "^a: ^a ^a Description pathname ^a", 164 whoami, longinfo, caps(whoami), sort_desc_pn); 165 return; 166 end; 167 /* Convert S.D. to internal form. */ 168 call translator_temp_$get_segment((whoami), temp_sd_lex, hcs_code); 169 if temp_sd_lex = null() then do; 170 call unable_error("create", "sort_lex_"); 171 return; 172 end; 173 call hcs_$make_seg(get_pdir_(), unique_prefix||"sort_par_int_", 174 "", 8+2 /* rw */, temp_sd_int, hcs_code); 175 /* ?? Test for error_table_$segknown ?? */ 176 if temp_sd_int = null() then do; 177 call unable_error("create", "sort_par_int_"); 178 return; 179 end; 180 call sort_convert_internal(source_sort_desc, temp_sd_int, temp_sd_lex, keys_ptr, io_exits_ptr, exits_ptr, 181 bit_count, seg_length, convert_int_code); 182 if convert_int_code ^= 0 then do; 183 /* Error; cannot use Sort/Merge Description internal format. */ 184 arg_err_sw = on; 185 return; 186 end; 187 call hcs_$truncate_seg(temp_sd_int, seg_length, hcs_code); 188 if hcs_code ^= 0 then do; 189 call unable_error("truncate", "sort_par_int_"); 190 return; 191 end; 192 call hcs_$set_bc_seg(temp_sd_int, seg_length*36, hcs_code); 193 if hcs_code ^= 0 then do; 194 call unable_error("set bit count for", "sort_par_int_"); 195 return; 196 end; 197 end sd_is_source; 198 199 200 check_io_exits: proc; /* Validate io_exits structure. */ 201 if io_exits_ptr = null() then return; 202 work_ptr = io_exits_ptr; 203 if io_exits.version < 0 | io_exits.version > io_exits_version_max then do; 204 arg_err_sw = on; 205 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 206 "^a: IO_exits structure has invalid version number ^d. Must be > 0 and <_ ^d.", 207 whoami, io_exits.version, io_exits_version_max); 208 io_exits_ptr = null(); /* to protect process_input_par & process_output_par */ 209 end; 210 else if substr(whoami, 1, 5) = "merge" then do; 211 /* Reject input_file, output_file exits for Merge. */ 212 io_exits_ptr = null(); /* To protect process_input_par, process_output_par, & merge_. */ 213 arg_err_sw = on; 214 if io_exits.input_file_exit ^= noexit then do; 215 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 216 "^a: Input_file exit not permitted.", whoami); 217 end; 218 if io_exits.output_file_exit ^= noexit then do; 219 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 220 "^a: Output_file exit not permitted.", whoami); 221 end; 222 end; 223 end check_io_exits; 224 225 226 process_input_par: proc; 227 /* Set driver to user's or sort's (merge's) input procedure. 228* Check invalid input file specifications. 229* Check for and reject star convention. 230* Error if input file specification(s) and user's exit both are present, 231* or if neither is present. */ 232 dcl kw_index fixed bin(17); 233 dcl w2_index fixed bin(17); 234 if input_file(lbound(input_file, 1)) = "" then do; /* user did not supply input file specifications. */ 235 input_driver_is_sort = off; 236 end; 237 else do; /* user did supply input file specifications. */ 238 call verify_input_files(verify_input_files_code); /* Validate input_file array. */ 239 if verify_input_files_code = 1 then do; 240 arg_err_sw = on; 241 end; 242 input_driver_is_sort = on; 243 end; 244 if io_exits_ptr = null() then /* user did not supply io_exits structure. */ 245 do; 246 sort_input_exit = noexit; 247 end; 248 else /* user did supply io_exits structure. */ 249 do; 250 /* io_exits structure already verified by check_io_exits. */ 251 sort_input_exit = io_exits_ptr->io_exits.input_file_exit; 252 end; 253 if input_file(lbound(input_file, 1)) = "" & sort_input_exit = noexit then 254 do; 255 if substr(whoami, 1, 4) = "sort" then do; 256 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 257 "^a: Neither input file(s) nor user input_file exit procedure specified.", 258 whoami); 259 end; 260 else if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 261 "^a: No input file(s) specified.", 262 whoami); 263 arg_err_sw = on; 264 end; 265 if input_file(lbound(input_file, 1)) ^= "" & input_file_exit_sw = on then do; 266 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 267 "^a: Both input file(s) and user input_file exit procedure specified.", 268 whoami); 269 arg_err_sw = on; 270 /* Driver would use input file specifications since input_driver_is_sort switch is on. */ 271 end; 272 273 verify_input_files: proc(code); 274 /* Validate form of input_file array: */ 275 dcl code fixed bin(35) parameter; 276 dcl i fixed bin(17); 277 278 code = 0; 279 if dimension(input_file, 1) > input_file_max then do; 280 code = 1; 281 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 282 "^a: Invalid number of input files ^d. Must be <_ ^d.", 283 whoami, dimension(input_file, 1), input_file_max); 284 end; 285 first_in_ename = ""; /* Initialize for process_equal. */ 286 do i = lbound(input_file, 1) to hbound(input_file, 1); 287 call scan_file_spec(input_file(i), kw_index, w2_index); 288 if i = lbound(input_file, 1) then first_in_kw = before(substr(input_file(i), kw_index), " "); 289 if substr(input_file(i), kw_index, 4) = "-if " 290 | substr(input_file(i), kw_index, 12) = "-input_file " then do; 291 /* Reject star convention if used. */ 292 in_ename = ""; /* Initialize. */ 293 call expand_path_(addr(substr(input_file(i), w2_index)), length(substr(input_file(i), w2_index)), 294 addr(in_dir), addr(in_ename), expand_code); 295 if expand_code ^= 0 then do; 296 call convert_status_code_(expand_code, shortinfo, longinfo); 297 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 298 "^a: ^a Checking star convention for input file ^d, pathname ^a", 299 whoami, longinfo, i, substr(input_file(i), w2_index)); 300 arg_err_sw = on; 301 end; 302 if in_ename ^= "" then do; 303 /* Check * convention and indicate error. */ 304 call check_star_name_$entry(in_ename, check_star_code); 305 if check_star_code ^= 0 then do; 306 arg_err_sw = on; 307 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 308 "^a: Star convention not allowed. Input file ^d, pathname ^a", 309 whoami, i, substr(input_file(i), w2_index)); 310 end; 311 end; 312 if i = lbound(input_file, 1) then do; 313 first_in_ename = in_ename; /* Used by process_equal. */ 314 first_in_pathname = substr(input_file(i), w2_index); /* Used by process_equal */ 315 end; 316 end; 317 else if substr(input_file(i),kw_index, 5) = "-ids " 318 |substr(input_file(i), kw_index, 19) = "-input_description " then do; 319 end; 320 else do; /* Error. */ 321 arg_err_sw = on; 322 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 323 "^a: Invalid input file specification ^a for input file ^d.", 324 whoami, (input_file(i)), i); 325 end; 326 end; /* of do i = lbound ... */ 327 end verify_input_files; 328 329 330 end process_input_par; 331 332 333 334 335 process_output_par: proc; 336 /* Set driver to user's or sort's (merge's) output procedure. 337* Check for invalid output file specification. 338* Check -replace; process equals convention. 339* Error if output file specification and user's exit both are present, 340* or if neither is present. */ 341 dcl (kw_index, w2_index) fixed bin(17); 342 if output_file = "" then do; /* user did not supply output file specification. */ 343 output_driver_is_sort = off; 344 end; 345 else do; /* user did supply output file specification. */ 346 output_driver_is_sort = on; 347 call scan_file_spec(output_file, kw_index, w2_index); 348 if substr(output_file, kw_index, 4) = "-of " 349 | substr(output_file, kw_index, 13) = "-output_file " then do; 350 curr_output_file_name = substr(output_file, w2_index); 351 curr_output_file_attach = ""; 352 if substr(output_file, w2_index) = "-rp" 353 | substr(output_file, w2_index) = "-replace" then do; 354 if input_file(lbound(input_file, 1)) = "" then do; 355 arg_err_sw = on; 356 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 357 "^a: Output file specification is ^a but no input file was specified.", 358 whoami, output_file); 359 end; 360 if first_in_kw = "-ids" | first_in_kw = "-input_description" then do; 361 arg_err_sw = on; 362 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 363 "^a: Output file specification is ^a but first input file specification is an attach description.", 364 whoami, output_file); 365 end; 366 if substr(whoami, 1, 5) = "merge" then do; 367 arg_err_sw = on; 368 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 369 "^a: Output file specification ^a not permitted.", 370 whoami, output_file); 371 end; 372 curr_output_file_name = first_in_pathname; 373 end; 374 else do; /* Is still -of but is not -rp. */ 375 call process_equal(curr_output_file_name); 376 end; 377 end; /* of being -of specification. */ 378 else if substr(output_file, kw_index, 5) = "-ods " 379 | substr(output_file, kw_index, 20) = "-output_description " then do; 380 curr_output_file_name = ""; 381 curr_output_file_attach = substr(output_file, w2_index); 382 end; 383 else do; /* Error. */ 384 arg_err_sw = on; 385 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 386 "^a: Invalid output file specification ^a", 387 whoami, output_file); 388 end; 389 end; 390 if io_exits_ptr = null() then /* user did not supply io_exits structure. */ 391 do; 392 sort_output_exit = noexit; 393 end; 394 else /* user did supply io_exits structure. */ 395 do; 396 /* io_exits structure already validated by check_io_exits. */ 397 sort_output_exit = io_exits_ptr->io_exits.output_file_exit; 398 end; 399 if output_file = "" & sort_output_exit = noexit then 400 do; 401 if substr(whoami, 1, 4) = "sort" then do; 402 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 403 "^a: Neither output file nor user output_file exit procedure specified.", 404 whoami); 405 end; 406 else if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 407 "^a: No output file specified.", 408 whoami); 409 arg_err_sw = on; 410 end; 411 if output_file ^= "" & output_file_exit_sw = on then do; 412 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 413 "^a: Both output file and user output_file exit procedure specified.", 414 whoami); 415 arg_err_sw = on; 416 end; 417 end process_output_par; 418 419 420 scan_file_spec: proc(file_spec, kw_par, w2_par); 421 dcl (file_spec char(*), 422 kw_par fixed bin(17), 423 w2_par fixed bin(17) ) parameter; 424 kw_par, w2_par = 1; 425 do while(substr(file_spec, w2_par, 1) = " " & w2_par < length(file_spec)); 426 w2_par = w2_par + 1; 427 end; 428 kw_par = w2_par; 429 do while(substr(file_spec, w2_par, 1) ^= " " & w2_par < length(file_spec)); 430 w2_par = w2_par + 1; 431 end; 432 do while(substr(file_spec, w2_par, 1) = " " & w2_par < length(file_spec)); 433 w2_par = w2_par + 1; 434 end; 435 end scan_file_spec; 436 437 438 process_equal: proc(res_pn); 439 /* Process equals convention, for output file pathname against first input file pathname */ 440 dcl res_pn char(*) parameter; /* path name */ 441 /* Exit if first input_file entry name is blank. */ 442 if input_file(lbound(input_file, 1)) = "" | first_in_ename = "" then return; 443 /* Also exit if there is an attach for the first input file. */ 444 if first_in_kw = "-ids" | first_in_kw = "-input_description" then return; 445 equal_name = ""; /* Initialize. */ 446 call expand_path_(addr(res_pn), length(res_pn), 447 addr(res_dir), addr(equal_name), expand_code); 448 if expand_code ^= 0 then do; 449 call expand_err(expand_code, "output file", res_pn); 450 return; 451 end; 452 if equal_name = "" then return; /* Return if no entry name to process equals convention on */ 453 equal_code = 0; /* get_equal_name_ sometimes forgets to clear status code */ 454 call get_equal_name_(first_in_ename, equal_name, res_ename, equal_code); 455 if equal_code ^= 0 then 456 do; 457 call equal_err(equal_code, "output file", equal_name); 458 return; 459 end; 460 if (index(res_dir, " ") = 0 & index(res_ename, " ") = 0) 461 /* Neither res_dir nor res_ename contains a space */ 462 | (index(res_dir, " ") - 1 + index(res_ename, " ") - 1 + 1) >= 168 then do; 463 /* Length of concatenated path name too long */ 464 arg_err_sw = on; 465 call convert_status_code_(error_table_$pathlong, shortinfo, longinfo); 466 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 467 "^a: ^a Processing ^a pathname for equals convention.", whoami, longinfo, "output file"); 468 return; 469 end; 470 if res_dir = ">" then res_pn = ">"|| res_ename; 471 else res_pn = before(res_dir, " ") ||">"|| res_ename; 472 return; 473 end process_equal; 474 475 476 caps: proc(whoami) returns(char(5)); 477 dcl whoami char(*) parameter; 478 if substr(whoami, 1, 4) = "sort" then return("Sort"); 479 else return("Merge"); 480 end caps; 481 482 483 expand_err: proc(code, name, value); 484 /* Error from expand_path_. */ 485 dcl code fixed bin(35), 486 name char(*), 487 value char(*); 488 arg_err_sw = on; 489 call convert_status_code_(code, shortinfo, longinfo); 490 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 491 "^a: ^a Expanding ^a pathname ^a for equals convention.", whoami, longinfo, name, value); 492 end expand_err; 493 494 equal_err: proc(code, name, value); 495 /* Error from get_equal_name_. */ 496 dcl code fixed bin(35), 497 name char(*), 498 value char(*) aligned; 499 arg_err_sw = on; 500 call convert_status_code_(code, shortinfo, longinfo); 501 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 502 "^a: ^a Processing ^a entryname ^a for equals convention.", whoami, longinfo, name, value); 503 end equal_err; 504 505 506 unable_error: proc(action, name); 507 dcl (action, 508 name) char(*) parameter; 509 fatal_sw = on; 510 call convert_status_code_(hcs_code, shortinfo, longinfo); 511 if user_out_sw ^= "" then call ioa_$ioa_stream(user_out_sw, 512 "^a: ^a Unable to ^a temporary segment [pd]>^a^a", 513 whoami, longinfo, action, unique_prefix, name); 514 end unable_error; 515 516 517 noexit: entry(sort_code); /* This is both sort_$noexit and merge_$noexit, when bound. */ 518 /* Must set code ^= 0 to indicate erroneous call without a defined user procedure. */ 519 call sub_err_(error_table_$out_of_sequence, (whoami), "c", null(), retval, 520 "The entry ""^a_$noexit"" cannot be called.", before(whoami, "_")); 521 return; 522 523 524 end sort_merge_subroutine; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/11/82 1029.6 sort_merge_subroutine.pl1 >spec>on>11/11/82>sort_merge_subroutine.pl1 54 1 12/20/77 1614.2 sort_ext.incl.pl1 >ldd>include>sort_ext.incl.pl1 77 2 04/26/76 1500.0 sort_sd.incl.pl1 >ldd>include>sort_sd.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. action parameter char unaligned dcl 507 set ref 506 511* arg_err_sw parameter bit(1) unaligned dcl 21 set ref 15 129* 184* 204* 213* 240* 263* 269* 300* 306* 321* 355* 361* 367* 384* 409* 415* 464* 488* 499* bit_count 000105 automatic fixed bin(24,0) dcl 69 set ref 157* 180* check_star_code 000120 automatic fixed bin(35,0) dcl 84 set ref 304* 305 check_star_name_$entry 000012 constant entry external dcl 36 ref 304 code parameter fixed bin(35,0) dcl 496 in procedure "equal_err" set ref 494 500* code parameter fixed bin(35,0) dcl 485 in procedure "expand_err" set ref 483 489* code parameter fixed bin(35,0) dcl 275 in procedure "verify_input_files" set ref 273 278* 280* convert_int_code 000107 automatic fixed bin(35,0) dcl 73 set ref 180* 182 convert_status_code_ 000014 constant entry external dcl 37 ref 161 296 465 489 500 510 curr_output_file_attach defined char(256) unaligned dcl 1-31 set ref 351* 381* curr_output_file_name defined char(256) unaligned dcl 1-34 set ref 350* 372* 375* 380* equal_code 000121 automatic fixed bin(35,0) dcl 85 set ref 453* 454* 455 457* equal_name 000376 automatic char(32) dcl 87 set ref 445* 446 446 452 454* 457* error_table_$dirseg 000112 external static fixed bin(35,0) dcl 56 ref 158 error_table_$out_of_sequence 000110 external static fixed bin(35,0) dcl 56 set ref 519* error_table_$pathlong 000106 external static fixed bin(35,0) dcl 56 set ref 465* exits_ptr parameter pointer dcl 21 set ref 15 112* 121* 125* 180* expand_code 000117 automatic fixed bin(35,0) dcl 83 set ref 293* 295 296* 446* 448 449* expand_path_ 000016 constant entry external dcl 38 ref 293 446 fatal_sw parameter bit(1) unaligned dcl 21 set ref 15 111* 160* 509* file_spec parameter char unaligned dcl 421 ref 420 425 425 429 429 432 432 first_in_ename 000204 automatic char(32) dcl 87 set ref 285* 313* 442 454* first_in_kw 000214 automatic char(32) unaligned dcl 87 set ref 288* 360 360 444 444 first_in_pathname 000224 automatic char(256) unaligned dcl 87 set ref 314* 372 get_equal_name_ 000020 constant entry external dcl 39 ref 454 get_pdir_ 000022 constant entry external dcl 40 ref 173 173 hcs_$make_seg 000024 constant entry external dcl 41 ref 173 hcs_$set_bc_seg 000030 constant entry external dcl 41 ref 192 hcs_$status_mins 000032 constant entry external dcl 41 ref 157 hcs_$truncate_seg 000026 constant entry external dcl 41 ref 187 hcs_code 000116 automatic fixed bin(35,0) dcl 82 set ref 157* 158* 159 161* 168* 173* 187* 188 192* 193 510* i 000512 automatic fixed bin(17,0) dcl 276 set ref 286* 287 288 288 289 289 293 293 293 293 297* 297 297 307* 307 307 312 314 317 317 322 322* in_dir 000122 automatic char(168) dcl 87 set ref 293 293 in_ename 000174 automatic char(32) dcl 87 set ref 292* 293 293 302 304* 313 input_driver_is_sort defined bit(1) unaligned dcl 1-46 set ref 235* 242* input_file parameter char array unaligned dcl 21 set ref 15 234 234 253 253 265 265 279 281 281 286 286 287* 288 288 289 289 293 293 293 293 297 297 307 307 312 314 317 317 322 354 354 442 442 input_file_exit 2 based entry variable level 2 dcl 2-14 ref 214 251 input_file_exit_sw defined bit(1) unaligned dcl 1-49 ref 265 input_file_max defined fixed bin(17,0) dcl 1-53 set ref 279 281* input_rec_deleted defined fixed bin(30,0) dcl 1-59 set ref 141* input_rec_inserted defined fixed bin(30,0) dcl 1-62 set ref 141* io_exits based structure level 1 unaligned dcl 2-14 io_exits_ptr 000112 automatic pointer dcl 78 set ref 112* 126* 180* 201 202 208* 212* 244 251 390 397 io_exits_version_max 000010 internal static fixed bin(17,0) initial dcl 63 set ref 203 205* ioa_$ioa_stream 000034 constant entry external dcl 45 ref 130 162 205 215 219 256 260 266 281 297 307 322 356 362 368 385 402 406 412 466 490 501 511 keys_ptr parameter pointer dcl 21 set ref 15 112* 120* 124* 180* kw_index 000522 automatic fixed bin(17,0) dcl 341 in procedure "process_output_par" set ref 347* 348 348 378 378 kw_index 000502 automatic fixed bin(17,0) dcl 232 in procedure "process_input_par" set ref 287* 288 289 289 317 317 kw_par parameter fixed bin(17,0) dcl 421 set ref 420 424* 428* longinfo 000420 automatic char(100) dcl 101 set ref 161* 162* 296* 297* 465* 466* 489* 490* 500* 501* 510* 511* name parameter char unaligned dcl 507 in procedure "unable_error" set ref 506 511* name parameter char unaligned dcl 485 in procedure "expand_err" set ref 483 490* name parameter char unaligned dcl 496 in procedure "equal_err" set ref 494 501* off constant bit(1) initial unaligned dcl 61 ref 111 235 343 on constant bit(1) initial unaligned dcl 61 ref 129 160 184 204 213 240 242 263 265 269 300 306 321 346 355 361 367 384 409 411 415 464 488 499 509 output_driver_is_sort defined bit(1) unaligned dcl 1-117 set ref 343* 346* output_file parameter char unaligned dcl 21 set ref 15 342 347* 348 348 350 352 352 356* 362* 368* 378 378 381 385* 399 411 output_file_exit 6 based entry variable level 2 dcl 2-14 ref 218 397 output_file_exit_sw defined bit(1) unaligned dcl 1-120 ref 411 output_rec_deleted defined fixed bin(30,0) dcl 1-123 set ref 141* output_rec_inserted defined fixed bin(30,0) dcl 1-126 set ref 141* read_count defined fixed bin(30,0) dcl 1-142 set ref 139* res_dir 000324 automatic char(168) dcl 87 set ref 446 446 460 460 470 471 res_ename 000406 automatic char(32) dcl 87 set ref 454* 460 460 470 471 res_pn parameter char unaligned dcl 440 set ref 438 446 446 446 446 449* 470* 471* retval 000451 automatic fixed bin(35,0) dcl 104 set ref 519* seg_length 000106 automatic fixed bin(24,0) dcl 69 set ref 180* 187* 192 seg_type 000104 automatic fixed bin(2,0) dcl 69 set ref 157* 158 shortinfo 000416 automatic char(8) dcl 101 set ref 161* 296* 465* 489* 500* 510* sort_code parameter fixed bin(35,0) dcl 21 ref 517 sort_convert_internal 000042 constant entry external dcl 50 ref 180 sort_desc parameter pointer array dcl 21 ref 15 115 116 116 119 120 120 121 121 123 124 124 125 125 126 126 130 130 sort_desc_pn defined char(168) unaligned dcl 1-171 set ref 162* sort_ext$curr_output_file_attach 000044 external static char(256) unaligned dcl 1-30 set ref 351* 351 381* 381 sort_ext$curr_output_file_name 000046 external static char(256) unaligned dcl 1-33 set ref 350* 350 372* 372 375 375 380* 380 sort_ext$input_driver_is_sort 000050 external static bit(1) unaligned dcl 1-45 set ref 235* 235 242* 242 sort_ext$input_file_exit_sw 000052 external static bit(1) unaligned dcl 1-48 ref 265 265 sort_ext$input_file_max 000054 external static fixed bin(17,0) dcl 1-51 ref 279 279 281 281 sort_ext$input_rec_deleted 000056 external static fixed bin(30,0) dcl 1-58 set ref 141* 141 sort_ext$input_rec_inserted 000060 external static fixed bin(30,0) dcl 1-61 set ref 141* 141 sort_ext$output_driver_is_sort 000062 external static bit(1) unaligned dcl 1-116 set ref 343* 343 346* 346 sort_ext$output_file_exit_sw 000064 external static bit(1) unaligned dcl 1-119 ref 411 411 sort_ext$output_rec_deleted 000066 external static fixed bin(30,0) dcl 1-122 set ref 141* 141 sort_ext$output_rec_inserted 000070 external static fixed bin(30,0) dcl 1-125 set ref 141* 141 sort_ext$read_count 000072 external static fixed bin(30,0) dcl 1-141 set ref 139* 139 sort_ext$sort_desc_pn 000074 external static char(168) unaligned dcl 1-170 ref 162 162 sort_ext$unique_prefix 000100 external static char(16) unaligned dcl 1-215 ref 173 173 511 511 sort_ext$user_out_sw 000076 external static char(32) unaligned dcl 1-212 set ref 108* 108 109* 109 110* 110 130 130 130 130 162 162 162 162 205 205 205 205 215 215 215 215 219 219 219 219 256 256 256 256 260 260 260 260 266 266 266 266 281 281 281 281 297 297 297 297 307 307 307 307 322 322 322 322 356 356 356 356 362 362 362 362 368 368 368 368 385 385 385 385 402 402 402 402 406 406 406 406 412 412 412 412 466 466 466 466 490 490 490 490 501 501 501 501 511 511 511 511 sort_ext$whoami 000102 external static char(6) unaligned dcl 1-227 ref 119 119 123 123 130 130 130 130 130 130 151 151 162 162 162 162 162 162 168 168 205 205 210 210 215 215 219 219 255 255 256 256 260 260 266 266 281 281 297 297 307 307 322 322 356 356 362 362 366 366 368 368 385 385 401 401 402 402 406 406 412 412 466 466 490 490 501 501 511 511 519 519 519 519 519 519 sort_ext$write_count 000104 external static fixed bin(30,0) dcl 1-230 set ref 139* 139 sort_input_exit parameter entry variable dcl 21 set ref 15 246* 251* 253 sort_output_exit parameter entry variable dcl 21 set ref 15 392* 397* 399 source_sort_desc 000102 automatic pointer dcl 68 set ref 116* 157* 180* sub_err_ 000036 constant entry external dcl 47 ref 519 temp_sd_int parameter pointer dcl 21 set ref 15 173* 176 180* 187* 192* temp_sd_lex parameter pointer dcl 21 set ref 15 168* 169 180* translator_temp_$get_segment 000040 constant entry external dcl 48 ref 168 unique_prefix defined char(16) unaligned dcl 1-216 set ref 173 511* user_out_sw defined char(32) unaligned dcl 1-213 set ref 108* 109* 110* 130 130* 162 162* 205 205* 215 215* 219 219* 256 256* 260 260* 266 266* 281 281* 297 297* 307 307* 322 322* 356 356* 362 362* 368 368* 385 385* 402 402* 406 406* 412 412* 466 466* 490 490* 501 501* 511 511* user_out_sw_par parameter char unaligned dcl 21 ref 15 108 109 109 110 138 user_out_sw_temp 000100 automatic char(8) unaligned dcl 66 set ref 138* value parameter char dcl 496 in procedure "equal_err" set ref 494 501* value parameter char unaligned dcl 485 in procedure "expand_err" set ref 483 490* verify_input_files_code 000110 automatic fixed bin(35,0) dcl 73 set ref 238* 239 version based fixed bin(17,0) initial level 2 dcl 2-14 set ref 203 203 205* w2_index 000523 automatic fixed bin(17,0) dcl 341 in procedure "process_output_par" set ref 347* 350 352 352 381 w2_index 000503 automatic fixed bin(17,0) dcl 233 in procedure "process_input_par" set ref 287* 293 293 293 293 297 297 307 307 314 w2_par parameter fixed bin(17,0) dcl 421 set ref 420 424* 425 425 426* 426 428 429 429 430* 430 432 432 433* 433 whoami parameter char unaligned dcl 477 in procedure "caps" ref 476 478 whoami defined char(6) unaligned dcl 1-228 in procedure "sort_merge_subroutine" set ref 119 123 130* 130* 130* 151 162* 162* 162* 168 205* 210 215* 219* 255 256* 260* 266* 281* 297* 307* 322* 356* 362* 366 368* 385* 401 402* 406* 412* 466* 490* 501* 511* 519 519 519 work_ptr 000114 automatic pointer dcl 78 set ref 202* 203 203 205 214 218 write_count defined fixed bin(30,0) dcl 1-231 set ref 139* 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 comp_len automatic fixed bin(17,0) dcl 87 compare_sw defined fixed bin(1,0) dcl 1-19 compares_counter defined fixed bin(34,0) dcl 1-16 component automatic char(32) dcl 87 curr_input_file_attach defined char(256) unaligned dcl 1-22 curr_input_file_name defined char(256) unaligned dcl 1-25 curr_input_file_num defined fixed bin(17,0) dcl 1-28 debug_sw defined bit(1) unaligned dcl 1-37 disaster2 defined fixed bin(17,0) dcl 1-40 dt defined fixed bin(30,0) array dcl 1-43 exits based structure level 1 unaligned dcl 2-20 filesize automatic float bin(27) dcl 78 in_bit_count automatic fixed bin(24,0) dcl 87 in_buff_ptr defined pointer dcl 1-65 in_ptr automatic pointer dcl 87 input_record_exit_sw defined fixed bin(1,0) dcl 1-56 ioa_$rsnnl 000000 constant entry external dcl 45 keys based structure level 1 unaligned dcl 2-3 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 mii defined fixed bin(17,0) dcl 1-99 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_record_exit_sw defined fixed bin(1,0) dcl 1-129 presort_compares defined fixed bin(34,0) dcl 1-132 pu defined structure array level 1 unaligned dcl 1-137 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 sip defined pointer dcl 1-166 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_input_file_attach external static char(256) unaligned dcl 1-21 sort_ext$curr_input_file_name external static char(256) unaligned dcl 1-24 sort_ext$curr_input_file_num external static fixed bin(17,0) dcl 1-27 sort_ext$debug_sw external static bit(1) unaligned dcl 1-36 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$in_buff_ptr external static pointer dcl 1-64 sort_ext$input_record_exit_sw external static fixed bin(1,0) dcl 1-55 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$mii external static fixed bin(17,0) dcl 1-98 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_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$pu external static structure array level 1 unaligned dcl 1-134 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$sip external static pointer dcl 1-165 sort_ext$sort_compare_exit external static entry variable dcl 1-168 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$state external static fixed bin(17,0) dcl 1-192 sort_ext$terminate_print_sw external static bit(1) unaligned dcl 1-195 sort_ext$time_info external static structure array level 1 unaligned dcl 1-198 sort_ext$time_sw external static bit(1) unaligned dcl 1-209 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_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 state defined fixed bin(17,0) dcl 1-193 terminate_print_sw defined bit(1) unaligned dcl 1-196 time_info defined structure array level 1 unaligned dcl 1-203 time_sw defined bit(1) unaligned dcl 1-210 type automatic fixed bin(2,0) dcl 87 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 NAMES DECLARED BY EXPLICIT CONTEXT. caps 004707 constant entry internal dcl 476 ref 130 130 162 162 check_io_exits 002030 constant entry internal dcl 200 ref 135 equal_err 005047 constant entry internal dcl 494 ref 457 expand_err 004740 constant entry internal dcl 483 ref 449 extent_sd 001374 constant entry internal dcl 150 ref 130 130 noexit 001274 constant entry external dcl 517 ref 214 218 246 253 392 399 process_equal 004305 constant entry internal dcl 438 ref 375 process_input_par 002246 constant entry internal dcl 226 ref 136 process_output_par 003372 constant entry internal dcl 335 ref 137 scan_file_spec 004221 constant entry internal dcl 420 ref 287 347 sd_is_source 001410 constant entry internal dcl 156 ref 117 sort_merge_subroutine 000737 constant entry external dcl 15 unable_error 005156 constant entry internal dcl 506 ref 170 177 189 194 verify_input_files 002532 constant entry internal dcl 273 ref 238 NAMES DECLARED BY CONTEXT OR IMPLICATION. addr builtin function ref 293 293 293 293 293 293 446 446 446 446 446 446 before builtin function ref 288 471 519 519 dimension builtin function ref 115 119 123 130 130 279 281 281 hbound builtin function ref 286 index builtin function ref 460 460 460 460 lbound builtin function ref 116 120 121 124 125 126 234 253 265 286 288 312 354 442 length builtin function ref 293 293 425 429 432 446 446 null builtin function ref 112 169 176 201 208 212 244 390 519 519 substr builtin function ref 119 123 151 210 255 288 289 289 293 293 293 293 297 297 307 307 314 317 317 348 348 350 352 352 366 378 378 381 401 425 429 432 478 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 6026 6142 5374 6036 Length 6520 5374 114 342 431 2 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME sort_merge_subroutine 1038 external procedure is an external procedure. extent_sd internal procedure shares stack frame of external procedure sort_merge_subroutine. sd_is_source internal procedure shares stack frame of external procedure sort_merge_subroutine. check_io_exits internal procedure shares stack frame of external procedure sort_merge_subroutine. process_input_par internal procedure shares stack frame of external procedure sort_merge_subroutine. verify_input_files internal procedure shares stack frame of external procedure sort_merge_subroutine. process_output_par internal procedure shares stack frame of external procedure sort_merge_subroutine. scan_file_spec internal procedure shares stack frame of external procedure sort_merge_subroutine. process_equal internal procedure shares stack frame of external procedure sort_merge_subroutine. caps internal procedure shares stack frame of external procedure sort_merge_subroutine. expand_err internal procedure shares stack frame of external procedure sort_merge_subroutine. equal_err internal procedure shares stack frame of external procedure sort_merge_subroutine. unable_error internal procedure shares stack frame of external procedure sort_merge_subroutine. STORAGE FOR INTERNAL STATIC VARIABLES. LOC IDENTIFIER BLOCK NAME 000010 io_exits_version_max sort_merge_subroutine STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME sort_merge_subroutine 000100 user_out_sw_temp sort_merge_subroutine 000102 source_sort_desc sort_merge_subroutine 000104 seg_type sort_merge_subroutine 000105 bit_count sort_merge_subroutine 000106 seg_length sort_merge_subroutine 000107 convert_int_code sort_merge_subroutine 000110 verify_input_files_code sort_merge_subroutine 000112 io_exits_ptr sort_merge_subroutine 000114 work_ptr sort_merge_subroutine 000116 hcs_code sort_merge_subroutine 000117 expand_code sort_merge_subroutine 000120 check_star_code sort_merge_subroutine 000121 equal_code sort_merge_subroutine 000122 in_dir sort_merge_subroutine 000174 in_ename sort_merge_subroutine 000204 first_in_ename sort_merge_subroutine 000214 first_in_kw sort_merge_subroutine 000224 first_in_pathname sort_merge_subroutine 000324 res_dir sort_merge_subroutine 000376 equal_name sort_merge_subroutine 000406 res_ename sort_merge_subroutine 000416 shortinfo sort_merge_subroutine 000420 longinfo sort_merge_subroutine 000451 retval sort_merge_subroutine 000502 kw_index process_input_par 000503 w2_index process_input_par 000512 i verify_input_files 000522 kw_index process_output_par 000523 w2_index process_output_par THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_cs cat_realloc_cs call_ext_out_desc call_ext_out return shorten_stack ext_entry ext_entry_desc THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. check_star_name_$entry convert_status_code_ expand_path_ get_equal_name_ get_pdir_ hcs_$make_seg hcs_$set_bc_seg hcs_$status_mins hcs_$truncate_seg ioa_$ioa_stream sort_convert_internal sub_err_ translator_temp_$get_segment THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$dirseg error_table_$out_of_sequence error_table_$pathlong sort_ext$curr_output_file_attach sort_ext$curr_output_file_name sort_ext$input_driver_is_sort sort_ext$input_file_exit_sw sort_ext$input_file_max sort_ext$input_rec_deleted sort_ext$input_rec_inserted sort_ext$output_driver_is_sort sort_ext$output_file_exit_sw sort_ext$output_rec_deleted sort_ext$output_rec_inserted sort_ext$read_count sort_ext$sort_desc_pn sort_ext$unique_prefix sort_ext$user_out_sw sort_ext$whoami sort_ext$write_count LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 15 000726 108 000764 109 000777 110 001014 111 001020 112 001024 115 001030 116 001042 117 001053 118 001054 119 001055 120 001065 121 001077 122 001107 123 001110 124 001116 125 001130 126 001140 127 001150 129 001151 130 001155 135 001250 136 001251 137 001252 138 001253 139 001261 141 001264 146 001270 517 001271 519 001301 521 001372 150 001374 151 001376 152 001405 156 001410 157 001411 158 001426 159 001434 160 001436 161 001443 162 001456 165 001540 168 001541 169 001570 170 001575 171 001606 173 001607 176 001665 177 001672 178 001703 180 001704 182 001733 184 001735 185 001742 187 001743 188 001757 189 001761 190 001772 192 001773 193 002012 194 002014 195 002026 197 002027 200 002030 201 002031 202 002036 203 002040 204 002045 205 002052 208 002112 209 002114 210 002115 212 002123 213 002125 214 002132 215 002147 218 002177 219 002214 223 002245 226 002246 234 002247 235 002267 236 002272 238 002273 239 002275 240 002300 242 002305 244 002310 246 002314 247 002322 251 002323 253 002332 255 002367 256 002372 259 002422 260 002423 263 002453 265 002460 266 002474 269 002524 330 002531 273 002532 278 002534 279 002535 280 002547 281 002551 285 002614 286 002617 287 002630 288 002665 289 002725 292 002754 293 002757 295 003014 296 003016 297 003031 300 003120 302 003126 304 003132 305 003147 306 003151 307 003156 310 003245 312 003246 313 003253 314 003256 316 003277 317 003300 319 003310 321 003311 322 003315 325 003366 326 003367 327 003371 335 003372 342 003373 343 003402 344 003405 346 003406 347 003411 348 003431 350 003444 351 003457 352 003463 354 003474 355 003513 356 003517 360 003554 361 003564 362 003571 366 003627 367 003636 368 003643 372 003700 373 003705 375 003706 377 003716 378 003717 380 003727 381 003734 382 003746 384 003747 385 003753 390 004011 392 004015 393 004023 397 004024 399 004033 401 004056 402 004062 405 004112 406 004113 409 004143 411 004150 412 004163 415 004213 417 004220 420 004221 424 004232 425 004236 426 004250 427 004251 428 004252 429 004254 430 004266 431 004267 432 004270 433 004302 434 004303 435 004304 438 004305 442 004316 444 004343 445 004354 446 004357 448 004407 449 004411 450 004437 452 004440 453 004445 454 004446 455 004471 457 004473 458 004502 460 004503 464 004535 465 004542 466 004555 468 004622 470 004623 471 004646 472 004705 476 004707 478 004720 479 004733 483 004740 488 004756 489 004763 490 004777 492 005046 494 005047 499 005065 500 005072 501 005106 503 005155 506 005156 509 005174 510 005201 511 005214 514 005267 ----------------------------------------------------------- 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