MODULE usm#report_files;
?? RIGHT := 110 ??

{USP#REPORT_FILES

?? NEWTITLE := 'Global Declarations Referenced By This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc fmt$file_attribute_keys
*copyc ost$halfword
*copyc pft$p_amd
*copyc pft$path
?? POP ??
*copyc clp$convert_integer_to_rjstring
*copyc clp$convert_integer_to_string
*copyc clp$evaluate_parameters
*copyc clp$open_display_reference
*copyc clp$put_display
*copyc clp$trimmed_string_size
*copyc fsp$adjust_tape_defaults
*copyc fsp$convert_file_contents
*copyc fsp$expand_file_label
*copyc mmp$create_scratch_segment
*copyc ofp$display_status_message
*copyc osp$format_message
*copyc osp$get_status_condition_string
*copyc osp$set_status_condition
*copyc pfp$get_object_information
*copyc pmp$convert_binary_unique_name
*copyc pmp$format_compact_date
*copyc pmp$format_compact_time
*copyc pmp$get_family_names
*copyc pmp$log
*copyc osv$upper_to_lower
?? OLDTITLE ??
?? NEWTITLE := 'Global Declarations Defined By This Module', EJECT ??

  SECTION
    s#sec1: READ;

  CONST
    e#unknown_attribute = 1;

  VAR
    access_share_modes: [READ, s#sec1] array [fst$file_access_option] of ^string ( * ) :=
          [^l#asm_1, ^l#asm_2, ^l#asm_3, ^l#asm_4, ^l#asm_5],
    l#asm_1: [READ, s#sec1] string (4) := 'READ',
    l#asm_2: [READ, s#sec1] string (7) := 'SHORTEN',
    l#asm_3: [READ, s#sec1] string (6) := 'APPEND',
    l#asm_4: [READ, s#sec1] string (6) := 'MODIFY',
    l#asm_5: [READ, s#sec1] string (7) := 'EXECUTE',
    block_types: [READ, s#sec1] array [amt$block_type] of ^string ( * ) := [^l#bt_1, ^l#bt_2],
    l#bt_1: [READ, s#sec1] string (c#dw_bt) := 'SYSTEM_SPECIFIED',
    l#bt_2: [READ, s#sec1] string (14) := 'USER_SPECIFIED',
    class: [READ, s#sec1] array [rmt$device_class] of ^string ( * ) :=
          [^l#c_1, ^l#c_2, ^l#c_3, ^l#c_4, ^l#c_5, ^l#c_6, ^l#c_7, ^l#c_8, ^l#c_9, ^l#c_10, ^l#c_11, ^l#c_12],
    l#c_1: [READ, s#sec1] string (14) := 'CONNECTED_FILE',
    l#c_2: [READ, s#sec1] string (c#dw_dc) := 'INTERSTATE_LINK',
    l#c_3: [READ, s#sec1] string (11) := 'LOCAL_QUEUE',
    l#c_4: [READ, s#sec1] string (3) := 'LOG',
    l#c_5: [READ, s#sec1] string (13) := 'MAGNETIC_TAPE',
    l#c_6: [READ, s#sec1] string (12) := 'MASS_STORAGE',
    l#c_7: [READ, s#sec1] string (c#dw_dc) := 'MEMORY_RESIDENT',
    l#c_8: [READ, s#sec1] string (7) := 'NETWORK',
    l#c_9: [READ, s#sec1] string (4) := 'NULL',
    l#c_10: [READ, s#sec1] string (8) := 'PIPELINE',
    l#c_11: [READ, s#sec1] string (5) := 'RHFAM',
    l#c_12: [READ, s#sec1] string (8) := 'TERMINAL',
    file_organizations: [READ, s#sec1] array [amt$file_organization] of ^string ( * ) :=
          [^l#fo_1, ^l#fo_2, ^l#fo_3, ^l#fo_4, ^l#fo_5],
    l#fo_1: [READ, s#sec1] string (10) := 'SEQUENTIAL',
    l#fo_2: [READ, s#sec1] string (16) := 'BYTE_ADDRESSABLE',
    l#fo_3: [READ, s#sec1] string (c#dw_fo) := 'INDEXED_SEQUENTIAL',
    l#fo_4: [READ, s#sec1] string (13) := 'DIRECT_ACCESS',
    l#fo_5: [READ, s#sec1] string (10) := 'SYSTEM_KEY',
    file_residency: [READ, s#sec1] array [t#file_kind] of string (7) := ['DISK', 'TAPE', 'ARCHIVE'],
    global_file_positions: [READ, s#sec1] array [amt$file_position] of ^string ( * ) :=
          [^l#gfp_1, ^l#gfp_2, ^l#gfp_3, ^l#gfp_4, ^l#gfp_5, ^l#gfp_6, ^l#gfp_7],
    l#gfp_1: [READ, s#sec1] string (3) := 'BOI',
    l#gfp_2: [READ, s#sec1] string (3) := 'BOP',
    l#gfp_3: [READ, s#sec1] string (10) := 'MID_RECORD',
    l#gfp_4: [READ, s#sec1] string (3) := 'EOR',
    l#gfp_5: [READ, s#sec1] string (3) := 'EOP',
    l#gfp_6: [READ, s#sec1] string (3) := 'EOI',
    l#gfp_7: [READ, s#sec1] string (15) := 'END_OF_KEY_LIST',
    internal_codes: [READ, s#sec1] array [amt$internal_code] of ^string ( * ) :=
          [^l#ic_1, ^l#ic_2, ^l#ic_3, ^l#ic_4, ^l#ic_5, ^l#ic_6, ^l#ic_7, ^l#ic_8, ^l#ic_9, ^l#ic_10,
          ^l#ic_11, ^l#ic_12, ^l#ic_13, ^l#ic_14, ^l#ic_15],
    l#ic_1: [READ, s#sec1] string (2) := 'A6',
    l#ic_2: [READ, s#sec1] string (2) := 'A8',
    l#ic_3: [READ, s#sec1] string (5) := 'ASCII',
    l#ic_4: [READ, s#sec1] string (3) := 'D64',
    l#ic_5: [READ, s#sec1] string (6) := 'EBCDIC',
    l#ic_6: [READ, s#sec1] string (3) := 'BCD',
    l#ic_7: [READ, s#sec1] string (3) := 'D63',
    l#ic_8: [READ, s#sec1] string (9) := 'FTAM1 IA5',
    l#ic_9: [READ, s#sec1] string (c#dw_ic) := 'FTAM1 VISIBLE',
    l#ic_10: [READ, s#sec1] string (c#dw_ic) := 'FTAM1 GRAPHIC',
    l#ic_11: [READ, s#sec1] string (c#dw_ic) := 'FTAM1 GENERAL',
    l#ic_12: [READ, s#sec1] string (9) := 'FTAM2 IA5',
    l#ic_13: [READ, s#sec1] string (c#dw_ic) := 'FTAM2 VISIBLE',
    l#ic_14: [READ, s#sec1] string (c#dw_ic) := 'FTAM2 GRAPHIC',
    l#ic_15: [READ, s#sec1] string (c#dw_ic) := 'FTAM2 GENERAL',
    job_file_positions: [READ, s#sec1] array [amt$file_position] of ^string ( * ) :=
          [^l#jfp_1, ^l#jfp_2, ^l#jfp_3, ^l#jfp_4, ^l#jfp_5, ^l#jfp_6, ^l#jfp_7],
    l#jfp_1: [READ, s#sec1] string (4) := '$BOI',
    l#jfp_2: [READ, s#sec1] string (4) := '$BOP',
    l#jfp_3: [READ, s#sec1] string (11) := '$MID_RECORD',
    l#jfp_4: [READ, s#sec1] string (4) := '$EOR',
    l#jfp_5: [READ, s#sec1] string (4) := '$EOP',
    l#jfp_6: [READ, s#sec1] string (4) := '$EOI',
    l#jfp_7: [READ, s#sec1] string (c#dw_jfp) := '$END_OF_KEY_LIST',
    key_types: [READ, s#sec1] array [amt$key_type] of ^string ( * ) := [^l#kt_1, ^l#kt_2, ^l#kt_3],
    l#kt_1: [READ, s#sec1] string (8) := 'COLLATED',
    l#kt_2: [READ, s#sec1] string (7) := 'INTEGER',
    l#kt_3: [READ, s#sec1] string (c#dw_kt) := 'UNCOLLATED',
    label_types: [READ, s#sec1] array [amt$label_type] of ^string ( * ) := [^l#lt_1, ^l#lt_2, ^l#lt_3],
    l#lt_1: [READ, s#sec1] string (7) := 'LABELED',
    l#lt_2: [READ, s#sec1] string (c#dw_flt) := 'NON_STANDARD_LABELED',
    l#lt_3: [READ, s#sec1] string (9) := 'UNLABELED',
    logging_possibilities: [READ, s#sec1] array [amc$enable_parcels .. amc$enable_request_recovery] of
          ^string ( * ) := [^l#lp_1, ^l#lp_2, ^l#lp_3],
    l#lp_1: [READ, s#sec1] string (14) := 'ENABLE_PARCELS',
    l#lp_2: [READ, s#sec1] string (21) := 'ENABLE_MEDIA_RECOVERY',
    l#lp_3: [READ, s#sec1] string (23) := 'ENABLE_REQUEST_RECOVERY',
    mainframe_attachments: [READ, s#sec1] array [fst$mf_usage_concurrency_scope] of ^string ( * ) :=
          [^l#ma_1, ^l#ma_2],
    l#ma_1: [READ, s#sec1] string (20) := 'REQUESTING_MAINFRAME',
    l#ma_2: [READ, s#sec1] string (19) := 'DIFFERENT_MAINFRAME',
    mainframe_write_concurrencies: [READ, s#sec1] array [fst$mainframe_write_concurrency] of ^string ( * ) :=
          [^l#mwc_1, ^l#mwc_2, ^l#mwc_3],
    l#mwc_1: [READ, s#sec1] string (c#dw_mwc) := 'NOT_ATTACHED_FOR_WRITE',
    l#mwc_2: [READ, s#sec1] string (13) := 'SHARED_MEMORY',
    l#mwc_3: [READ, s#sec1] string (19) := 'SHARED_MASS_STORAGE',
    message_controls: [READ, s#sec1] array [amc$trivial_errors .. amc$statistics] of ^string ( * ) :=
          [^l#mc_1, ^l#mc_2, ^l#mc_3],
    l#mc_1: [READ, s#sec1] string (14) := 'TRIVIAL_ERRORS',
    l#mc_2: [READ, s#sec1] string (8) := 'MESSAGES',
    l#mc_3: [READ, s#sec1] string (10) := 'STATISTICS',
    open_positions: [READ, s#sec1] array [amt$open_position] of ^string ( * ) :=
          [^l#op_1, ^l#op_2, ^l#op_3, ^l#op_4],
    l#op_1: [READ, s#sec1] string (5) := '$ASIS',
    l#op_2: [READ, s#sec1] string (4) := '$BOI',
    l#op_3: [READ, s#sec1] string (4) := '$BOP',
    l#op_4: [READ, s#sec1] string (4) := '$EOI',
    page_formats: [READ, s#sec1] array [amt$page_format] of ^string ( * ) :=
          [^l#pf_1, ^l#pf_2, ^l#pf_3, ^l#pf_4],
    l#pf_1: [READ, s#sec1] string (10) := 'CONTINUOUS',
    l#pf_2: [READ, s#sec1] string (9) := 'BURSTABLE',
    l#pf_3: [READ, s#sec1] string (c#dw_pf) := 'NON_BURSTABLE',
    l#pf_4: [READ, s#sec1] string (8) := 'UNTITLED',
    permit_share_options: [READ, s#sec1] array [pft$permit_options] of ^string ( * ) :=
          [^l#pso_1, ^l#pso_2, ^l#pso_3, ^l#pso_4, ^l#pso_5, ^l#pso_6, ^l#pso_7],
    l#pso_1: [READ, s#sec1] string (4) := 'READ',
    l#pso_2: [READ, s#sec1] string (7) := 'SHORTEN',
    l#pso_3: [READ, s#sec1] string (6) := 'APPEND',
    l#pso_4: [READ, s#sec1] string (6) := 'MODIFY',
    l#pso_5: [READ, s#sec1] string (7) := 'EXECUTE',
    l#pso_6: [READ, s#sec1] string (5) := 'CYCLE',
    l#pso_7: [READ, s#sec1] string (7) := 'CONTROL',
    record_types: [READ, s#sec1] array [amt$record_type] of ^string ( * ) :=
          [^l#rt_1, ^l#rt_2, ^l#rt_3, ^l#rt_4, ^l#rt_5, ^l#rt_6],
    l#rt_1: [READ, s#sec1] string (8) := 'VARIABLE',
    l#rt_2: [READ, s#sec1] string (9) := 'UNDEFINED',
    l#rt_3: [READ, s#sec1] string (10) := 'ANSI_FIXED',
    l#rt_4: [READ, s#sec1] string (12) := 'ANSI_SPANNED',
    l#rt_5: [READ, s#sec1] string (13) := 'ANSI_VARIABLE',
    l#rt_6: [READ, s#sec1] string (c#dw_rt) := 'TRAILING_CHARACTER_DELIMITED',
    reserved_file_processors: [READ, s#sec1] array [1 .. c#max_file_processor] of ^string ( * ) :=
          [^l#rfp_1, ^l#rfp_2, ^l#rfp_3, ^l#rfp_4, ^l#rfp_5, ^l#rfp_6, ^l#rfp_7, ^l#rfp_8, ^l#rfp_9,
          ^l#rfp_10, ^l#rfp_11, ^l#rfp_12, ^l#rfp_13, ^l#rfp_14, ^l#rfp_15, ^l#rfp_16, ^l#rfp_17, ^l#rfp_18],
    l#rfp_1: [READ, s#sec1] string (3) := 'ADA',
    l#rfp_2: [READ, s#sec1] string (3) := 'APL',
    l#rfp_3: [READ, s#sec1] string (9) := 'ASSEMBLER',
    l#rfp_4: [READ, s#sec1] string (5) := 'BASIC',
    l#rfp_5: [READ, s#sec1] string (1) := 'C',
    l#rfp_6: [READ, s#sec1] string (5) := 'COBOL',
    l#rfp_7: [READ, s#sec1] string (5) := 'CYBIL',
    l#rfp_8: [READ, s#sec1] string (8) := 'DEBUGGER',
    l#rfp_9: [READ, s#sec1] string (7) := 'FORTRAN',
    l#rfp_10: [READ, s#sec1] string (4) := 'LISP',
    l#rfp_11: [READ, s#sec1] string (6) := 'PASCAL',
    l#rfp_12: [READ, s#sec1] string (3) := 'PLI',
    l#rfp_13: [READ, s#sec1] string (13) := 'PPU_ASSEMBLER',
    l#rfp_14: [READ, s#sec1] string (6) := 'PROLOG',
    l#rfp_15: [READ, s#sec1] string (3) := 'SCL',
    l#rfp_16: [READ, s#sec1] string (3) := 'SCU',
    l#rfp_17: [READ, s#sec1] string (2) := 'VS',
    l#rfp_18: [READ, s#sec1] string (7) := 'UNKNOWN',
    tape_densities: [READ, s#sec1] array [rmc$200 .. rmc$38000] of ^string ( * ) :=
          [^l#td_1, ^l#td_2, ^l#td_3, ^l#td_4, ^l#td_5, ^l#td_6],
    l#td_1: [READ, s#sec1] string (7) := 'MT9$200',
    l#td_2: [READ, s#sec1] string (7) := 'MT9$556',
    l#td_3: [READ, s#sec1] string (7) := 'MT9$800',
    l#td_4: [READ, s#sec1] string (8) := 'MT9$1600',
    l#td_5: [READ, s#sec1] string (8) := 'MT9$6250',
    l#td_6: [READ, s#sec1] string (c#dw_td) := 'MT18$38000';

?? EJECT ??

  CONST
    c#fa_access_control_list = 1,
    c#fa_account_project = c#fa_access_control_list + 1,
    c#fa_actual_job_access = c#fa_account_project + 1,
    c#fa_archive_media_descriptor = c#fa_actual_job_access + 1,
    c#fa_archive_tape_vsn_list = c#fa_archive_media_descriptor + 1,
    c#fa_attached = c#fa_archive_tape_vsn_list + 1,
    c#fa_attached_external_vsn_list = c#fa_attached + 1,
    c#fa_attached_recorded_vsn_list = c#fa_attached_external_vsn_list + 1,
    c#fa_attached_transfer_size = c#fa_attached_recorded_vsn_list + 1,
    c#fa_attached_vol_oflo_allowed = c#fa_attached_transfer_size + 1,
    c#fa_attached_volume_number = c#fa_attached_vol_oflo_allowed + 1,
    c#fa_attachment_log = c#fa_attached_volume_number + 1,
    c#fa_attachment_logging_sel = c#fa_attachment_log + 1,
    c#fa_average_record_length = c#fa_attachment_logging_sel + 1,
    c#fa_block_type = c#fa_average_record_length + 1,
    c#fa_character_conversion = c#fa_block_type + 1,
    c#fa_collate_table_name = c#fa_character_conversion + 1,
    c#fa_compression_procedure_name = c#fa_collate_table_name + 1,
    c#fa_connected_files = c#fa_compression_procedure_name + 1,
    c#fa_creation_date_time = c#fa_connected_files + 1,
    c#fa_cycle_number = c#fa_creation_date_time + 1,
    c#fa_data_padding = c#fa_cycle_number + 1,
    c#fa_device_class = c#fa_data_padding + 1,
    c#fa_dynamic_home_block_space = c#fa_device_class + 1,
    c#fa_embedded_key = c#fa_dynamic_home_block_space + 1,
    c#fa_error_exit_procedure_name = c#fa_embedded_key + 1,
    c#fa_error_limit = c#fa_error_exit_procedure_name + 1,
    c#fa_estimated_record_count = c#fa_error_limit + 1,
    c#fa_exception_conditions = c#fa_estimated_record_count + 1,
    c#fa_expiration_date = c#fa_exception_conditions + 1,
    c#fa_external_vsn_list = c#fa_expiration_date + 1,
    c#fa_file_access_procedure_name = c#fa_external_vsn_list + 1,
    c#fa_file_contents = c#fa_file_access_procedure_name + 1,
    c#fa_file_label_type = c#fa_file_contents + 1,
    c#fa_file_limit = c#fa_file_label_type + 1,
    c#fa_file_name = c#fa_file_limit + 1,
    c#fa_file_organization = c#fa_file_name + 1,
    c#fa_file_previously_opened = c#fa_file_organization + 1,
    c#fa_file_processor = c#fa_file_previously_opened + 1,
    c#fa_file_residency = c#fa_file_processor + 1,
    c#fa_fill = c#fa_file_residency + 1,
    c#fa_forced_write = c#fa_fill + 1,
    c#fa_full_path = c#fa_forced_write + 1,
    c#fa_hashing_procedure_name = c#fa_full_path + 1,
    c#fa_index_levels = c#fa_hashing_procedure_name + 1,
    c#fa_index_padding = c#fa_index_levels + 1,
    c#fa_initial_home_block_count = c#fa_index_padding + 1,
    c#fa_internal_code = c#fa_initial_home_block_count + 1,
    c#fa_job_file_address = c#fa_internal_code + 1,
    c#fa_job_file_position = c#fa_job_file_address + 1,
    c#fa_job_instances_of_open = c#fa_job_file_position + 1,
    c#fa_job_write_concurrency = c#fa_job_instances_of_open + 1,
    c#fa_key_length = c#fa_job_write_concurrency + 1,
    c#fa_key_position = c#fa_key_length + 1,
    c#fa_key_type = c#fa_key_position + 1,
    c#fa_last_access_date_time = c#fa_key_type + 1,
    c#fa_last_data_mod_time = c#fa_last_access_date_time + 1,
    c#fa_last_mod_date_time = c#fa_last_data_mod_time + 1,
    c#fa_lifetime = c#fa_last_mod_date_time + 1,
    c#fa_lifetime_attachment_count = c#fa_lifetime + 1,
    c#fa_line_number = c#fa_lifetime_attachment_count + 1,
    c#fa_loading_factor = c#fa_line_number + 1,
    c#fa_lock_expiration_time = c#fa_loading_factor + 1,
    c#fa_log_residence = c#fa_lock_expiration_time + 1,
    c#fa_logging_options = c#fa_log_residence + 1,
    c#fa_mainframe_attachment = c#fa_logging_options + 1,
    c#fa_mf_write_concurrency = c#fa_mainframe_attachment + 1,
    c#fa_ms_allocation_size = c#fa_mf_write_concurrency + 1,
    c#fa_ms_bytes_allocated = c#fa_ms_allocation_size + 1,
    c#fa_ms_class = c#fa_ms_bytes_allocated + 1,
    c#fa_ms_free_behind = c#fa_ms_class + 1,
    c#fa_ms_initial_volume = c#fa_ms_free_behind + 1,
    c#fa_ms_sequential_access = c#fa_ms_initial_volume + 1,
    c#fa_ms_transfer_size = c#fa_ms_sequential_access + 1,
    c#fa_maximum_block_length = c#fa_ms_transfer_size + 1,
    c#fa_maximum_record_length = c#fa_maximum_block_length + 1,
    c#fa_message_control = c#fa_maximum_record_length + 1,
    c#fa_minimum_block_length = c#fa_message_control + 1,
    c#fa_minimum_record_length = c#fa_minimum_block_length + 1,
    c#fa_object_type = c#fa_minimum_record_length + 1,
    c#fa_open_position = c#fa_object_type + 1,
    c#fa_padding_character = c#fa_open_position + 1,
    c#fa_page_format = c#fa_padding_character + 1,
    c#fa_page_length = c#fa_page_format + 1,
    c#fa_page_width = c#fa_page_length + 1,
    c#fa_password = c#fa_page_width + 1,
    c#fa_path = c#fa_password + 1,
    c#fa_permitted_access = c#fa_path + 1,
    c#fa_potential_job_access = c#fa_permitted_access + 1,
    c#fa_preset_value = c#fa_potential_job_access + 1,
    c#fa_private_read = c#fa_preset_value + 1,
    c#fa_recorded_vsn_list = c#fa_private_read + 1,
    c#fa_records_per_block = c#fa_recorded_vsn_list + 1,
    c#fa_record_delimiting_char = c#fa_records_per_block + 1,
    c#fa_record_limit = c#fa_record_delimiting_char + 1,
    c#fa_record_type = c#fa_record_limit + 1,
    c#fa_registered = c#fa_record_type + 1,
    c#fa_removable_media_group = c#fa_registered + 1,
    c#fa_retrieve_option = c#fa_removable_media_group + 1,
    c#fa_ring_attributes = c#fa_retrieve_option + 1,
    c#fa_secondary_residence = c#fa_ring_attributes + 1,
    c#fa_set_name = c#fa_secondary_residence + 1,
    c#fa_shared_queue = c#fa_set_name + 1,
    c#fa_site_archive_option = c#fa_shared_queue + 1,
    c#fa_site_backup_option = c#fa_site_archive_option + 1,
    c#fa_site_release_option = c#fa_site_backup_option + 1,
    c#fa_size = c#fa_site_release_option + 1,
    c#fa_statement_identifier = c#fa_size + 1,
    c#fa_tape_density = c#fa_statement_identifier + 1,
    c#fa_unique_data_name = c#fa_tape_density + 1,
    c#fa_unique_name = c#fa_unique_data_name + 1,
    c#fa_user_information = c#fa_unique_name + 1,
    c#fa_vertical_print_density = c#fa_user_information + 1,
    c#fa_volume_overflow_allowed = c#fa_vertical_print_density + 1,

    c#attribute_key_max = c#fa_volume_overflow_allowed;

  TYPE
    t#site_attr_ordinal_indexes = (c#saoi_archive_option, c#saoi_backup_option, c#saio_release_option),
    t#file_attribute_key = 1 .. c#attribute_key_max,
    t#file_attribute_keys = set of t#file_attribute_key,
    t#object_type_counts = record
      catalog_type: 0 .. c#attribute_key_max,
      file_type: 0 .. c#attribute_key_max,
      cycle_type: 0 .. c#attribute_key_max,
    recend,
    t#object_types = (c#ot_cat, c#ot_cyc, c#ot_fil);

  CONST
    c#attribute_width_max = 512; {fst$path

  TYPE
    t#object_sort_order = (c#oso_name, c#oso_catalogs_then_files, c#oso_files_then_catalogs),
    t#file_sort_order = (c#fso_none, c#fso_modification_date, c#fso_size),
    t#attribute_width = 0 .. c#attribute_width_max,
    t#attribute_infos = array [1 .. * ] of t#attribute_info,
    t#attribute_info = record
      attr: t#file_attribute_key,
      width: t#attribute_width,
    recend,
    t#label_attributes = 0 .. amc$max_attribute,
    t#file_attribute_keys_set = set of fmt$file_attribute_keys;

  CONST
    c#max_integer_as_string = 31, {Number of chars to hold largest integer
    c#max_string_size = 8000;

  TYPE
    t#string_size = 0 .. c#max_string_size,
    t#string = record
      value: string (c#max_string_size),
      size: t#string_size,
    recend;

  TYPE
    t#file_kind = (c#fk_disk_file, c#fk_tape_volume, c#fk_archived_disk_file);

  VAR
    v#asterisks: [READ, s#sec1] string (131) := '*****' CAT
          '***************************************************************' CAT
          '***************************************************************',
    v#blanks: [READ, s#sec1] string (131) := '     ' CAT
          '                                                               ' CAT
          '                                                               ';

?? OLDTITLE ??
?? NEWTITLE := 'Global [XDCL] Defined By This Module', EJECT ??

  VAR
    initial_information_request: [READ, s#sec1] fst$goi_information_request :=
          [[fsc$specific_depth, 1], $fst$goi_object_info_requests [{}
{             } fsc$goi_catalog_object_list,
{             } fsc$goi_file_object_list,
{             } fsc$goi_cycle_object_list,
{             } fsc$goi_cycle_info,
{             } fsc$goi_cycle_device_info {so can test if resides online}
          ]];

  VAR
    null_unique_name: [READ, s#sec1] ost$binary_unique_name := [0, 0, 1980, 1, 1, 0, 0, 0, 0, 0];

  VAR
    file_label_attributes: [READ, s#sec1] t#file_attribute_keys :=
          [c#fa_average_record_length, c#fa_block_type, c#fa_character_conversion, c#fa_collate_table_name,
          c#fa_compression_procedure_name, c#fa_data_padding, c#fa_dynamic_home_block_space,
          c#fa_embedded_key, c#fa_estimated_record_count, c#fa_file_access_procedure_name, c#fa_file_contents,
          c#fa_file_label_type, c#fa_file_limit, c#fa_file_organization, c#fa_file_previously_opened,
          c#fa_file_processor, c#fa_forced_write, c#fa_hashing_procedure_name, c#fa_index_levels,
          c#fa_index_padding, c#fa_initial_home_block_count, c#fa_internal_code, c#fa_key_length,
          c#fa_key_position, c#fa_key_type, c#fa_line_number, c#fa_loading_factor, c#fa_lock_expiration_time,
          c#fa_log_residence, c#fa_logging_options, c#fa_maximum_block_length, c#fa_maximum_record_length,
          c#fa_minimum_block_length, c#fa_minimum_record_length, c#fa_padding_character, c#fa_page_format,
          c#fa_page_length, c#fa_page_width, c#fa_preset_value, c#fa_record_delimiting_char,
          c#fa_record_limit, c#fa_record_type, c#fa_records_per_block, c#fa_ring_attributes,
          c#fa_statement_identifier, c#fa_user_information, c#fa_vertical_print_density];

  CONST
    c#dw_0 = 0, {Not supported
    c#dw_amd = 72, {yy.mm.dd name name
    c#dw_atvl = 8, {'(xxxxxx)'
    c#dw_avn = 5, {'65536'
    c#dw_bln = 1, {'Y'
    c#dw_bt = 16, {'SYSTEM_SPECIFIED'
    c#dw_byt = 13, {'4398046511103' (2**42 - 1)
    c#dw_cn = 5, {'65536'
    c#dw_dc = 15, {'INTERSTATE_LINK'
    c#dw_dp = 2, {'99'
    c#dw_dtm = 8 + 1 + 8, {'yy.mm.dd hh:mm:ss'
    c#dw_el = 5, {'65536'
    c#dw_fill = 1, {' '
    c#dw_flt = 20, {'NON_STANDARD_LABELED'
    c#dw_fo = 18, {'INDEXED_SEQUENTIAL'
    c#dw_fr = 7, {'ARCHIVE'
    c#dw_ic = 13, {'FTAM2 GENERAL'
    c#dw_il = 2, {'15'
    c#dw_ip = 2, {'99'
    c#dw_jfp = 16, {'$END_OF_KEY_LIST'
    c#dw_kl = 3, {'255'
    c#dw_kp = 5, {'65496'
    c#dw_kt = 10, {'UNCOLLATED'
    c#dw_let = 9, {'604800000'
    c#dw_lf = 3, {'100'
    c#dw_ln = 1 + 5 + 1 + 1 + 1, {'(65535 6)'
    c#dw_msas = 8, {'16777215'
    c#dw_msc = 1,
    c#dw_msiv = 6,
    c#dw_mwc = 22, {'NOT_ATTACHED_FOR_WRITE'
    c#dw_ot = 7, {'CATALOG'
    c#dw_pc = 1,
    c#dw_pf = 13, {'NON_BURSTABLE'
    c#dw_pw = 5, {'65535'
    c#dw_ra = 1 + 2 + 1 + 2 + 1 + 2 + 1, {'(nn nn nn)'
    c#dw_rdc = 1,
    c#dw_rpb = 5, {'65535'
    c#dw_rt = 28, {'TRAILING_CHARACTER_DELIMITED'
    c#dw_rvsnl = 10, {'(XXXXXXXX)'
    c#dw_seg = 10, {'2147483647'
    c#dw_si = 1 + 5 + 1 + 2 + 1, { '(65535 17)'
    c#dw_sa_ord = 4, {Site attribute ordinal (0..255),NULL
    c#dw_sq = 7, {'SITE_nn'
    c#dw_std = 31,
    c#dw_td = 10, {'MT18$38000'
    c#dw_vpd = 2, {'12'
    c#max_file_processor = 18,
    c#comp_proc_name = fmc$compression_procedure_name,
    c#dyna_home_block_space = fmc$dynamic_home_block_space,
    c#init_home_block_count = fmc$initial_home_block_count,
    c#rec_delim_char = fmc$record_delimiting_character;

?? FMT (FORMAT := OFF) ?? {Use ?? RIGHT := 110 ?? if need to reformat...

  VAR {Array order same as C#FA_ constants order.
    v#attrs_info: [READ, s#sec1] array [1 .. c#attribute_key_max] of record
      name: ost$name,
      applicable_object_types: set of t#object_types,
      file_label_attr: t#label_attributes,
      default_width: ost$halfword,
    recend := [
 {} ['ACCESS_CONTROL_LIST            ', [c#ot_cat, c#ot_fil], 0, c#dw_0],
 {} ['ACCOUNT_PROJECT                ', [c#ot_cat, c#ot_fil], 0, c#dw_std],
 {} ['ACTUAL_JOB_ACCESS              ', [c#ot_cyc], 0, c#dw_std],
 {} ['ARCHIVE_MEDIA_DESCRIPTOR       ', [c#ot_cyc], 0, c#dw_amd],
 {} ['ARCHIVE_TAPE_VSN_LIST          ', [c#ot_cyc], 0, c#dw_atvl],
 {} ['ATTACHED                       ', [c#ot_cyc], 0, c#dw_bln],
 {} ['ATTACHED_EXTERNAL_VSN_LIST     ', [c#ot_cyc], 0, c#dw_std],
 {} ['ATTACHED_RECORDED_VSN_LIST     ', [c#ot_cyc], 0, c#dw_std],
 {} ['ATTACHED_TRANSFER_SIZE         ', [c#ot_cyc], 0, c#dw_seg],
 {} ['ATTACHED_VOL_OVERFLOW_ALLOWED  ', [c#ot_cyc], 0, c#dw_bln],
 {} ['ATTACHED_VOLUME_NUMBER         ', [c#ot_cyc], 0, c#dw_avn],
 {} ['ATTACHMENT_LOG                 ', [c#ot_fil], 0, c#dw_0],
 {} ['ATTACHMENT_LOGGING_SELECTED    ', [c#ot_fil], 0, c#dw_bln],
 {} ['AVERAGE_RECORD_LENGTH          ', [c#ot_cyc], fmc$average_record_length, c#dw_byt],
 {} ['BLOCK_TYPE                     ', [c#ot_cyc], fmc$block_type, c#dw_bt],
 {} ['CHARACTER_CONVERSION           ', [c#ot_cyc], fmc$character_conversion, c#dw_bln],
 {} ['COLLATE_TABLE_NAME             ', [c#ot_cyc], fmc$collate_table_name, c#dw_std],
 {} ['COMPRESSION_PROCEDURE_NAME     ', [c#ot_cyc], c#comp_proc_name, c#dw_std],
 {} ['CONNECTED_FILES                ', [c#ot_cyc], 0, c#dw_0],
 {} ['CREATION_DATE_TIME             ', [c#ot_cat, c#ot_cyc], 0, c#dw_dtm],
 {} ['CYCLE_NUMBER                   ', [c#ot_cyc], 0, c#dw_cn],
 {} ['DATA_PADDING                   ', [c#ot_cyc], fmc$data_padding, c#dw_dp],
 {} ['DEVICE_CLASS                   ', [c#ot_cat, c#ot_cyc], 0, c#dw_dc],
 {} ['DYNAMIC_HOME_BLOCK_SPACE       ', [c#ot_cyc], c#dyna_home_block_space, c#dw_bln],
 {} ['EMBEDDED_KEY                   ', [c#ot_cyc], fmc$embedded_key, c#dw_bln],
 {} ['ERROR_EXIT_PROCEDURE_NAME      ', [c#ot_cyc], 0, c#dw_std],
 {} ['ERROR_LIMIT                    ', [c#ot_cyc], 0, c#dw_el],
 {} ['ESTIMATED_RECORD_COUNT         ', [c#ot_cyc], fmc$estimated_record_count, c#dw_byt],
 {} ['EXCEPTION_CONDITIONS           ', [c#ot_cat, c#ot_cyc], 0, c#dw_0],
 {} ['EXPIRATION_DATE                ', [c#ot_cyc], 0, c#dw_dtm],
 {} ['EXTERNAL_VSN_LIST              ', [c#ot_cyc], 0, c#dw_std],
 {} ['FILE_ACCESS_PROCEDURE_NAME     ', [c#ot_cyc], fmc$file_access_procedure, c#dw_std],
 {} ['FILE_CONTENTS                  ', [c#ot_cyc], fmc$file_contents, c#dw_std],
 {} ['FILE_LABEL_TYPE                ', [c#ot_cyc], fmc$label_type, c#dw_flt],
 {} ['FILE_LIMIT                     ', [c#ot_cyc], fmc$file_limit, c#dw_byt],
 {} ['FILE_NAME                      ', [c#ot_cyc], 0, c#dw_std],
 {} ['FILE_ORGANIZATION              ', [c#ot_cyc], fmc$file_organization, c#dw_fo],
 {} ['FILE_PREVIOUSLY_OPENED         ', [c#ot_cyc], 0, c#dw_bln],
 {} ['FILE_PROCESSOR                 ', [c#ot_cyc], fmc$file_processor, c#dw_std],
 {} ['FILE_RESIDENCY                 ', [c#ot_cyc], 0 , c#dw_fr],
 {} ['FILL                           ', [], 0, c#dw_fill],
 {} ['FORCED_WRITE                   ', [c#ot_cyc], fmc$forced_write, c#dw_bln],
 {} ['FULL_PATH                      ', [c#ot_cyc], 0, c#dw_std],
 {} ['HASHING_PROCEDURE_NAME         ', [c#ot_cyc], fmc$hashing_procedure_name, c#dw_std],
 {} ['INDEX_LEVELS                   ', [c#ot_cyc], fmc$index_levels, c#dw_il],
 {} ['INDEX_PADDING                  ', [c#ot_cyc], fmc$index_padding, c#dw_ip],
 {} ['INITIAL_HOME_BLOCK_COUNT       ', [c#ot_cyc], c#init_home_block_count, c#dw_byt],
 {} ['INTERNAL_CODE                  ', [c#ot_cyc], fmc$internal_code, c#dw_ic],
 {} ['JOB_FILE_ADDRESS               ', [c#ot_cyc], 0, c#dw_std],
 {} ['JOB_FILE_POSITION              ', [c#ot_cyc], 0, c#dw_jfp],
 {} ['JOB_INSTANCES_OF_OPEN          ', [c#ot_cyc], 0, c#dw_byt],
 {} ['JOB_WRITE_CONCURRENCY          ', [c#ot_cyc], 0, c#dw_bln],
 {} ['KEY_LENGTH                     ', [c#ot_cyc], fmc$key_length, c#dw_kl],
 {} ['KEY_POSITION                   ', [c#ot_cyc], fmc$key_position, c#dw_kp],
 {} ['KEY_TYPE                       ', [c#ot_cyc], fmc$key_type, c#dw_kt],
 {} ['LAST_ACCESS_DATE_TIME          ', [c#ot_cyc], 0, c#dw_dtm],
 {} ['LAST_DATA_MODIFICATION_TIME    ', [c#ot_cyc], 0, c#dw_dtm],
 {} ['LAST_MODIFICATION_DATE_TIME    ', [c#ot_cyc], 0, c#dw_dtm],
 {} ['LIFETIME                       ', [c#ot_cat, c#ot_fil, c#ot_cyc], 0, c#dw_0],
 {} ['LIFETIME_ATTACHMENT_COUNT      ', [c#ot_cyc], 0, c#dw_byt],
 {} ['LINE_NUMBER                    ', [c#ot_cyc], fmc$line_number, c#dw_ln],
 {} ['LOADING_FACTOR                 ', [c#ot_cyc], fmc$loading_factor, c#dw_lf],
 {} ['LOCK_EXPIRATION_TIME           ', [c#ot_cyc], fmc$lock_expiration_time, c#dw_let],
 {} ['LOG_RESIDENCE                  ', [c#ot_cyc], fmc$log_residence, c#dw_0],
 {} ['LOGGING_OPTIONS                ', [c#ot_cyc], fmc$logging_options, c#dw_std],
 {} ['MAINFRAME_ATTACHMENT           ', [c#ot_cyc], 0, c#dw_std],
 {} ['MAINFRAME_WRITE_CONCURRENCY    ', [c#ot_cyc], 0, c#dw_mwc],
 {} ['MASS_STORAGE_ALLOCATION_SIZE   ', [c#ot_cat, c#ot_cyc], 0, c#dw_msas],
 {} ['MASS_STORAGE_BYTES_ALLOCATED   ', [c#ot_cat, c#ot_cyc], 0, c#dw_byt],
 {} ['MASS_STORAGE_CLASS             ', [c#ot_cat, c#ot_cyc], 0, c#dw_msc],
 {} ['MASS_STORAGE_FREE_BEHIND       ', [c#ot_cyc], 0, c#dw_bln],
 {} ['MASS_STORAGE_INITIAL_VOLUME    ', [c#ot_cyc], 0, c#dw_msiv],
 {} ['MASS_STORAGE_SEQUENTIAL_ACCESS ', [c#ot_cyc], 0, c#dw_bln],
 {} ['MASS_STORAGE_TRANSFER_SIZE     ', [c#ot_cyc], 0, c#dw_seg],
 {} ['MAXIMUM_BLOCK_LENGTH           ', [c#ot_cyc], fmc$max_block_length, c#dw_seg],
 {} ['MAXIMUM_RECORD_LENGTH          ', [c#ot_cyc], fmc$max_record_length, c#dw_byt],
 {} ['MESSAGE_CONTROL                ', [c#ot_cyc], 0, c#dw_std],
 {} ['MINIMUM_BLOCK_LENGTH           ', [c#ot_cyc], fmc$min_block_length, c#dw_seg],
 {} ['MINIMUM_RECORD_LENGTH          ', [c#ot_cyc], fmc$min_record_length, c#dw_byt],
 {} ['OBJECT_TYPE                    ', [c#ot_cat, c#ot_fil, c#ot_cyc], 0, c#dw_ot],
 {} ['OPEN_POSITION                  ', [c#ot_cyc], 0, c#dw_0],
 {} ['PADDING_CHARACTER              ', [c#ot_cyc], fmc$padding_character, c#dw_pc],
 {} ['PAGE_FORMAT                    ', [c#ot_cyc], fmc$page_format, c#dw_pf],
 {} ['PAGE_LENGTH                    ', [c#ot_cyc], fmc$page_length, c#dw_byt],
 {} ['PAGE_WIDTH                     ', [c#ot_cyc], fmc$page_width, c#dw_pw],
 {} ['PASSWORD                       ', [c#ot_fil], 0, c#dw_std],
 {} ['PATH                           ', [c#ot_cat, c#ot_fil, c#ot_cyc], 0, c#dw_std],
 {} ['PERMITTED_ACCESS               ', [c#ot_cat, c#ot_fil], 0, c#dw_0],
 {} ['POTENTIAL_JOB_ACCESS           ', [c#ot_cyc], 0, c#dw_0],
 {} ['PRESET_VALUE                   ', [c#ot_cyc], fmc$preset_value, c#dw_byt],
 {} ['PRIVATE_READ                   ', [c#ot_cyc], 0, c#dw_bln],
 {} ['RECORDED_VSN_LIST              ', [c#ot_cat, c#ot_cyc], 0, c#dw_rvsnl],
 {} ['RECORDS_PER_BLOCK              ', [c#ot_cyc], fmc$records_per_block, c#dw_rpb],
 {} ['RECORD_DELIMITING_CHARACTER    ', [c#ot_cyc], c#rec_delim_char, c#dw_rdc],
 {} ['RECORD_LIMIT                   ', [c#ot_cyc], fmc$record_limit, c#dw_byt],
 {} ['RECORD_TYPE                    ', [c#ot_cyc], fmc$record_type, c#dw_rt],
 {} ['REGISTERED                     ', [c#ot_cat, c#ot_fil, c#ot_cyc], 0, c#dw_bln],
 {} ['REMOVABLE_MEDIA_GROUP          ', [c#ot_cyc], 0, c#dw_std],
 {} ['RETRIEVE_OPTION                ', [c#ot_cyc], 0, c#dw_std],
 {} ['RING_ATTRIBUTES                ', [c#ot_cyc], fmc$ring_attributes, c#dw_ra],
 {} ['SECONDARY_RESIDENCE            ', [c#ot_cyc], 0, c#dw_std],
 {} ['SET_NAME                       ', [c#ot_cat, c#ot_fil, c#ot_cyc], 0, c#dw_std],
 {} ['SHARED_QUEUE                   ', [c#ot_cyc], 0, c#dw_sq],
 {} ['SITE_ARCHIVE_OPTION            ', [c#ot_cyc], 0, c#dw_sa_ord],
 {} ['SITE_BACKUP_OPTION             ', [c#ot_cyc], 0, c#dw_sa_ord],
 {} ['SITE_RELEASE_OPTION            ', [c#ot_cyc], 0, c#dw_sa_ord],
 {} ['SIZE                           ', [c#ot_cat, c#ot_cyc], 0, c#dw_byt],
 {} ['STATEMENT_IDENTIFIER           ', [c#ot_cyc], fmc$statement_identifier, c#dw_si],
 {} ['TAPE_DENSITY                   ', [c#ot_cyc], 0, c#dw_td],
 {} ['UNIQUE_DATA_NAME               ', [c#ot_cat, c#ot_cyc], 0, c#dw_std],
 {} ['UNIQUE_NAME                    ', [c#ot_cat, c#ot_fil, c#ot_cyc], 0, c#dw_std],
 {} ['USER_INFORMATION               ', [c#ot_cyc], fmc$user_info, c#dw_std],
 {} ['VERTICAL_PRINT_DENSITY         ', [c#ot_cyc], fmc$vertical_print_density, c#dw_vpd],
 {} ['VOLUME_OVERFLOW_ALLOWED        ', [c#ot_cat, c#ot_cyc], 0, c#dw_bln]];

?? FMT (FORMAT := ON) ??
?? OLDTITLE ??
?? NEWTITLE := '[xdcl] USP#REPORT_FILES', EJECT ??

  PROCEDURE [XDCL] usp#report_files
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

?? NEWTITLE := 'F#MIN_INTEGER', EJECT ??

    FUNCTION [INLINE] f#min_integer
      (    a: integer,
           b: integer): integer;

      IF a > b THEN
        f#min_integer := b;
      ELSE
        f#min_integer := a;
      IFEND;

    FUNCEND f#min_integer;
?? OLDTITLE ??
?? NEWTITLE := 'P#ADDL_ACCT_PROJ', EJECT ??

    PROCEDURE [INLINE] p#addl_acct_proj
      (    account: avt$account_name;
           project: avt$project_name;
       VAR line: t#string);

      p#addl_string ('(', line);
      p#addl_trim_str (account, line);
      line.size := line.size + 1;
      p#addl_trim_str (project, line);
      p#addl_string (')', line);

    PROCEND p#addl_acct_proj;
?? OLDTITLE ??
?? NEWTITLE := 'P#ADDL_BOOLEAN', EJECT ??

    PROCEDURE [INLINE] p#addl_boolean
      (    boolean_value: boolean;
       VAR line: t#string);

      IF boolean_value THEN
        p#addl_string ('Y', line);
      ELSE
        p#addl_string ('N', line);
      IFEND;

    PROCEND p#addl_boolean;
?? OLDTITLE ??
?? NEWTITLE := 'P#ADDL_DATE_TIME', EJECT ??

    PROCEDURE [INLINE] p#addl_date_time
      (    date_time: ost$date_time;
       VAR line: t#string;
       VAR status: ost$status);

      VAR
        date_string: ost$date,
        time_string: ost$time;

      pmp$format_compact_date (date_time, osc$dmy_date, date_string, status);
      IF status.normal THEN
        p#addl_string (date_string.dmy (1, 8), line);
        pmp$format_compact_time (date_time, osc$hms_time, time_string, status);
      IFEND;
      IF status.normal THEN
        line.size := line.size + 1;
        p#addl_string (time_string.hms (1, 8), line);
      IFEND;
      status.normal := TRUE;

    PROCEND p#addl_date_time;
?? OLDTITLE ??
?? NEWTITLE := 'P#ADDL_ENTRY_POINT', EJECT ??

    PROCEDURE [INLINE] p#addl_entry_point
      (    entry_point: string ( * <= 255);
       VAR line: t#string);

      IF entry_point = osc$null_name THEN
        p#addl_string ('NONE', line);
      ELSE
        p#addl_trim_str (entry_point, line);
      IFEND;

    PROCEND p#addl_entry_point;
?? OLDTITLE ??
?? NEWTITLE := 'P#ADDL_FILL', EJECT ??

    PROCEDURE p#addl_fill
      (    fill_char: string (1);
       VAR width: t#attribute_width;
       VAR line: t#string);

      VAR
        i: ost$halfword;

      width := f#min_integer (width, STRLENGTH (v#blanks));
      IF fill_char = ' ' THEN
        p#addl_string (v#blanks (1, width), line);

      ELSE
        FOR i := 1 TO width DO
          p#addl_string (fill_char, line);
        FOREND;
      IFEND;

    PROCEND p#addl_fill;
?? OLDTITLE ??
?? NEWTITLE := 'P#ADDL_INTEGER', EJECT ??

    PROCEDURE [INLINE] p#addl_integer
      (    integer_value: integer;
       VAR line: t#string;
       VAR status: ost$status);

      status.normal := TRUE;
      clp$convert_integer_to_string (integer_value, 10, FALSE, status.text, status);
      IF status.normal THEN
        p#addl_string (status.text.value (1, status.text.size), line);
      IFEND;

    PROCEND p#addl_integer;
?? OLDTITLE ??
?? NEWTITLE := 'P#ADDL_INTEGER_PAIR', EJECT ??

    PROCEDURE [INLINE] p#addl_integer_pair
      (    int1: integer;
           int2: integer;
       VAR line: t#string;
       VAR status: ost$status);

      p#addl_string ('(', line);
      p#addl_integer (int1, line, status);
      line.size := line.size + 1;
      p#addl_integer (int2, line, status);
      p#addl_string (')', line);

    PROCEND p#addl_integer_pair;
?? OLDTITLE ??
?? NEWTITLE := 'P#ADDL_LIST_START', EJECT ??

    PROCEDURE [INLINE] p#addl_list_start
      (VAR old_line_size: ost$halfword;
       VAR line: t#string);

      old_line_size := line.size;
      p#addl_string ('(', line);

    PROCEND p#addl_list_start;
?? OLDTITLE ??
?? NEWTITLE := 'P#ADDL_LIST_STOP', EJECT ??

    PROCEDURE [INLINE] p#addl_list_stop
      (    old_line_size: ost$halfword;
       VAR line: t#string);

      line.size := line.size - 1;
      IF line.size <> old_line_size THEN
        p#addl_string (')', line);
      IFEND;

    PROCEND p#addl_list_stop;
?? OLDTITLE ??
?? NEWTITLE := 'P#ADDL_RJINTEGER', EJECT ??

    PROCEDURE p#addl_rjinteger
      (    integer_value: integer;
           integer_size: 1 .. osc$max_string_size;
       VAR line: t#string;
       VAR status: ost$status);

      clp$convert_integer_to_rjstring (integer_value, 10, FALSE, ' ', status.text.value (1, integer_size),
            status);
      IF status.normal THEN
        p#addl_string (status.text.value (1, integer_size), line);
      ELSE
        p#addl_string (v#asterisks (1, integer_size), line);
      IFEND;

    PROCEND p#addl_rjinteger;
?? OLDTITLE ??
?? NEWTITLE := 'P#ADDL_STRING', EJECT ??

    PROCEDURE [INLINE] p#addl_string
      (    str: string ( * );
       VAR line: t#string);

      VAR
        length: integer;

      length := STRLENGTH (str);
      IF line.size + length <= c#max_string_size THEN
        line.value (line.size + 1, length) := str;
        line.size := line.size + length;
      IFEND;

    PROCEND p#addl_string;
?? OLDTITLE ??
?? NEWTITLE := 'P#ADDL_TRIM_STR', EJECT ??

    PROCEDURE [INLINE] p#addl_trim_str
      (    str: string ( * <= 512);
       VAR line: t#string);

      VAR
        blank: string (1),
        last: t#string_size;

      last := STRLENGTH (str);
      blank := ' ';

      IF str (1) <> blank THEN
        WHILE (str (last) = blank) DO
          last := last - 1;
        WHILEND;
      ELSE
        WHILE (last > 0) AND (str (last) = blank) DO
          last := last - 1;
        WHILEND;
      IFEND;

      p#addl_string (str (1, last), line);

    PROCEND p#addl_trim_str;
?? OLDTITLE ??
?? NEWTITLE := 'P#ADJUST_LINE_SIZE', EJECT ??

    PROCEDURE [INLINE] p#adjust_line_size
      (    line_size_old: ost$halfword;
           width: ost$halfword;
       VAR line: t#string);

{Adjust LINE to LINE_SIZE_OLD+WIDTH, blanking out any excess.

      VAR
        line_size_new: ost$halfword;

      line_size_new := line_size_old + width;
      IF line_size_new <= c#max_string_size THEN
        IF line.size > line_size_new THEN
          line.value (line_size_new + 1, line.size - line_size_new) := ' ';
        IFEND;
        line.size := line_size_new;
      IFEND;

    PROCEND p#adjust_line_size;
?? OLDTITLE ??
?? NEWTITLE := 'DETERMINE_OBJECT_INFO_REQUESTS', EJECT ??

    PROCEDURE determine_object_info_requests
      (    attrs_req: t#file_attribute_keys;
       VAR info_req: {input, output} fst$goi_object_info_requests);

      VAR
        catalog_and_cycle_identity: [READ, s#sec1] t#file_attribute_keys :=
              [c#fa_device_class, c#fa_lifetime, c#fa_object_type, c#fa_path, c#fa_registered, c#fa_set_name,
              c#fa_unique_data_name, c#fa_unique_name],
        catalog_device_attributes: [READ, s#sec1] t#file_attribute_keys :=
              [c#fa_exception_conditions, c#fa_ms_allocation_size, c#fa_ms_bytes_allocated, c#fa_ms_class,
              c#fa_recorded_vsn_list],
        cycle_info: [READ, s#sec1] t#file_attribute_keys :=
              [c#fa_creation_date_time, c#fa_exception_conditions, c#fa_expiration_date,
              c#fa_last_access_date_time, c#fa_last_data_mod_time, c#fa_last_mod_date_time,
              c#fa_lifetime_attachment_count, c#fa_mainframe_attachment, c#fa_mf_write_concurrency,
              c#fa_potential_job_access, c#fa_retrieve_option, c#fa_site_archive_option,
              c#fa_site_backup_option, c#fa_site_release_option],
        device_info: [READ, s#sec1] t#file_attribute_keys :=
              [c#fa_exception_conditions, c#fa_external_vsn_list, c#fa_file_label_type,
              c#fa_ms_allocation_size, c#fa_ms_bytes_allocated, c#fa_ms_class, c#fa_ms_initial_volume,
              c#fa_ms_transfer_size, c#fa_maximum_block_length, c#fa_recorded_vsn_list, c#fa_shared_queue,
              c#fa_tape_density, c#fa_volume_overflow_allowed],
        file_info: [READ, s#sec1] t#file_attribute_keys := [c#fa_attachment_log, c#fa_attachment_logging_sel],
        job_environment_info: [READ, s#sec1] t#file_attribute_keys :=
              [c#fa_actual_job_access, c#fa_attached, c#fa_attached_external_vsn_list,
              c#fa_attached_recorded_vsn_list, c#fa_attached_transfer_size, c#fa_attached_vol_oflo_allowed,
              c#fa_attached_volume_number, c#fa_connected_files, c#fa_error_exit_procedure_name,
              c#fa_error_limit, c#fa_job_file_address, c#fa_job_file_position, c#fa_job_instances_of_open,
              c#fa_job_write_concurrency, c#fa_ms_free_behind, c#fa_ms_sequential_access,
              c#fa_message_control, c#fa_open_position, c#fa_potential_job_access, c#fa_private_read];

      IF (catalog_and_cycle_identity * attrs_req) <> $t#file_attribute_keys [] THEN
        info_req := info_req + $fst$goi_object_info_requests
              [fsc$goi_catalog_identity, fsc$goi_cycle_identity];
      IFEND;
      IF (cycle_info * attrs_req) <> $t#file_attribute_keys [] THEN
        info_req := info_req + $fst$goi_object_info_requests [fsc$goi_cycle_info];
      IFEND;
      IF (device_info * attrs_req) <> $t#file_attribute_keys [] THEN
        info_req := info_req + $fst$goi_object_info_requests [fsc$goi_cycle_device_info];
        IF (catalog_device_attributes * attrs_req) <> $t#file_attribute_keys [] THEN
          info_req := info_req + $fst$goi_object_info_requests [fsc$goi_catalog_device_info];
        IFEND;
      IFEND;
      IF (file_label_attributes * attrs_req) <> $t#file_attribute_keys [] THEN
        info_req := info_req + $fst$goi_object_info_requests [fsc$goi_file_label];
      IFEND;
      IF (job_environment_info * attrs_req) <> $t#file_attribute_keys [] THEN
        info_req := info_req + $fst$goi_object_info_requests [fsc$goi_job_environment_info];
        IF c#fa_potential_job_access IN attrs_req THEN
          info_req := info_req + $fst$goi_object_info_requests
                [fsc$goi_applicable_file_permit, fsc$goi_file_label];
        IFEND;
      IFEND;

      IF c#fa_access_control_list IN attrs_req THEN
        info_req := info_req + $fst$goi_object_info_requests [fsc$goi_catalog_permits, fsc$goi_file_permits];
      IFEND;
      IF c#fa_account_project IN attrs_req THEN
        info_req := info_req + $fst$goi_object_info_requests [fsc$goi_catalog_info, fsc$goi_file_info];
      IFEND;
      IF c#fa_attachment_log IN attrs_req THEN
        info_req := info_req + $fst$goi_object_info_requests [fsc$goi_file_log];
      IFEND;
      IF c#fa_attachment_logging_sel IN attrs_req THEN
        info_req := info_req + $fst$goi_object_info_requests [fsc$goi_file_info];
      IFEND;
      IF c#fa_creation_date_time IN attrs_req THEN
        info_req := info_req + $fst$goi_object_info_requests [fsc$goi_catalog_info, fsc$goi_cycle_info];
      IFEND;
      IF c#fa_cycle_number IN attrs_req THEN
        info_req := info_req + $fst$goi_object_info_requests [fsc$goi_cycle_identity];
      IFEND;
      IF c#fa_permitted_access IN attrs_req THEN
        info_req := info_req + $fst$goi_object_info_requests
              [fsc$goi_applicable_cat_permit, fsc$goi_applicable_file_permit];
      IFEND;
      IF ((c#fa_secondary_residence IN attrs_req) OR (c#fa_archive_media_descriptor IN attrs_req) OR
            (c#fa_archive_tape_vsn_list IN attrs_req)) THEN
        info_req := info_req + $fst$goi_object_info_requests [fsc$goi_archive_info];
      IFEND;
      IF c#fa_set_name IN attrs_req THEN
        info_req := info_req + $fst$goi_object_info_requests [fsc$goi_set_name];
      IFEND;
      IF c#fa_size IN attrs_req THEN
        info_req := info_req + $fst$goi_object_info_requests [fsc$goi_catalog_size, fsc$goi_cycle_size];
      IFEND;

    PROCEND determine_object_info_requests;
?? OLDTITLE ??
?? NEWTITLE := 'DETERMINE_REQUESTED_ATTRIBUTES', EJECT ??

    PROCEDURE determine_requested_attributes
      (    data_value_p: ^clt$data_value;
       VAR attrs_info_p: ^t#attribute_infos;
       VAR attrs_req: t#file_attribute_keys;
       VAR attrs_req_n: t#object_type_counts;
       VAR file_label_attrs: t#file_attribute_keys_set;
       VAR status: ost$status);

      VAR
        attr_name: ost$name,
        attr_i: ost$halfword,
        attrs_info_i: ost$halfword,
        highest_attr_i: ost$halfword,
        seq_p: ^SEQ ( * ),
        table_i: ost$halfword,
        width_value_p: ^clt$data_value,
        value_p: ^clt$data_value;

?? NEWTITLE := 'GET_ATTRIBUTE_INDEX', EJECT ??

      PROCEDURE [INLINE] get_attribute_index
        (    attr_name: ost$name;
         VAR attr_i: ost$halfword);

{Returns ATTRS_INFO[ATTR_I].NAME = ATTR_NAME (or 0 if no match).

        VAR
          first: ost$halfword,
          last: ost$halfword,
          medium: ost$halfword;

        first := 1;
        last := UPPERBOUND (v#attrs_info);
        WHILE (first <> last) DO
          medium := first + last; {So CYBIL generates a SHIFT vs. DIV!
          medium := medium DIV 2;
          IF v#attrs_info [medium].name >= attr_name THEN
            last := medium;
          ELSE
            first := medium + 1;
          IFEND;
        WHILEND;

        IF v#attrs_info [first].name = attr_name THEN
          attr_i := first;
        ELSE
          attr_i := 0;
        IFEND;

      PROCEND get_attribute_index;
?? OLDTITLE ??
?? EJECT ?? {determine_requested_attributes

      attrs_info_i := 0;
      attrs_req_n.catalog_type := 0;
      attrs_req_n.file_type := 0;
      attrs_req_n.cycle_type := 0;
      attrs_req := $t#file_attribute_keys [];
      file_label_attrs := $t#file_attribute_keys_set [];
      highest_attr_i := 1;

      value_p := data_value_p;
      WHILE value_p <> NIL DO

        attr_name := value_p^.element_value^.field_values^ [1].value^.keyword_value;

        get_attribute_index (attr_name, attr_i);
        IF attr_i = 0 THEN
          osp$set_status_condition (e#unknown_attribute, status);
          RETURN; {----->
        IFEND;

        attrs_req := attrs_req + $t#file_attribute_keys [attr_i];
        attrs_info_i := attrs_info_i + 1;
        attrs_info_p^ [attrs_info_i].attr := attr_i;
        width_value_p := value_p^.element_value^.field_values^ [2].value;
        IF width_value_p = NIL THEN {not specified
          attrs_info_p^ [attrs_info_i].width := v#attrs_info [attr_i].default_width;
        ELSE
          attrs_info_p^ [attrs_info_i].width := width_value_p^.integer_value.value;
        IFEND;

        IF v#attrs_info [attr_i].file_label_attr <> 0 THEN
          file_label_attrs := file_label_attrs + $t#file_attribute_keys_set
                [v#attrs_info [attr_i].file_label_attr];
        IFEND;
        IF attr_i > highest_attr_i THEN
          highest_attr_i := attr_i;
        IFEND;

        value_p := value_p^.link;
      WHILEND;

      seq_p := #SEQ (attrs_info_p^);
      NEXT attrs_info_p: [1 .. attrs_info_i] IN seq_p;
      IF attrs_req <> $t#file_attribute_keys [] THEN
        FOR attr_i := 1 TO highest_attr_i DO
          IF attr_i IN attrs_req THEN
            IF (c#ot_cat IN v#attrs_info [attr_i].applicable_object_types) THEN
              attrs_req_n.catalog_type := attrs_req_n.catalog_type + 1;
            IFEND;
            IF (c#ot_cyc IN v#attrs_info [attr_i].applicable_object_types) THEN
              attrs_req_n.cycle_type := attrs_req_n.cycle_type + 1;
            IFEND;
            IF (c#ot_fil IN v#attrs_info [attr_i].applicable_object_types) THEN
              attrs_req_n.file_type := attrs_req_n.file_type + 1;
            IFEND;
          IFEND;
        FOREND;
      IFEND;

    PROCEND determine_requested_attributes;
?? OLDTITLE ??
?? NEWTITLE := 'PROCESS_CATALOG_ENTRY', EJECT ??

    PROCEDURE process_catalog_entry
      (    obj: fst$goi_object;
           object_info_p: ^fst$goi_object_information;
           attrs_info_p: ^t#attribute_infos;
       VAR line: t#string;
       VAR status: ost$status);

      VAR
        attr_i: ost$halfword,
        char_str: string (1),
        gfn: ost$name,
        line_size_o: ost$halfword,
        old_line_size: ost$halfword,
        vol_i: ost$halfword,
        vol_list_p: ^rmt$volume_list,
        rj_w: t#attribute_width,
        width: t#attribute_width;

      FOR attr_i := 1 TO UPPERBOUND (attrs_info_p^) DO
        line_size_o := line.size;
        width := attrs_info_p^ [attr_i].width;
        rj_w := width;
        CASE attrs_info_p^ [attr_i].attr OF

        = c#fa_access_control_list =

        = c#fa_account_project =
          IF obj.catalog_information <> NIL THEN
            p#addl_acct_proj (obj.catalog_information^.account, obj.catalog_information^.project, line);
          IFEND;

        = c#fa_actual_job_access =
        = c#fa_archive_media_descriptor =
        = c#fa_archive_tape_vsn_list =
        = c#fa_attached =
        = c#fa_attached_external_vsn_list =
        = c#fa_attached_recorded_vsn_list =
        = c#fa_attached_transfer_size =
        = c#fa_attached_vol_oflo_allowed =
        = c#fa_attached_volume_number =
        = c#fa_attachment_log =
        = c#fa_attachment_logging_sel =
        = c#fa_average_record_length =
        = c#fa_block_type =
        = c#fa_character_conversion =
        = c#fa_collate_table_name =
        = c#fa_compression_procedure_name =
        = c#fa_connected_files =

        = c#fa_creation_date_time =
          IF obj.catalog_information <> NIL THEN
            p#addl_date_time (obj.catalog_information^.creation_date_time, line, status);
          IFEND;

        = c#fa_cycle_number =
        = c#fa_data_padding =

        = c#fa_device_class =
          p#addl_string ('MASS_STORAGE', line);

        = c#fa_dynamic_home_block_space =
        = c#fa_embedded_key =
        = c#fa_error_exit_procedure_name =
        = c#fa_error_limit =
        = c#fa_estimated_record_count =
        = c#fa_exception_conditions =

        = c#fa_expiration_date =
        = c#fa_external_vsn_list =
        = c#fa_file_access_procedure_name =
        = c#fa_file_contents =
        = c#fa_file_label_type =
        = c#fa_file_limit =
        = c#fa_file_name =
        = c#fa_file_organization =
        = c#fa_file_previously_opened =
        = c#fa_file_processor =
        = c#fa_file_residency =

        = c#fa_fill =
          p#addl_fill (fill_char, width, line);

        = c#fa_forced_write =
        = c#fa_full_path =
        = c#fa_hashing_procedure_name =
        = c#fa_index_levels =
        = c#fa_index_padding =
        = c#fa_initial_home_block_count =
        = c#fa_internal_code =
        = c#fa_job_file_address =
        = c#fa_job_file_position =
        = c#fa_job_instances_of_open =
        = c#fa_job_write_concurrency =
        = c#fa_key_length =
        = c#fa_key_position =
        = c#fa_key_type =
        = c#fa_last_access_date_time =
        = c#fa_last_data_mod_time =
        = c#fa_last_mod_date_time =
        = c#fa_lifetime =

        = c#fa_lifetime_attachment_count =
        = c#fa_line_number =
        = c#fa_loading_factor =
        = c#fa_lock_expiration_time =
        = c#fa_log_residence =
        = c#fa_logging_options =
        = c#fa_mainframe_attachment =
        = c#fa_maximum_block_length =
        = c#fa_maximum_record_length =
        = c#fa_message_control =
        = c#fa_mf_write_concurrency =
        = c#fa_minimum_block_length =
        = c#fa_minimum_record_length =

        = c#fa_ms_allocation_size =
          IF obj.catalog_device_information <> NIL THEN
            p#addl_rjinteger (obj.catalog_device_information^.mass_storage_device_info.allocation_unit_size,
                  rj_w, line, status);
          IFEND;

        = c#fa_ms_bytes_allocated =
          IF obj.catalog_device_information <> NIL THEN
            p#addl_rjinteger (obj.catalog_device_information^.mass_storage_device_info.bytes_allocated, rj_w,
                  line, status);
          IFEND;

        = c#fa_ms_class =
          IF obj.catalog_device_information <> NIL THEN
            char_str := obj.catalog_device_information^.mass_storage_device_info.mass_storage_class;
            p#addl_string (char_str, line);
          ELSE
          IFEND;

        = c#fa_ms_free_behind =
        = c#fa_ms_initial_volume =
        = c#fa_ms_sequential_access =
        = c#fa_ms_transfer_size =

        = c#fa_object_type =
          p#addl_string ('CATALOG', line);

        = c#fa_open_position =
        = c#fa_padding_character =
        = c#fa_page_format =
        = c#fa_page_length =
        = c#fa_page_width =
        = c#fa_password =
        = c#fa_path =

        = c#fa_permitted_access =

        = c#fa_potential_job_access =
        = c#fa_preset_value =
        = c#fa_private_read =
        = c#fa_record_delimiting_char =
        = c#fa_record_limit =
        = c#fa_record_type =

        = c#fa_recorded_vsn_list =
          IF obj.catalog_device_information <> NIL THEN
            p#addl_list_start (old_line_size, line);
            vol_list_p := obj.catalog_device_information^.mass_storage_device_info.volume_list;
            FOR vol_i := 1 TO UPPERBOUND (vol_list_p^) DO
              p#addl_trim_str (vol_list_p^ [vol_i].recorded_vsn, line);
              line.size := line.size + 1;
            FOREND;
            p#addl_list_stop (old_line_size, line);
          IFEND;

        = c#fa_records_per_block =
        = c#fa_registered =
          p#addl_boolean (TRUE, line);

        = c#fa_removable_media_group =
        = c#fa_retrieve_option =
        = c#fa_ring_attributes =
        = c#fa_secondary_residence =

        = c#fa_set_name =
          p#addl_string (object_info_p^.set_name, line);

        = c#fa_shared_queue =
        = c#fa_site_archive_option =
        = c#fa_site_backup_option =
        = c#fa_site_release_option =

        = c#fa_size =
          IF obj.catalog_size <> NIL THEN
            p#addl_rjinteger (obj.catalog_size^, rj_w, line, status);
          ELSE
          IFEND;

        = c#fa_statement_identifier =
        = c#fa_tape_density =

        = c#fa_unique_data_name, c#fa_unique_name =
          pmp$convert_binary_unique_name (obj.catalog_global_file_name, gfn, status);
          p#addl_string (gfn, line);
          status.normal := TRUE;

        = c#fa_user_information =
        = c#fa_vertical_print_density =

        = c#fa_volume_overflow_allowed =
          p#addl_boolean (FALSE, line);

        CASEND;
        p#adjust_line_size (line_size_o, width, line);
      FOREND;

    PROCEND process_catalog_entry;
?? OLDTITLE ??
?? NEWTITLE := 'PROCESS_CYCLE_ENTRY', EJECT ??

    PROCEDURE process_cycle_entry
      (    obj: fst$goi_object;
           object_info_p: ^fst$goi_object_information;
           file_obj_p: ^fst$goi_object;
           attrs_info_p: ^t#attribute_infos;
           file_label_attrs: t#file_attribute_keys_set;
       VAR file_kind: t#file_kind;
       VAR line: t#string;
       VAR status: ost$status);

      VAR
        max_date_time: [READ, s#sec1] ost$date_time := [255, 12, 31, 23, 59, 59, 999];

      VAR
        attr_i: ost$halfword,
        char_str: string (1),
        combined_file_contents: amt$file_contents,
        cycle_info_p: ^fst$goi_cycle_information,
        cycle_dev_info_p: ^fst$device_information,
        device_class_ms: boolean,
        device_class_mt: boolean,
        file_info_p: ^fst$goi_file_information,
        gfn: ost$name,
        job_env_info_p: ^fst$job_environment_information,
        label_attrs: bat$static_label_attributes,
        line_size_o: ost$halfword,
        log_opt_i: amt$logging_possibilities,
        mc_i: amc$trivial_errors .. amc$statistics,
        mf_att_i: fst$mf_usage_concurrency_scope,
        non_nil_cycle_dev_info: boolean,
        non_nil_cycle_info: boolean,
        non_nil_job_env_info: boolean,
        old_line_size: ost$halfword,
        previously_opened: boolean,
        target_device_class: rmt$device_class,
        rj_w: t#attribute_width,
        width: t#attribute_width;

?? NEWTITLE := 'F#RESIDES_ONLINE', EJECT ??

      FUNCTION [INLINE] f#resides_online
        (    device_class_ms: boolean;
             non_nil_cycle_dev_info: boolean;
             obj: fst$goi_object): boolean;

        f#resides_online := ((device_class_ms) AND (non_nil_cycle_dev_info) AND
              obj.cycle_device_information^.mass_storage_device_info.resides_online);

      FUNCEND f#resides_online;
?? OLDTITLE ??
?? NEWTITLE := 'add_actual_job_access', EJECT ??

      PROCEDURE add_actual_job_access;

        VAR
          fao_i: fst$file_access_option;

        IF obj.job_environment_information <> NIL THEN
          p#addl_string ('(AM=(', line);
          IF obj.job_environment_information^.attached_access_modes = $fst$file_access_options [] THEN
            p#addl_string ('NONE', line);
          ELSE
            FOR fao_i := LOWERVALUE (fao_i) TO UPPERVALUE (fao_i) DO
              IF fao_i IN obj.job_environment_information^.attached_access_modes THEN
                p#addl_string (access_share_modes [fao_i]^, line);
                line.size := line.size + 1;
              IFEND;
            FOREND;
            line.size := line.size - 1;
          IFEND;
          p#addl_string (') ', line);

          p#addl_string ('(SM=(', line);
          IF obj.job_environment_information^.attached_share_modes = $fst$file_access_options [] THEN
            p#addl_string ('NONE', line);
          ELSE
            FOR fao_i := LOWERVALUE (fao_i) TO UPPERVALUE (fao_i) DO
              IF fao_i IN obj.job_environment_information^.attached_access_modes THEN
                p#addl_string (access_share_modes [fao_i]^, line);
                line.size := line.size + 1;
              IFEND;
            FOREND;
            line.size := line.size - 1;
          IFEND;
          p#addl_string ('))', line);
        IFEND;

      PROCEND add_actual_job_access;
?? OLDTITLE ??
?? NEWTITLE := 'ADD_ARCHIVE_MEDIA_DESC', EJECT ??

      PROCEDURE add_archive_media_desc
        (    obj: fst$goi_object;
         VAR status: ost$status);

        VAR
          entry_i: ost$halfword,
          entry_p: ^pft$archive_array_entry;

        IF (obj.archive_information_list <> NIL) THEN
          FOR entry_i := 1 TO UPPERBOUND (obj.archive_information_list^) DO
            entry_p := ^obj.archive_information_list^ [entry_i].archive_entry;
            p#addl_date_time (entry_p^.archive_date_time, line, status);
            line.size := line.size + 1;
            p#addl_string (entry_p^.archive_identification.application_identifier, line);
            line.size := line.size + 1;
            p#addl_string (entry_p^.archive_identification.media_identifier.media_volume_identifier, line);
            line.size := line.size + 1;
          FOREND;
        IFEND;

      PROCEND add_archive_media_desc;
?? OLDTITLE ??
?? NEWTITLE := 'ADD_ARCHIVE_TAPE_VSN_LIST', EJECT ??

      PROCEDURE add_archive_tape_vsn_list
        (    obj: fst$goi_object;
         VAR status: ost$status);

        TYPE
          t#afmd_descriptor = record
            legible_media_descriptors_r: REL (SEQ ( * )) ^t#legible_media_descriptors,
            media_container_r: REL (SEQ ( * )) ^SEQ ( * ),
            case kind: 0 .. 0ff(16) of
            = 0 =
              version: 0 .. 15, {art$system_descriptor_version
            = 1 =
            casend,
          recend,
          t#legible_media_descriptors = array [1 .. * ] of t#legible_media_descriptor,
          t#legible_media_descriptor = string (osc$max_name_size),
          t#system_media_container = record
            kind: 0 .. 0ff(16), {art$media_container_kind
            media_container: SEQ ( * ), {art$media_container
          recend,
          t#system_tape_container = SEQ ( * ),
          t#system_tape_descriptor = t#system_tape_descriptor_v3,
          t#system_tape_descriptor_v3 = record
            version: 0 .. 15, {art$tape_descriptor_version
            tape_media_status: t#tape_media_status,
            file_position: t#relative_file_position,
            original_path_name_r: REL (SEQ ( * )) ^pft$path,
            original_cycle_number: fst$cycle_number,
            number_of_tapes: t#number_of_media,
            case source: t#tape_descriptor_source of
            = c#system_tape_descriptor =
              class: 0 .. 0ff(16), {art$tape_class
              density: 0 .. 0ff(16), {art$density
              system_supplied_r: REL (SEQ ( * )) ^rmt$volume_list,
            = c#site_tape_descriptor =
              site_supplied: integer,
            casend,
          recend,
          t#tape_media_status = set of t#tape_media_condition,
          t#tape_media_condition = (c#tape_media_condition_1, c#tape_media_condition_2,
                c#tape_media_condition_3, c#tape_media_condition_4, c#tape_media_condition_5,
                c#tape_media_condition_6, c#tape_media_condition_7, c#tape_media_condition_8),
          t#relative_file_position = 0 .. 0ffff(16),
          t#number_of_media = 0 .. 100,
          t#tape_descriptor_source = (c#system_tape_descriptor, c#site_tape_descriptor);

        VAR
          afmd_container_p: pft$p_amd,
          afmd_desc_p: ^t#afmd_descriptor,
          entry_i: ost$halfword,
          legible_media_descrs_p: ^t#legible_media_descriptors,
          media_container_p: ^SEQ ( * ),
          old_line_size: ost$halfword,
          path_p: ^pft$path,
          sys_container_n: integer,
          sys_container_p: ^t#system_media_container,
          sys_tape_desc_p: ^t#system_tape_descriptor_v3,
          sys_tape_list_p: ^rmt$volume_list,
          vol_i: ost$halfword;

        IF (obj.archive_information_list <> NIL) THEN
          FOR entry_i := 1 TO UPPERBOUND (obj.archive_information_list^) DO
            afmd_container_p := obj.archive_information_list^ [entry_i].amd;
            NEXT afmd_desc_p IN afmd_container_p;
            legible_media_descrs_p := #PTR (afmd_desc_p^.legible_media_descriptors_r, afmd_container_p^);
            media_container_p := #PTR (afmd_desc_p^.media_container_r, afmd_container_p^);
            sys_container_n := #SIZE (media_container_p^) - 1;
            NEXT sys_container_p: [[REP sys_container_n OF cell]] IN media_container_p;
            media_container_p := ^sys_container_p^.media_container;
            NEXT sys_tape_desc_p IN media_container_p;
            path_p := #PTR (sys_tape_desc_p^.original_path_name_r, media_container_p^);
            sys_tape_list_p := #PTR (sys_tape_desc_p^.system_supplied_r, media_container_p^);
            p#addl_list_start (old_line_size, line);
            FOR vol_i := 1 TO UPPERBOUND (sys_tape_list_p^) DO
              p#addl_trim_str (sys_tape_list_p^ [vol_i].recorded_vsn, line);
              line.size := line.size + 1;
            FOREND;
            p#addl_list_stop (old_line_size, line);
            line.size := line.size + 1;
          FOREND;
          line.size := line.size - 1;
        IFEND;

      PROCEND add_archive_tape_vsn_list;
?? OLDTITLE ??
?? NEWTITLE := 'ADD_RECORDED_VSN_LIST', EJECT ??

      PROCEDURE add_recorded_vsn_list
        (VAR line: t#string);

        VAR
          vol_i: ost$halfword,
          old_line_size: ost$halfword;

        IF non_nil_cycle_dev_info THEN
          IF (device_class_mt) AND (obj.cycle_device_information^.magnetic_tape_device_info.volume_list <>
                NIL) THEN
            make_list_of_recorded_vsns (obj.cycle_device_information^.magnetic_tape_device_info.volume_list);

          ELSEIF (device_class_ms) AND obj.cycle_device_information^.mass_storage_device_info.
                resides_online AND (obj.cycle_device_information^.mass_storage_device_info.volume_list <> NIL)
                THEN
            p#addl_list_start (old_line_size, line);
            FOR vol_i := 1 TO UPPERBOUND (obj.cycle_device_information^.mass_storage_device_info.volume_list^)
                  DO
              p#addl_trim_str (obj.cycle_device_information^.mass_storage_device_info.volume_list^ [vol_i].
                    recorded_vsn, line);
              line.size := line.size + 1;
            FOREND;
            p#addl_list_stop (old_line_size, line);
          IFEND;
        IFEND;

      PROCEND add_recorded_vsn_list;
?? OLDTITLE ??
?? NEWTITLE := 'ADD_RETRIEVE_OPTION', EJECT ??

      PROCEDURE add_retrieve_option
        (    cycle_info_p: ^fst$goi_cycle_information;
         VAR status: ost$status);

        IF (cycle_info_p <> NIL) THEN
          CASE cycle_info_p^.retrieve_option OF
          = pfc$always_retrieve =
            p#addl_string ('ALWAYS_RETRIEVE', line);

          = pfc$explicit_retrieve_only =
            p#addl_string ('EXPLICIT_RETRIEVE_ONLY', line);

          = pfc$admin_retrieve_only =
            p#addl_string ('ADMINISTRATIVE_RETRIEVE_ONLY', line);

          ELSE
            p#addl_string ('UNKNOWN_RETRIEVE_OPTION', line);
          CASEND;

        ELSE {NIL cycle_info_p
          p#addl_string ('UNKNOWN_RETRIEVE_OPTION', line);
        IFEND;

      PROCEND add_retrieve_option;
?? OLDTITLE ??
?? NEWTITLE := 'ADD_SECONDARY_RESIDENCE', EJECT ??

      PROCEDURE add_secondary_residence
        (    obj: fst$goi_object;
         VAR status: ost$status);

        VAR
          zero_date_time: [READ, s#sec1] ost$date_time := [0, 1, 1, 0, 0, 0, 0];

        VAR
          condition_str: ost$string,
          entry_i: ost$halfword,
          entry_p: ^pft$archive_array_entry;

        IF (obj.archive_information_list <> NIL) THEN
          FOR entry_i := 1 TO UPPERBOUND (obj.archive_information_list^) DO
            entry_p := ^obj.archive_information_list^ [entry_i].archive_entry;
            p#addl_string (entry_p^.archive_identification.media_identifier.media_device_class, line);
            line.size := line.size + 1;
            p#addl_date_time (entry_p^.archive_date_time, line, status);
            line.size := line.size + 1;
            p#addl_date_time (entry_p^.modification_date_time, line, status);
            line.size := line.size + 1;
            IF entry_p^.last_retrieval_status.retrieval_date_time = zero_date_time THEN
              p#addl_string ('NONE', line);
            ELSE
              p#addl_date_time (entry_p^.last_retrieval_status.retrieval_date_time, line, status);
            IFEND;
            line.size := line.size + 1;
            p#addl_boolean (entry_p^.last_retrieval_status.normal, line);
            line.size := line.size + 1;
            IF NOT entry_p^.last_retrieval_status.normal THEN
              osp$get_status_condition_string (entry_p^.last_retrieval_status.condition, condition_str,
                    status);
              p#addl_string (condition_str.value (1, condition_str.size), line);
            ELSE
              line.size := line.size + 8;
            IFEND;
            p#addl_rjinteger (entry_p^.file_size, 15, line, status);
            line.size := line.size + 1;
          FOREND;
        IFEND;

      PROCEND add_secondary_residence;
?? OLDTITLE ??
?? NEWTITLE := 'ADD_SITE_ATTRIBUTE_ORDINAL', EJECT ??

      PROCEDURE add_site_attribute_ordinal
        (    cycle_info_p: ^fst$goi_cycle_information;
             sa_index: t#site_attr_ordinal_indexes;
         VAR status: ost$status);

        VAR
          sa_ordinal_p: ^0 .. 0ff(16);

        IF (cycle_info_p <> NIL) THEN
          CASE sa_index OF
          = c#saoi_archive_option =
            sa_ordinal_p := ^cycle_info_p^.site_archive_option;
          = c#saoi_backup_option =
            sa_ordinal_p := ^cycle_info_p^.site_backup_option;
          = c#saio_release_option =
            sa_ordinal_p := ^cycle_info_p^.site_release_option;
          CASEND;

          p#addl_rjinteger (sa_ordinal_p^, 4, line, status);


        ELSE {NIL cycle_info_p
          p#addl_string ('NULL', line);
        IFEND;

      PROCEND add_site_attribute_ordinal;
?? OLDTITLE ??
?? NEWTITLE := 'MAKE_LIST_OF_EXTERNAL_VSNS', EJECT ??

      PROCEDURE make_list_of_external_vsns
        (    vol_list_p: ^rmt$volume_list);

        VAR
          vol_i: ost$halfword;

        IF vol_list_p = NIL THEN

        ELSEIF vol_list_p^ [1].external_vsn = ' ' THEN
          p#addl_string ('()', line);

        ELSE
          p#addl_string ('(', line);
          FOR vol_i := 1 TO UPPERBOUND (vol_list_p^) DO
            p#addl_trim_str (vol_list_p^ [vol_i].external_vsn, line);
            line.size := line.size + 1;
          FOREND;
          line.size := line.size - 1;
          p#addl_string (')', line);
        IFEND;

      PROCEND make_list_of_external_vsns;
?? OLDTITLE ??
?? NEWTITLE := 'MAKE_LIST_OF_RECORDED_VSNS', EJECT ??

      PROCEDURE make_list_of_recorded_vsns
        (    vol_list_p: ^rmt$volume_list);

        VAR
          vol_i: ost$halfword;

        IF vol_list_p = NIL THEN

        ELSEIF vol_list_p^ [1].recorded_vsn = ' ' THEN
          p#addl_string ('()', line);

        ELSE
          p#addl_string ('(', line);
          FOR vol_i := 1 TO UPPERBOUND (vol_list_p^) DO
            p#addl_trim_str (vol_list_p^ [vol_i].recorded_vsn, line);
            line.size := line.size + 1;
          FOREND;
          line.size := line.size - 1;
          p#addl_string (')', line);
        IFEND;

      PROCEND make_list_of_recorded_vsns;
?? OLDTITLE ??
?? EJECT ?? {process_cycle_entry

      device_class_mt := (obj.cycle_device_class = rmc$magnetic_tape_device);
      device_class_ms := (obj.cycle_device_class = rmc$mass_storage_device);
      cycle_info_p := obj.cycle_information;
      cycle_dev_info_p := obj.cycle_device_information;
      file_info_p := file_obj_p^.file_information;
      job_env_info_p := obj.job_environment_information;
      non_nil_cycle_info := (cycle_info_p <> NIL);
      non_nil_cycle_dev_info := (cycle_dev_info_p <> NIL);
      non_nil_job_env_info := (job_env_info_p <> NIL);

      IF ((file_label_attributes * attrs_req) <> $t#file_attribute_keys []) OR
            (c#fa_potential_job_access IN attrs_req) THEN
        fsp$expand_file_label (obj.file_label, label_attrs, previously_opened, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;

        IF (NOT previously_opened) AND (device_class_mt) AND
              (($t#file_attribute_keys [c#fa_file_label_type, c#fa_maximum_block_length] * attrs_req) <>
              $t#file_attribute_keys []) AND (non_nil_cycle_dev_info) THEN
          fsp$adjust_tape_defaults (cycle_dev_info_p^.magnetic_tape_device_info.density, label_attrs);
        IFEND;
      IFEND;

      IF device_class_mt THEN
        file_kind := c#fk_tape_volume;
      ELSEIF f#resides_online (device_class_ms, non_nil_cycle_dev_info, obj) THEN
        file_kind := c#fk_disk_file;
      ELSE
        file_kind := c#fk_archived_disk_file;
      IFEND;

      FOR attr_i := 1 TO UPPERBOUND (attrs_info_p^) DO
        line_size_o := line.size;
        width := attrs_info_p^ [attr_i].width;
        rj_w := width;
        CASE attrs_info_p^ [attr_i].attr OF

        = c#fa_access_control_list =

        = c#fa_account_project =
          IF file_info_p <> NIL THEN
            p#addl_acct_proj (file_info_p^.account, file_info_p^.project, line);
          IFEND;

        = c#fa_actual_job_access =
          add_actual_job_access;

        = c#fa_archive_media_descriptor =
          add_archive_media_desc (obj, status);

        = c#fa_archive_tape_vsn_list =
          add_archive_tape_vsn_list (obj, status);

        = c#fa_attached =
          p#addl_boolean ((non_nil_job_env_info AND job_env_info_p^.cycle_attached), line);

        = c#fa_attached_external_vsn_list =
          IF (device_class_mt) AND (non_nil_job_env_info) AND (job_env_info_p^.cycle_attached) THEN
            make_list_of_external_vsns (job_env_info_p^.volume_list);
          IFEND;

        = c#fa_attached_recorded_vsn_list =
          IF (device_class_mt) AND (non_nil_job_env_info) AND (job_env_info_p^.cycle_attached) THEN
            make_list_of_recorded_vsns (job_env_info_p^.volume_list);
          IFEND;

        = c#fa_attached_transfer_size =
          IF (device_class_ms) AND (non_nil_job_env_info) AND (job_env_info_p^.cycle_attached) AND
                (fsc$transfer_size_ao IN job_env_info_p^.specified_attachment_options) THEN
            p#addl_rjinteger (job_env_info_p^.transfer_size, rj_w, line, status);
          IFEND;

        = c#fa_attached_vol_oflo_allowed =
          IF (device_class_mt) AND (non_nil_job_env_info) AND (job_env_info_p^.cycle_attached) THEN
            p#addl_boolean (job_env_info_p^.volume_overflow_allowed, line);
          IFEND;

        = c#fa_attached_volume_number =
          IF (device_class_mt) AND (non_nil_job_env_info) AND (job_env_info_p^.cycle_attached) THEN
            p#addl_rjinteger (job_env_info_p^.volume_number, rj_w, line, status);
          IFEND;

        = c#fa_attachment_log =

        = c#fa_attachment_logging_sel =
          IF (file_info_p <> NIL) AND (file_info_p^.logging_selection <> NIL) THEN
            p#addl_boolean ((file_info_p^.logging_selection^ = pfc$log), line);
          IFEND;

        = c#fa_average_record_length =
          IF label_attrs.average_record_length_source <> amc$undefined_attribute THEN
            p#addl_rjinteger (label_attrs.average_record_length, rj_w, line, status);
          IFEND;

        = c#fa_block_type =
          p#addl_string (block_types [label_attrs.block_type]^, line);

        = c#fa_character_conversion =
          p#addl_boolean (label_attrs.character_conversion, line);

        = c#fa_collate_table_name =
          p#addl_entry_point (label_attrs.collate_table_name, line);

        = c#fa_compression_procedure_name =
          IF label_attrs.compression_procedure_name.name = osc$null_name THEN
            p#addl_string ('NONE', line);
          ELSE
            p#addl_trim_str (label_attrs.compression_procedure_name.name, line);
            line.size := line.size + 1;
            p#addl_trim_str (label_attrs.compression_procedure_name.object_library, line);
          IFEND;

        = c#fa_connected_files =

        = c#fa_creation_date_time =
          IF non_nil_cycle_info THEN
            p#addl_date_time (cycle_info_p^.creation_date_time, line, status);
          IFEND;

        = c#fa_cycle_number =
          p#addl_rjinteger (obj.cycle_number, rj_w, line, status);

        = c#fa_data_padding =
          p#addl_rjinteger (label_attrs.data_padding, rj_w, line, status);

        = c#fa_device_class =
          p#addl_string (class [obj.cycle_device_class]^, line);

        = c#fa_dynamic_home_block_space =
          p#addl_boolean (label_attrs.dynamic_home_block_space, line);

        = c#fa_embedded_key =
          p#addl_boolean (label_attrs.embedded_key, line);

        = c#fa_error_exit_procedure_name =
          IF (obj.job_environment_information = NIL) OR (job_env_info_p^.error_exit_procedure_name =
                osc$null_name) THEN
            p#addl_string ('NONE', line);
          ELSE
            p#addl_trim_str (job_env_info_p^.error_exit_procedure_name, line);
          IFEND;

        = c#fa_error_limit =
          IF non_nil_job_env_info THEN
            p#addl_rjinteger (job_env_info_p^.error_limit, rj_w, line, status);
          IFEND;

        = c#fa_estimated_record_count =
          IF label_attrs.estimated_record_count_source <> amc$undefined_attribute THEN
            p#addl_rjinteger (label_attrs.estimated_record_count, rj_w, line, status);
          IFEND;

        = c#fa_exception_conditions =

        = c#fa_expiration_date = {Need to test if :$LOCAL file!
          IF (cycle_info_p = NIL) OR (cycle_info_p^.expiration_date_time = max_date_time) THEN
            p#addl_string ('INFINITE', line);
          ELSE
            p#addl_date_time (cycle_info_p^.expiration_date_time, line, status);
          IFEND;

        = c#fa_external_vsn_list =
          IF (device_class_mt) AND (non_nil_cycle_dev_info) AND
                (cycle_dev_info_p^.magnetic_tape_device_info.volume_list <> NIL) THEN
            make_list_of_external_vsns (cycle_dev_info_p^.magnetic_tape_device_info.volume_list);
          IFEND;

        = c#fa_file_access_procedure_name =
          p#addl_entry_point (label_attrs.file_access_procedure, line);

        = c#fa_file_contents =
          fsp$convert_file_contents (label_attrs.file_contents, label_attrs.file_structure,
                combined_file_contents, status);
          IF status.normal THEN
            p#addl_trim_str (combined_file_contents, line);
          ELSE
            p#addl_trim_str (label_attrs.file_contents, line);
            status.normal := TRUE;
          IFEND;

        = c#fa_file_label_type =
          p#addl_string (label_types [label_attrs.label_type]^, line);

        = c#fa_file_limit =
          p#addl_rjinteger (label_attrs.file_limit, rj_w, line, status);

        = c#fa_file_name =
          p#addl_trim_str (file_obj_p^.file_name, line);

        = c#fa_file_organization =
          p#addl_string (file_organizations [label_attrs.file_organization]^, line);

        = c#fa_file_previously_opened =
          p#addl_boolean (previously_opened, line);

        = c#fa_file_processor =
          p#addl_trim_str (label_attrs.file_processor, line);

        = c#fa_file_residency =
          p#addl_string (file_residency [file_kind], line);

        = c#fa_fill =
          p#addl_fill (fill_char, width, line);

        = c#fa_forced_write =
          IF label_attrs.forced_write = amc$forced_if_structure_change THEN
            p#addl_string ('FORCED_IF_STRUCTURE_CHANGE', line);
          ELSE
            p#addl_boolean ((label_attrs.forced_write = amc$forced), line);
          IFEND;

        = c#fa_full_path =
          p#addl_string (object_info_p^.resolved_path^, line);
          p#addl_string ('.', line);
          p#addl_trim_str (file_obj_p^.file_name, line);
          p#addl_string ('.', line);
          p#addl_integer (obj.cycle_number, line, status);

        = c#fa_hashing_procedure_name =
          IF (label_attrs.hashing_procedure_name_source = amc$undefined_attribute) OR
                (label_attrs.hashing_procedure_name.name = osc$null_name) THEN
            p#addl_string ('NONE', line);
          ELSE
            p#addl_trim_str (label_attrs.hashing_procedure_name.name, line);
            line.size := line.size + 1;
            p#addl_trim_str (label_attrs.hashing_procedure_name.object_library, line);
          IFEND;

        = c#fa_index_levels =
          p#addl_rjinteger (label_attrs.index_levels, rj_w, line, status);

        = c#fa_index_padding =
          p#addl_rjinteger (label_attrs.index_padding, rj_w, line, status);

        = c#fa_initial_home_block_count =
          p#addl_rjinteger (label_attrs.initial_home_block_count, rj_w, line, status);

        = c#fa_internal_code =
          p#addl_string (internal_codes [label_attrs.internal_code]^, line);

        = c#fa_job_file_address =
          IF non_nil_job_env_info THEN
            p#addl_rjinteger (job_env_info_p^.job_file_address, rj_w, line, status);
          IFEND;

        = c#fa_job_file_position =
          IF non_nil_job_env_info THEN
            p#addl_string (job_file_positions [job_env_info_p^.job_file_position]^, line);
          IFEND;

        = c#fa_job_instances_of_open =
          IF non_nil_job_env_info THEN
            p#addl_rjinteger (job_env_info_p^.concurrent_open_count, rj_w, line, status);
          IFEND;

        = c#fa_job_write_concurrency =
          IF (non_nil_job_env_info) AND (fsc$job_write_concurrency_ao IN
                job_env_info_p^.specified_attachment_options) THEN
            p#addl_boolean (job_env_info_p^.job_write_concurrency, line);
          IFEND;

        = c#fa_key_length =
          IF label_attrs.key_length_source <> amc$undefined_attribute THEN
            p#addl_rjinteger (label_attrs.key_length, rj_w, line, status);
          IFEND;

        = c#fa_key_position =
          p#addl_integer_pair (label_attrs.key_position, label_attrs.key_length, line, status);

        = c#fa_key_type =
          p#addl_string (key_types [label_attrs.key_type]^, line);

        = c#fa_last_access_date_time =
          IF non_nil_cycle_info THEN
            p#addl_date_time (cycle_info_p^.last_access_date_time, line, status);
          IFEND;

        = c#fa_last_data_mod_time =
          IF non_nil_cycle_info THEN
            p#addl_date_time (cycle_info_p^.data_modification_date_time, line, status);
          IFEND;

        = c#fa_last_mod_date_time =
          IF non_nil_cycle_info THEN
            p#addl_date_time (cycle_info_p^.last_modification_date_time, line, status);
          IFEND;

        = c#fa_lifetime =

        = c#fa_lifetime_attachment_count =
          IF non_nil_cycle_info THEN
            p#addl_rjinteger (cycle_info_p^.lifetime_attachment_count, rj_w, line, status);
          IFEND;

        = c#fa_line_number =
          IF label_attrs.line_number_source <> amc$undefined_attribute THEN
            p#addl_integer_pair (label_attrs.line_number.location, label_attrs.line_number.length, line,
                  status);
          IFEND;

        = c#fa_loading_factor =
          p#addl_rjinteger (label_attrs.loading_factor, rj_w, line, status);

        = c#fa_lock_expiration_time =
          p#addl_rjinteger (label_attrs.lock_expiration_time, rj_w, line, status);

        = c#fa_log_residence =

        = c#fa_logging_options =
          IF label_attrs.logging_options <> $amt$logging_options [] THEN
            p#addl_list_start (old_line_size, line);
            FOR log_opt_i := LOWERVALUE (log_opt_i) TO UPPERVALUE (log_opt_i) DO
              IF log_opt_i IN label_attrs.logging_options THEN
                p#addl_string (logging_possibilities [log_opt_i]^, line);
                line.size := line.size + 1;
              IFEND;
            FOREND;
            p#addl_list_stop (old_line_size, line);
          ELSE
            p#addl_string ('NONE', line);
          IFEND;

        = c#fa_mainframe_attachment =
          IF (non_nil_cycle_info) AND (cycle_info_p^.mainframe_usage_concurrency <>
                $fst$mainframe_usage_concurrency []) THEN
            p#addl_list_start (old_line_size, line);
            FOR mf_att_i := LOWERVALUE (mf_att_i) TO UPPERVALUE (mf_att_i) DO
              IF mf_att_i IN cycle_info_p^.mainframe_usage_concurrency THEN
                p#addl_string (mainframe_attachments [mf_att_i]^, line);
                line.size := line.size + 1;
              IFEND;
            FOREND;
            p#addl_list_stop (old_line_size, line);
          IFEND;

        = c#fa_mf_write_concurrency =
          IF (non_nil_cycle_info) AND (cycle_info_p^.mainframe_write_concurrency <>
                fsc$not_attached_for_write) THEN
            p#addl_string (mainframe_write_concurrencies [cycle_info_p^.mainframe_write_concurrency]^, line);
          IFEND;

        = c#fa_ms_allocation_size =
          IF f#resides_online (device_class_ms, non_nil_cycle_dev_info, obj) THEN
            p#addl_rjinteger (cycle_dev_info_p^.mass_storage_device_info.allocation_unit_size, rj_w, line,
                  status);
          IFEND;

        = c#fa_ms_bytes_allocated =
          IF f#resides_online (device_class_ms, non_nil_cycle_dev_info, obj) THEN
            p#addl_rjinteger (cycle_dev_info_p^.mass_storage_device_info.bytes_allocated, rj_w, line, status);
          IFEND;

        = c#fa_ms_class =
          IF f#resides_online (device_class_ms, non_nil_cycle_dev_info, obj) THEN
            char_str := cycle_dev_info_p^.mass_storage_device_info.mass_storage_class;
            p#addl_string (char_str, line);
          IFEND;

        = c#fa_ms_free_behind =
          IF (device_class_ms) AND (non_nil_job_env_info) AND
                (fsc$free_behind_ao IN job_env_info_p^.specified_attachment_options) THEN
            p#addl_boolean (job_env_info_p^.mass_storage_free_behind, line);
          IFEND;

        = c#fa_ms_initial_volume =
          IF f#resides_online (device_class_ms, non_nil_cycle_dev_info, obj) AND
                (cycle_dev_info_p^.mass_storage_device_info.initial_volume <> ' ') THEN
            p#addl_trim_str (cycle_dev_info_p^.mass_storage_device_info.initial_volume, line);
          IFEND;

        = c#fa_ms_sequential_access =
          IF (device_class_ms) AND (non_nil_job_env_info) AND
                (fsc$sequential_access_ao IN job_env_info_p^.specified_attachment_options) THEN
            p#addl_boolean (job_env_info_p^.mass_storage_sequential_access, line);
          IFEND;

        = c#fa_ms_transfer_size =
          IF f#resides_online (device_class_ms, non_nil_cycle_dev_info, obj) THEN
            p#addl_rjinteger (cycle_dev_info_p^.mass_storage_device_info.transfer_size, rj_w, line, status);
          IFEND;

        = c#fa_maximum_block_length =
          p#addl_rjinteger (label_attrs.max_block_length, rj_w, line, status);

        = c#fa_maximum_record_length =
          p#addl_rjinteger (label_attrs.max_record_length, rj_w, line, status);

        = c#fa_message_control =
          IF non_nil_job_env_info THEN
            IF job_env_info_p^.message_control <> $amt$message_control [] THEN
              p#addl_list_start (old_line_size, line);
              FOR mc_i := LOWERVALUE (mc_i) TO UPPERVALUE (mc_i) DO
                IF mc_i IN job_env_info_p^.message_control THEN
                  p#addl_string (message_controls [mc_i]^, line);
                IFEND;
              FOREND;
              p#addl_list_stop (old_line_size, line);
            ELSE
              p#addl_string ('NONE', line);
            IFEND;
          IFEND;

        = c#fa_minimum_block_length =
          p#addl_rjinteger (label_attrs.min_block_length, rj_w, line, status);

        = c#fa_minimum_record_length =
          p#addl_rjinteger (label_attrs.min_record_length, rj_w, line, status);

        = c#fa_object_type =
          p#addl_string ('FILE', line);

        = c#fa_open_position =

        = c#fa_padding_character =
          char_str := label_attrs.padding_character;
          p#addl_string (char_str, line);

        = c#fa_page_format =
          p#addl_string (page_formats [label_attrs.page_format]^, line);

        = c#fa_page_length =
          p#addl_rjinteger (label_attrs.page_length, rj_w, line, status);

        = c#fa_page_width =
          p#addl_rjinteger (label_attrs.page_width, rj_w, line, status);

        = c#fa_password =
          p#addl_trim_str (file_obj_p^.password, line);

        = c#fa_path =
          p#addl_string (object_info_p^.resolved_path^, line);

        = c#fa_permitted_access =

        = c#fa_potential_job_access =

        = c#fa_preset_value =
          p#addl_rjinteger (label_attrs.preset_value, rj_w, line, status);

        = c#fa_private_read =
          IF (non_nil_job_env_info) AND job_env_info_p^.private_read.specified_on_attach THEN
            p#addl_boolean (job_env_info_p^.private_read.value, line);
          IFEND;

        = c#fa_record_delimiting_char =
          char_str := label_attrs.record_delimiting_character;
          p#addl_string (char_str, line);

        = c#fa_record_limit =
          IF label_attrs.record_limit_source <> amc$undefined_attribute THEN
            p#addl_rjinteger (label_attrs.record_limit, rj_w, line, status);
          IFEND;

        = c#fa_record_type =
          p#addl_string (record_types [label_attrs.record_type]^, line);

        = c#fa_recorded_vsn_list =
          add_recorded_vsn_list (line);

        = c#fa_records_per_block =
          IF label_attrs.records_per_block_source <> amc$undefined_attribute THEN
            p#addl_rjinteger (label_attrs.records_per_block, rj_w, line, status);
          IFEND;

        = c#fa_registered =
          p#addl_boolean ((obj.cycle_global_file_name <> null_unique_name), line);

        = c#fa_removable_media_group =
          IF (device_class_mt) AND (non_nil_cycle_dev_info) THEN
            p#addl_trim_str (obj.cycle_device_information^.magnetic_tape_device_info.removable_media_group,
                  line);
          IFEND;

        = c#fa_retrieve_option =
          add_retrieve_option (cycle_info_p, status);

        = c#fa_ring_attributes =
          p#addl_string ('(', line);
          p#addl_rjinteger (label_attrs.ring_attributes.r1, 2, line, status);
          line.size := line.size + 1;
          p#addl_rjinteger (label_attrs.ring_attributes.r2, 2, line, status);
          line.size := line.size + 1;
          p#addl_rjinteger (label_attrs.ring_attributes.r3, 2, line, status);
          p#addl_string (')', line);

        = c#fa_secondary_residence =
          add_secondary_residence (obj, status);

        = c#fa_set_name =
          p#addl_trim_str (object_info_p^.set_name, line);

        = c#fa_shared_queue =
          IF (device_class_ms) AND (non_nil_cycle_dev_info) AND
                (cycle_dev_info_p^.mass_storage_device_info.shared_queue <> osc$null_name) THEN
            p#addl_trim_str (cycle_dev_info_p^.mass_storage_device_info.shared_queue, line);
          IFEND;

        = c#fa_site_archive_option =
          add_site_attribute_ordinal (cycle_info_p, c#saoi_archive_option, status);

        = c#fa_site_backup_option =
          add_site_attribute_ordinal (cycle_info_p, c#saoi_backup_option, status);

        = c#fa_site_release_option =
          add_site_attribute_ordinal (cycle_info_p, c#saio_release_option, status);

        = c#fa_size =
          IF (obj.cycle_size <> NIL) THEN
            p#addl_rjinteger (obj.cycle_size^, rj_w, line, status);
          IFEND;

        = c#fa_statement_identifier =
          IF label_attrs.statement_identifier_source <> amc$undefined_attribute THEN
            p#addl_integer_pair (label_attrs.statement_identifier.location,
                  label_attrs.statement_identifier.length, line, status);
          IFEND;

        = c#fa_tape_density =
          IF (device_class_mt) AND (non_nil_cycle_dev_info) THEN
            p#addl_string (tape_densities [cycle_dev_info_p^.magnetic_tape_device_info.density]^, line);
          IFEND;

        = c#fa_unique_data_name =
          IF (device_class_ms) THEN
            pmp$convert_binary_unique_name (obj.cycle_global_file_name, gfn, status);
            p#addl_string (gfn, line);
            status.normal := TRUE;
          IFEND;

        = c#fa_unique_name =
          pmp$convert_binary_unique_name (obj.cycle_global_file_name, gfn, status);
          p#addl_string (gfn, line);
          status.normal := TRUE;

        = c#fa_user_information =
          p#addl_trim_str (label_attrs.user_info, line);

        = c#fa_vertical_print_density =
          p#addl_rjinteger (label_attrs.vertical_print_density, 2, line, status);

        = c#fa_volume_overflow_allowed =
          IF (device_class_ms) AND (non_nil_cycle_dev_info) THEN
            p#addl_boolean (cycle_dev_info_p^.mass_storage_device_info.volume_overflow_allowed, line);
          IFEND;

        CASEND;
        p#adjust_line_size (line_size_o, width, line);
      FOREND;

    PROCEND process_cycle_entry;
?? OLDTITLE ??
?? NEWTITLE := 'GET_OBJECT_INFO', EJECT ??

    PROCEDURE get_object_info
      (    file_ref_p: ^fst$file_reference;
           info_req: fst$goi_information_request;
           attrs_info_p: ^t#attribute_infos;
           attrs_req: t#file_attribute_keys;
           attrs_req_n: t#object_type_counts;
           file_label_attrs: t#file_attribute_keys_set;
           obj_order: t#object_sort_order;
           file_order: t#file_sort_order;
       VAR work_area_p: ^SEQ ( * );
       VAR status: ost$status);

      VAR
        cyc_i: ost$halfword,
        file_kind: t#file_kind,
        line: t#string,
        obj_i: ost$halfword,
        obj_p: ^fst$goi_object,
        object_info_p: ^fst$goi_object_information,
        object_info_seq_p: ^SEQ ( * ),
        object_list_p: ^fst$goi_object_list,
        path_p: ^fst$file_reference,
        prev_path_n: ost$halfword;

?? NEWTITLE := 'LOG_INCORRECT_PASSWORD', EJECT ??

      PROCEDURE log_incorrect_password
        (VAR {i/o} status: ost$status);

{Log/Ignore password error-ERROR PF 850--

        VAR
          line_count: integer,
          line_count_p: ^ost$status_message_line_count,
          line_size_p: ^ost$status_message_line_size,
          local_status: ost$status,
          message: ost$status_message,
          message_line_p: ^string ( * ),
          message_p: ^ost$status_message;

        local_status.normal := TRUE;
        message_p := ^message;
        RESET message_p;
        osp$format_message (status, osc$full_message_level, osc$max_string_size, message_p^, local_status);
        status.normal := TRUE;
        IF NOT local_status.normal THEN
          RETURN; {----->
        IFEND;

        RESET message_p;
        NEXT line_count_p IN message_p;
        IF line_count_p^ > 0 THEN
          FOR line_count := 1 TO (line_count_p^) DO
            NEXT line_size_p IN message_p;
            NEXT message_line_p: [line_size_p^] IN message_p;
            pmp$log (message_line_p^, local_status);
          FOREND;
        IFEND;

      PROCEND log_incorrect_password;
?? OLDTITLE ??
?? EJECT ?? {get_object_info

      object_info_seq_p := work_area_p;
      pfp$get_object_information (file_ref_p^, info_req, NIL, work_area_p, status);
      IF status.condition = pfe$incorrect_password THEN
        log_incorrect_password (status);
      IFEND;
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

      NEXT object_info_p IN object_info_seq_p;
      IF (object_info_p = NIL)
{        } OR (object_info_p^.object = NIL)
{        } OR (object_info_p^.object^.object_type <> fsc$goi_catalog_object) THEN
        RETURN; {----->
      IFEND;

      object_list_p := object_info_p^.object^.subcatalog_and_file_object_list;
      IF object_list_p = NIL THEN
        RETURN; {----->
      IFEND;

      ofp$display_status_message (object_info_p^.resolved_path^, status);
      status.normal := TRUE;

      FOR obj_i := 1 TO UPPERBOUND (object_list_p^) DO
        obj_p := ^object_list_p^ [obj_i];
        CASE obj_p^.object_type OF

        = fsc$goi_catalog_object =
          prev_path_n := STRLENGTH (object_info_p^.resolved_path^);
          PUSH path_p: [prev_path_n + 1 + 31];
          path_p^ (1, prev_path_n) := object_info_p^.resolved_path^;
          path_p^ (prev_path_n + 1) := '.';
          path_p^ (prev_path_n + 2, * ) := obj_p^.catalog_name;
          get_object_info (path_p, info_req, attrs_info_p, attrs_req, attrs_req_n, file_label_attrs,
                obj_order, file_order, work_area_p, status);

        = fsc$goi_file_object =
          FOR cyc_i := 1 TO UPPERBOUND (obj_p^.cycle_object_list^) DO
            line.size := 0;
            line.value := ' ';
            process_cycle_entry (obj_p^.cycle_object_list^ [cyc_i], object_info_p, obj_p, attrs_info_p,
                  file_label_attrs, file_kind, line, status);
            clp$put_display (dis_ctl, line.value (1, line.size), clc$no_trim, status);
          FOREND;
        CASEND;
      FOREND;

    PROCEND get_object_info;
?? OLDTITLE ??
?? NEWTITLE := 'GET_FAMILIES', EJECT ??

    PROCEDURE get_families
      (VAR catalogs_p: ^array [1 .. * ] of ^fst$file_reference;
       VAR work_area_p: ^SEQ ( * );
       VAR status: ost$status);

{Set CATALOGS to all active families.

      VAR
        active_family_list_p: ^pmt$family_name_list,
        i: ost$halfword,
        number_of_families: pmt$family_name_count;

      number_of_families := 100;
      REPEAT
        PUSH active_family_list_p: [1 .. number_of_families];
        pmp$get_family_names (active_family_list_p^, number_of_families, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
      UNTIL number_of_families <= UPPERBOUND (active_family_list_p^);
      NEXT catalogs_p: [1 .. number_of_families] IN work_area_p;
      FOR i := 1 TO number_of_families DO
        NEXT catalogs_p^ [i]: [clp$trimmed_string_size (active_family_list_p^ [i]) + 1] IN work_area_p;
        catalogs_p^ [i]^ (1) := ':';
        catalogs_p^ [i]^ (2, * ) := active_family_list_p^ [i];
      FOREND;

    PROCEND get_families;
?? OLDTITLE ??
?? NEWTITLE := 'INITIALIZE', EJECT ??

    PROCEDURE initialize
      (VAR attrs_info_p: ^t#attribute_infos;
       VAR dis_ctl: clt$display_control;
       VAR obj_order: t#object_sort_order;
       VAR file_order: t#file_sort_order;
       VAR work_area_p: ^SEQ ( * );
       VAR status: ost$status);

      VAR
        default_ring_attributes: amt$ring_attributes,
        scratch_segment: amt$segment_pointer;

      mmp$create_scratch_segment (amc$sequence_pointer, mmc$as_random, scratch_segment, status);
      IF status.normal THEN
        work_area_p := scratch_segment.sequence_pointer;
      IFEND;
      IF status.normal THEN
        NEXT attrs_info_p: [1 .. c#attribute_key_max] IN work_area_p;

        default_ring_attributes.r1 := #RING (^default_ring_attributes);
        default_ring_attributes.r2 := #RING (^default_ring_attributes);
        default_ring_attributes.r3 := #RING (^default_ring_attributes);
        clp$open_display_reference (pvt [p$output].value^.file_value^, NIL, fsc$list, default_ring_attributes,
              dis_ctl, status);
      IFEND;

    PROCEND initialize;
?? OLDTITLE ??
?? EJECT ?? {usp#report_files
*copyc usd#report_files

    VAR
      attrs_info_p: ^t#attribute_infos,
      attrs_req: t#file_attribute_keys,
      attrs_req_n: t#object_type_counts,
      catalogs_p: ^array [1 .. * ] of ^fst$file_reference,
      catalogs_i: ost$halfword,
      dis_ctl: clt$display_control,
      file_label_attrs: t#file_attribute_keys_set,
      file_order: t#file_sort_order,
      fill_char: string (1),
      info_req: fst$goi_information_request,
      obj_order: t#object_sort_order,
      work_area_p: ^SEQ ( * );

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    fill_char := pvt [p$fill_character].value^.string_value^;
    initialize (attrs_info_p, dis_ctl, obj_order, file_order, work_area_p, status);
    IF status.normal THEN
      determine_requested_attributes (pvt [p$fields].value, attrs_info_p, attrs_req, attrs_req_n,
            file_label_attrs, status);
    IFEND;
    IF status.normal THEN
      info_req := initial_information_request;
      determine_object_info_requests (attrs_req, info_req.object_information_requests);
    IFEND;

    IF status.normal THEN
      IF pvt [p$catalog].value^.kind = clc$file THEN
        PUSH catalogs_p: [1 .. 1];
        catalogs_p^ [1] := pvt [p$catalog].value^.file_value;
      ELSE
        get_families (catalogs_p, work_area_p, status);
      IFEND;
    IFEND;

    IF status.normal THEN
      FOR catalogs_i := 1 TO UPPERBOUND (catalogs_p^) DO
        get_object_info (catalogs_p^ [catalogs_i], info_req, attrs_info_p, attrs_req, attrs_req_n,
              file_label_attrs, obj_order, file_order, work_area_p, status);
        IF NOT status.normal THEN
          status.normal := (status.condition = pfe$unknown_item); {ignore unknown family
        IFEND;
        IF NOT status.normal THEN
          RETURN {----->
        IFEND;
      FOREND;
    IFEND;

  PROCEND usp#report_files;
?? OLDTITLE ??
MODEND usm#report_files;
