?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE SCL Command Table Generator' ??
MODULE clm$generate_command_table;

{
{ PURPOSE:
{   This module contains the processors of the command table generator utility.
{

?? NEWTITLE := 'Global Declarations', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc cle$ecc_ct_generator
*copyc cle$ecc_parsing
*copyc clt$command_table
*copyc clt$function_processor_table
*copyc clt$function_table
*copyc clt$parameter_list
*copyc clt$parameter_list_size
*copyc oss$job_paged_literal
*copyc ost$status
?? POP ??
*copyc amp$fetch
*copyc amp$put_next
*copyc clp$begin_utility
*copyc clp$convert_integer_to_string
*copyc clp$convert_string_to_name
*copyc clp$end_include
*copyc clp$end_utility
*copyc clp$evaluate_parameters
*copyc clp$get_command_origin
*copyc clp$get_parameter_list_text
*copyc clp$include_file
*copyc clp$trimmed_string_size
*copyc fsp$close_file
*copyc fsp$open_file
*copyc mmp$create_scratch_segment
*copyc osp$append_status_parameter
*copyc osp$generate_error_message
*copyc osp$set_status_abnormal
*copyc osv$upper_to_lower
*copyc pmp$exit
?? EJECT ??

  TYPE
    entry = record
      name: ost$name,
      class: clt$named_entry_class,
      availability: clt$named_entry_availability,
      ordinal: integer,
      log_option: clt$command_log_option,
      call_method: clt$call_method,
      procedure_name: ost$name,
    recend;

  TYPE
    chunk_array = array [1 .. clc$max_command_chunk] of record
      position: integer,
      length: integer,
    recend;

  TYPE
    type_record = record
      size: 0 .. max_line_size,
      line: string (max_line_size),
    recend;

  CONST
    max_line_size = 79,
    number_of_common_lines = 69,
    number_of_command_lines = 40,
    number_of_function_lines = 185;

  CONST
    prompt_string = 'ctg',
    prompt_string_size = 3;

  CONST
    clc$max_command_chunk = clc$max_parameter_list_size DIV osc$max_name_size,
    min_page_width = 79,
    max_page_width = 110;

  VAR
    entry_array: [STATIC] ^array [1 .. * ] of entry,
    entry_count: [STATIC] integer := 0,
    module_name: [STATIC] ost$name,
    module_name_size: [STATIC] integer,
    name_size: [STATIC] integer,
    new_table_started: [STATIC] boolean := FALSE,
    ordinal_count: [STATIC] integer := 0,
    output_file_id: [STATIC] amt$file_identifier,
    page_width: [STATIC] 0 .. amc$max_page_width,
    scope: [STATIC] ost$name,
    section_name: [STATIC] ost$name := '',
    status: [STATIC] ost$status,
    table_name: [STATIC] ost$name := '',
    table_type: [STATIC] ost$name,
    utility_name: [STATIC, READ, oss$job_paged_literal] ost$name := 'generate_command_table',
    version: [STATIC] 0 .. 1,
    xref_array: [STATIC] ^array [1 .. * ] of ost$name,
    xref_count: [STATIC] integer := 0;

{**************************** CAUTION !!! *****************************
{
{    When modifying the following 'hard-coded' types, use a different
{  MODIFICATION and FEATURE than ones used to modify the logic of
{  this program or any other deck.  This division is neccessary to
{  ensure ease of building various versions of command tables and
{  GENCT.
{
{**********************************************************************

  CONST
    number_of_types_lines = 794,
    max_types_line_size = 77;

  VAR
    types: [STATIC, READ] array [1 .. number_of_types_lines] of string (max_types_line_size) :=
          ['TYPE                                                                         ',
          '  clt$command_table = array [1 .. * ] of clt$command_table_entry;            ',
          'TYPE                                                                         ',
          '  clt$command_table_entry = record                                           ',
          '    name: clt$command_name,                                                  ',
          '    class: clt$named_entry_class,                                            ',
          '    availability: clt$named_entry_availability,                              ',
          '    ordinal: clt$named_entry_ordinal,                                        ',
          '    log_option: clt$command_log_option,                                      ',
          '    case call_method: clt$command_call_method of                             ',
          '    = clc$linked_call =                                                      ',
          '      command: clt$command,                                                  ',
          '    = clc$unlinked_call, clc$proc_call, clc$program_call =                   ',
          '      procedure_name: pmt$program_name,                                      ',
          '    casend,                                                                  ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$command_call_method = clc$linked_call .. clc$program_call;             ',
          'TYPE                                                                         ',
          '  clt$call_method = (clc$unspecified_call, clc$linked_call,                  ',
          '        clc$unlinked_call, clc$proc_call, clc$program_call);                 ',
          'TYPE                                                                         ',
          '  clt$command_log_option = (clc$automatically_log, clc$manually_log);        ',
          'TYPE                                                                         ',
          '  clt$command_name = ost$name;                                               ',
          'CONST                                                                        ',
          '  osc$max_name_size = 31,                                                    ',
          '  osc$null_name = ''                               '';                         ',
          'TYPE                                                                         ',
          '  ost$name_size = 1 .. osc$max_name_size;                                    ',
          'TYPE                                                                         ',
          '  ost$name = string (osc$max_name_size);                                     ',
          'TYPE                                                                         ',
          '  clt$command = ^procedure (    parameter_list: clt$parameter_list;          ',
          '                            VAR status: ost$status);                         ',
          'TYPE                                                                         ',
          '  clt$parameter_list = pmt$program_parameters;                               ',
          'TYPE                                                                         ',
          '  pmt$program_parameters = SEQ ( * );                                        ',
          'TYPE                                                                         ',
          '  clt$parameter_list_contents = clt$parameter_list_text;                     ',
          'TYPE                                                                         ',
          '  clt$parameter_list_text = string ( * <= clc$max_parameter_list_size);      ',
          'CONST                                                                        ',
          '  clc$max_parameter_list_size = clc$max_string_size;                         ',
          'CONST                                                                        ',
          '  clc$max_string_size = cyc$max_string_size;                                 ',
          'CONST                                                                        ',
          '  cyc$max_string_size = 0ffff(16);                                           ',
          'TYPE                                                                         ',
          '  ost$status = record                                                        ',
          '    case normal: boolean of                                                  ',
          '    = FALSE =                                                                ',
          '      condition: ost$status_condition_code,                                  ',
          '      text: ost$string,                                                      ',
          '    = TRUE =                                                                 ',
          '      ,                                                                      ',
          '    casend,                                                                  ',
          '  recend;                                                                    ',
          'CONST                                                                        ',
          '  osc$max_condition = osc$max_status_condition_code;                         ',
          'CONST                                                                        ',
          '  osc$max_status_condition_code = 0ffffffffff(16);                           ',
          'CONST                                                                        ',
          '  osc$status_parameter_delimiter = $CHAR (31) {Unit Separator} ;             ',
          'TYPE                                                                         ',
          '  ost$status_condition = ost$status_condition_code;                          ',
          'TYPE                                                                         ',
          '  ost$status_condition_code = 0 .. osc$max_status_condition_code;            ',
          'CONST                                                                        ',
          '  osc$max_string_size = 256;                                                 ',
          'TYPE                                                                         ',
          '  ost$string_size = 0 .. osc$max_string_size;                                ',
          'TYPE                                                                         ',
          '  ost$string_index = 1 .. osc$max_string_size + 1;                           ',
          'TYPE                                                                         ',
          '  ost$string = record                                                        ',
          '    size: ost$string_size,                                                   ',
          '    value: string (osc$max_string_size),                                     ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$named_entry_availability = (clc$normal_usage_entry, clc$hidden_entry,  ',
          '        clc$advanced_usage_entry);                                           ',
          'CONST                                                                        ',
          '  clc$advertised_entry = clc$normal_usage_entry;                             ',
          'TYPE                                                                         ',
          '  clt$named_entry_class = (clc$nominal_entry, clc$alias_entry,               ',
          '        clc$abbreviation_entry);                                             ',
          'TYPE                                                                         ',
          '  clt$named_entry_ordinal = 1 .. 7fffffff(16);                               ',
          'TYPE                                                                         ',
          '  pmt$program_name = ost$name;                                               ',
          'TYPE                                                                         ',
          '  clt$function_processor_table = array [1 .. * ] of                          ',
          '        clt$function_proc_table_entry;                                       ',
          'TYPE                                                                         ',
          '  clt$function_proc_table_entry = record                                     ',
          '    name: clt$function_name,                                                 ',
          '    class: clt$named_entry_class,                                            ',
          '    availability: clt$named_entry_availability,                              ',
          '    ordinal: clt$named_entry_ordinal,                                        ',
          '    case call_method: clt$function_call_method of                            ',
          '    = clc$linked_call =                                                      ',
          '      func: clt$function_processor,                                          ',
          '    = clc$unlinked_call, clc$proc_call =                                     ',
          '      procedure_name: pmt$program_name,                                      ',
          '    casend,                                                                  ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$function_call_method = clc$linked_call .. clc$proc_call;               ',
          'TYPE                                                                         ',
          '  clt$function_name = ost$name;                                              ',
          'TYPE                                                                         ',
          '  clt$function_processor = ^procedure                                        ',
          '         (    parameter_list: clt$parameter_list;                            ',
          '          VAR work_area {input, output} : ^clt$work_area;                    ',
          '          VAR result: ^clt$data_value;                                       ',
          '          VAR status: ost$status);                                           ',
          'TYPE                                                                         ',
          '  clt$data_value = record                                                    ',
          '    case kind: clt$data_kind of                                              ',
          '    = clc$application =                                                      ',
          '      application_value: ^clt$application_value_text,                        ',
          '    = clc$array =                                                            ',
          '      array_value: ^array [ * ] of ^clt$data_value,                          ',
          '    = clc$boolean =                                                          ',
          '      boolean_value: clt$boolean,                                            ',
          '    = clc$cobol_name =                                                       ',
          '      cobol_name_value: clt$cobol_name,                                      ',
          '    = clc$command_reference =                                                ',
          '      command_reference_value: ^clt$command_reference,                       ',
          '    = clc$data_name =                                                        ',
          '      data_name_value: ost$name,                                             ',
          '    = clc$date_time =                                                        ',
          '      date_time_value: clt$date_time,                                        ',
          '    = clc$deferred =                                                         ',
          '      deferred_value: ^clt$expression_text,                                  ',
          '      deferred_type: ^clt$type_specification,                                ',
          '    = clc$entry_point_reference =                                            ',
          '      entry_point_reference_value: ^pmt$entry_point_reference,               ',
          '    = clc$file =                                                             ',
          '      file_value: ^fst$file_reference,                                       ',
          '    = clc$integer =                                                          ',
          '      integer_value: clt$integer,                                            ',
          '    = clc$keyword =                                                          ',
          '      keyword_value: clt$keyword,                                            ',
          '    = clc$list =                                                             ',
          '      element_value: ^clt$data_value,                                        ',
          '      link: ^clt$data_value,                                                 ',
          '      generated_via_list_rest: boolean,                                      ',
          '    = clc$lock =                                                             ',
          '      lock_value: ^clt$lock,                                                 ',
          '    = clc$name =                                                             ',
          '      name_value: ost$name,                                                  ',
          '    = clc$network_title =                                                    ',
          '      network_title_value: ^nat$title,                                       ',
          '    = clc$program_name =                                                     ',
          '      program_name_value: pmt$program_name,                                  ',
          '    = clc$range =                                                            ',
          '      low_value: ^clt$data_value,                                            ',
          '      high_value: ^clt$data_value,                                           ',
          '    = clc$real =                                                             ',
          '      real_value: clt$real,                                                  ',
          '    = clc$record =                                                           ',
          '      field_values: ^array [1 .. * ] of clt$field_value,                     ',
          '    = clc$scu_line_identifier =                                              ',
          '      scu_line_identifier_value: clt$scu_line_identifier,                    ',
          '    = clc$statistic_code =                                                   ',
          '      statistic_code_value: sft$statistic_code,                              ',
          '    = clc$status =                                                           ',
          '      status_value: ^ost$status,                                             ',
          '    = clc$status_code =                                                      ',
          '      status_code_value: ost$status_condition_code,                          ',
          '    = clc$string =                                                           ',
          '      string_value: ^clt$string_value,                                       ',
          '    = clc$string_pattern =                                                   ',
          '      string_pattern_value: ^clt$string_pattern,                             ',
          '    = clc$time_increment =                                                   ',
          '      time_increment_value: ^pmt$time_increment,                             ',
          '    = clc$time_zone =                                                        ',
          '      time_zone_value: ost$time_zone,                                        ',
          '    = clc$type_specification =                                               ',
          '      type_specification_value: ^clt$type_specification,                     ',
          '    = clc$unspecified =                                                      ',
          '      ,                                                                      ',
          '    casend,                                                                  ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$application_value_text = clt$expression_text;                          ',
          'TYPE                                                                         ',
          '  clt$expression_text = string ( * <= clc$max_expression_text_size);         ',
          'CONST                                                                        ',
          '  clc$max_expression_text_size = clc$max_string_size;                        ',
          'TYPE                                                                         ',
          '  clt$boolean = record                                                       ',
          '    value: boolean,                                                          ',
          '    kind: clt$boolean_kinds,                                                 ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$boolean_kinds = (clc$true_false_boolean, clc$yes_no_boolean,           ',
          '        clc$on_off_boolean);                                                 ',
          'TYPE                                                                         ',
          '  clt$cobol_name = string (clc$max_cobol_name_size);                         ',
          'CONST                                                                        ',
          '  clc$max_cobol_name_size = 30;                                              ',
          'TYPE                                                                         ',
          '  clt$command_reference = record                                             ',
          '    name: clt$command_name,                                                  ',
          '    case form: clt$command_reference_form of                                 ',
          '    = clc$name_only_command_ref =                                            ',
          '      ,                                                                      ',
          '    = clc$skip_1st_entry_command_ref =                                       ',
          '      ,                                                                      ',
          '    = clc$system_command_ref =                                               ',
          '      ,                                                                      ',
          '    = clc$utility_command_ref =                                              ',
          '      utility: clt$utility_name,                                             ',
          '    = clc$module_or_file_command_ref =                                       ',
          '      library_or_catalog: fst$path,                                          ',
          '    = clc$file_cycle_command_ref =                                           ',
          '      catalog: fst$path,                                                     ',
          '      cycle_number: fst$cycle_number,                                        ',
          '    casend,                                                                  ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$command_reference_form = (clc$name_only_command_ref,                   ',
          '        clc$skip_1st_entry_command_ref, clc$system_command_ref,              ',
          '        clc$utility_command_ref, clc$module_or_file_command_ref,             ',
          '        clc$file_cycle_command_ref);                                         ',
          'TYPE                                                                         ',
          '  clt$utility_name = ost$name;                                               ',
          'TYPE                                                                         ',
          '  fst$cycle_number = 1 .. fsc$maximum_cycle_number;                          ',
          'CONST                                                                        ',
          '  fsc$maximum_cycle_number = 65535;                                          ',
          'TYPE                                                                         ',
          '  fst$path = string (fsc$max_path_size);                                     ',
          'CONST                                                                        ',
          '  fsc$max_path_size = 512;                                                   ',
          'TYPE                                                                         ',
          '  clt$date_time = record                                                     ',
          '    value: ost$date_time,                                                    ',
          '    date_specified: boolean,                                                 ',
          '    time_specified: boolean,                                                 ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  ost$date_time = record                                                     ',
          '    year: 0 .. 255, {year minus 1900, e.g. 80 = 1980}                        ',
          '    month: 1 .. 12,                                                          ',
          '    day: 1 .. 31,                                                            ',
          '    hour: 0 .. 23,                                                           ',
          '    minute: 0 .. 59,                                                         ',
          '    second: 0 .. 59,                                                         ',
          '    millisecond: 0 .. 999,                                                   ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$data_kind = (clc$application, clc$array, clc$boolean, clc$cobol_name,  ',
          '        clc$command_reference, clc$data_name, clc$date_time, clc$deferred,   ',
          '        clc$entry_point_reference, clc$file, clc$integer, clc$keyword,       ',
          '        clc$list, clc$lock, clc$name, clc$network_title, clc$program_name,   ',
          '        clc$range, clc$real, clc$record, clc$scu_line_identifier,            ',
          '        clc$statistic_code, clc$status, clc$status_code, clc$string,         ',
          '        clc$string_pattern, clc$time_increment, clc$time_zone,               ',
          '        clc$type_specification, clc$unspecified);                            ',
          'TYPE                                                                         ',
          '  clt$field_value = record                                                   ',
          '    name: clt$field_name,                                                    ',
          '    value: ^clt$data_value,                                                  ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$field_name = ost$name;                                                 ',
          'TYPE                                                                         ',
          '  clt$integer = record                                                       ',
          '    value: integer,                                                          ',
          '    radix: 2 .. 16,                                                          ',
          '    radix_specified: boolean,                                                ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$keyword = ost$name;                                                    ',
          'TYPE                                                                         ',
          '  clt$lock = record                                                          ',
          '    case state: clt$lock_state of                                            ',
          '    = clc$lock_clear =                                                       ',
          '      ,                                                                      ',
          '    = clc$lock_set, clc$lock_expired =                                       ',
          '      set_by_job: jmt$system_supplied_name,                                  ',
          '      set_by_task: pmt$task_id,                                              ',
          '      expiration_date_time_rel_gmt: ost$date_time,                           ',
          '    casend,                                                                  ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$lock_state = (clc$lock_clear, clc$lock_set, clc$lock_expired);         ',
          'TYPE                                                                         ',
          '  jmt$system_supplied_name = string (jmc$system_supplied_name_size);         ',
          'CONST                                                                        ',
          '  jmc$system_supplied_name_size = 19;                                        ',
          'TYPE                                                                         ',
          '  pmt$task_id = 0 .. pmc$max_task_id;                                        ',
          'CONST                                                                        ',
          '  pmc$max_task_id = 0ffffffff(16);                                           ',
          'TYPE                                                                         ',
          '  clt$real = record                                                          ',
          '    value: longreal,                                                         ',
          '    number_of_digits: clt$real_number_digit_count,                           ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$real_number_digit_count = 1 .. clc$max_real_number_digits;             ',
          'CONST                                                                        ',
          '  clc$max_real_number_digits = 28;                                           ',
          'TYPE                                                                         ',
          '  clt$scu_line_identifier = record                                           ',
          '    modification_name: clt$scu_modification_name,                            ',
          '    sequence_number: clt$scu_sequence_number,                                ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$scu_modification_name = string (clc$max_scu_modification_name);        ',
          'CONST                                                                        ',
          '  clc$max_scu_modification_name = 9;                                         ',
          'TYPE                                                                         ',
          '  clt$scu_sequence_number = 1 .. clc$max_scu_sequence_number;                ',
          'CONST                                                                        ',
          '  clc$max_scu_sequence_number = 0ffffff(16);                                 ',
          'TYPE                                                                         ',
          '  clt$string_pattern = SEQ ( * );                                            ',
          'TYPE                                                                         ',
          '  clt$string_value = string ( * <= clc$max_string_size);                     ',
          'TYPE                                                                         ',
          '  clt$type_specification = SEQ ( * );                                        ',
          'SECTION                                                                      ',
          '  cls$declaration_section: READ;                                             ',
          'TYPE                                                                         ',
          '  clt$application_type_qualifier = record                                    ',
          '    balance_brackets: boolean,                                               ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$array_type_qualifier = record                                          ',
          '    element_type_specification_size: clt$type_specification_size,            ',
          '    case array_bounds_defined: boolean of                                    ',
          '    = TRUE =                                                                 ',
          '      bounds: clt$array_bounds,                                              ',
          '    = FALSE =                                                                ',
          '      ,                                                                      ',
          '    casend,                                                                  ',
          '    { A clt$type_specification for the element type follows the }            ',
          '    { clt$array_type_qualifier. }                                            ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$array_bounds = record                                                  ',
          '    lower: clt$array_bound,                                                  ',
          '    upper: clt$array_bound,                                                  ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$array_bound = clc$min_array_bound .. clc$max_array_bound;              ',
          'CONST                                                                        ',
          '  clc$max_array_bound = 7fffffff(16);                                        ',
          'CONST                                                                        ',
          '  clc$min_array_bound = -80000000(16);                                       ',
          'TYPE                                                                         ',
          '  clt$type_specification_size = 0 .. clc$max_type_specification_size;        ',
          'CONST                                                                        ',
          '  clc$max_type_specification_size = 7fffffff(16);                            ',
          'TYPE                                                                         ',
          '  clt$date_time_type_qualifier = record                                      ',
          '    date_and_or_time: clt$date_and_or_time,                                  ',
          '    tenses: clt$date_time_tenses,                                            ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$date_and_or_time = set of clt$date_or_time;                            ',
          'TYPE                                                                         ',
          '  clt$date_or_time = (clc$date, clc$time);                                   ',
          'TYPE                                                                         ',
          '  clt$date_time_tenses = set of clt$date_time_tense;                         ',
          'TYPE                                                                         ',
          '  clt$date_time_tense = (clc$past, clc$present, clc$future);                 ',
          'TYPE                                                                         ',
          '  clt$integer_type_qualifier = record                                        ',
          '    min_integer_value: integer,                                              ',
          '    max_integer_value: integer,                                              ',
          '    default_radix: 2 .. 16,                                                  ',
          '  recend;                                                                    ',
          'CONST                                                                        ',
          '  clc$max_integer = cyc$uppervalue_integer;                                  ',
          'CONST                                                                        ',
          '  cyc$uppervalue_integer = 7fffffffffffffff(16);                             ',
          'CONST                                                                        ',
          '  clc$min_integer = cyc$lowervalue_integer;                                  ',
          'CONST                                                                        ',
          '  cyc$lowervalue_integer = (-cyc$uppervalue_integer) - 1;                    ',
          'TYPE                                                                         ',
          '  clt$keyword_type_qualifier = record                                        ',
          '    number_of_keywords: 1 .. clc$max_keywords,                               ',
          '    { An array [1 .. number_of_keywords] of clt$keyword_specification }      ',
          '    { follows the clt$keyword_type_qualifier. }                              ',
          '  recend;                                                                    ',
          'CONST                                                                        ',
          '  clc$max_keywords = 7fffffff(16);                                           ',
          'TYPE                                                                         ',
          '  clt$keyword_specifications = array [1 .. * ] of clt$keyword_specification; ',
          'TYPE                                                                         ',
          '  clt$keyword_specification = record                                         ',
          '    keyword: clt$keyword,                                                    ',
          '    class: clt$named_entry_class,                                            ',
          '    availability: clt$named_entry_availability,                              ',
          '    ordinal: clt$named_entry_ordinal,                                        ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$list_type_qualifier = record                                           ',
          '    element_type_specification_size: clt$type_specification_size,            ',
          '    min_list_size: clt$list_size,                                            ',
          '    max_list_size: clt$list_size,                                            ',
          '    list_rest: boolean,                                                      ',
          '    { A clt$type_specification for the element type follows the }            ',
          '    { clt$list_type_qualifier. }                                             ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$list_size = 0 .. clc$max_list_size;                                    ',
          'CONST                                                                        ',
          '  clc$max_list_size = 7fffffff(16);                                          ',
          'TYPE                                                                         ',
          '  clt$name_type_qualifier = record                                           ',
          '    min_name_size: ost$name_size,                                            ',
          '    max_name_size: ost$name_size,                                            ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$range_type_qualifier = record                                          ',
          '    element_type_specification_size: clt$type_specification_size,            ',
          '    { A clt$type_specification for the element type follows the }            ',
          '    { clt$range_type_qualifier. }                                            ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$real_type_qualifier = record                                           ',
          '    min_real_value: clt$longreal,                                            ',
          '    max_real_value: clt$longreal,                                            ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$longreal = record                                                      ',
          '    case 1 .. 3 of                                                           ',
          '    = 1 =                                                                    ',
          '      long_real: longreal,                                                   ',
          '    = 2 =                                                                    ',
          '      first_real: real,                                                      ',
          '      second_real: real,                                                     ',
          '    = 3 =                                                                    ',
          '      breakdown: clt$longreal_breakdown,                                     ',
          '    casend,                                                                  ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$longreal_breakdown = record                                            ',
          '    first: clt$real_breakdown,                                               ',
          '    second: clt$real_breakdown,                                              ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$real_breakdown = record                                                ',
          '    exponent: 0 .. 0ffff(16),                                                ',
          '    mantissa: 0 .. 0ffffffffffff(16),                                        ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$record_type_qualifier = record                                         ',
          '    number_of_fields: clt$field_number,                                      ',
          '    { There are number_of_fields occurrences of a clt$field_specification }  ',
          '    { followed by a clt$type_specification following the }                   ',
          '    { clt$record_type_qualifier. }                                           ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$field_number = 1 .. clc$max_fields;                                    ',
          'CONST                                                                        ',
          '  clc$max_fields = 7fffffff(16);                                             ',
          'TYPE                                                                         ',
          '  clt$field_specification = record                                           ',
          '    name: clt$field_name,                                                    ',
          '    requirement: clt$field_requirement,                                      ',
          '    type_specification_size: clt$type_specification_size,                    ',
          '  recend;                                                                    ',
          'CONST                                                                        ',
          '  clc$required_field = clc$required_parameter,                               ',
          '  clc$optional_field = clc$optional_parameter;                               ',
          'TYPE                                                                         ',
          '  clt$field_requirement = clc$required_field .. clc$optional_field;          ',
          'TYPE                                                                         ',
          '  clt$parameter_requirement = (clc$required_parameter,                       ',
          '        clc$optional_parameter, clc$optional_default_parameter,              ',
          '        clc$confirm_default_parameter);                                      ',
          'TYPE                                                                         ',
          '  clt$string_type_qualifier = record                                         ',
          '    min_string_size: clt$string_size,                                        ',
          '    max_string_size: clt$string_size,                                        ',
          '    literal: boolean,                                                        ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$string_size = 0 .. clc$max_string_size;                                ',
          'TYPE                                                                         ',
          '  clt$type_specification_header = record                                     ',
          '    version: clt$declaration_version,                                        ',
          '    name: clt$type_name,                                                     ',
          '    case kind: clt$type_kind of                                              ',
          '    = clc$application_type =                                                 ',
          '      { clt$application_type_qualifier follows header } ,                    ',
          '    = clc$array_type =                                                       ',
          '      { clt$array_type_qualifier follows header } ,                          ',
          '    = clc$boolean_type =                                                     ',
          '      ,                                                                      ',
          '    = clc$cobol_name_type =                                                  ',
          '      ,                                                                      ',
          '    = clc$command_reference_type =                                           ',
          '      ,                                                                      ',
          '    = clc$data_name_type =                                                   ',
          '      ,                                                                      ',
          '    = clc$date_time_type =                                                   ',
          '      { clt$date_time_type_qualifier follows header } ,                      ',
          '    = clc$entry_point_reference_type =                                       ',
          '      ,                                                                      ',
          '    = clc$file_type =                                                        ',
          '      ,                                                                      ',
          '    = clc$integer_type =                                                     ',
          '      { clt$integer_type_qualifier follows header } ,                        ',
          '    = clc$keyword_type =                                                     ',
          '      { clt$keyword_type_qualifier follows header } ,                        ',
          '    = clc$list_type =                                                        ',
          '      { clt$list_type_qualifier follows header } ,                           ',
          '    = clc$lock_type =                                                        ',
          '      ,                                                                      ',
          '    = clc$name_type =                                                        ',
          '      { clt$name_type_qualifier follows header } ,                           ',
          '    = clc$network_title_type =                                               ',
          '      ,                                                                      ',
          '    = clc$program_name_type =                                                ',
          '      ,                                                                      ',
          '    = clc$range_type =                                                       ',
          '      { clt$range_type_qualifier follows header } ,                          ',
          '    = clc$real_type =                                                        ',
          '      { clt$real_type_qualifier follows header } ,                           ',
          '    = clc$record_type =                                                      ',
          '      { clt$record_type_qualifier follows header } ,                         ',
          '    = clc$scu_line_identifier_type =                                         ',
          '      ,                                                                      ',
          '    = clc$statistic_code_type =                                              ',
          '      ,                                                                      ',
          '    = clc$status_type =                                                      ',
          '      ,                                                                      ',
          '    = clc$status_code_type =                                                 ',
          '      ,                                                                      ',
          '    = clc$string_type =                                                      ',
          '      { clt$string_type_qualifier follows header } ,                         ',
          '    = clc$string_pattern_type =                                              ',
          '      ,                                                                      ',
          '    = clc$time_increment_type =                                              ',
          '      ,                                                                      ',
          '    = clc$time_zone_type =                                                   ',
          '      ,                                                                      ',
          '    = clc$type_specification_type =                                          ',
          '      ,                                                                      ',
          '    = clc$union_type =                                                       ',
          '      { clt$union_type_qualifier follows header } ,                          ',
          '    casend,                                                                  ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$declaration_version = 0 .. 255;                                        ',
          'CONST                                                                        ',
          '  clc$declaration_version = 1;                                               ',
          'TYPE                                                                         ',
          '  clt$type_kind = (clc$application_type, clc$array_type, clc$boolean_type,   ',
          '        clc$cobol_name_type, clc$command_reference_type, clc$data_name_type, ',
          '        clc$date_time_type, clc$entry_point_reference_type, clc$file_type,   ',
          '        clc$integer_type, clc$keyword_type, clc$list_type, clc$lock_type,    ',
          '        clc$name_type, clc$network_title_type, clc$program_name_type,        ',
          '        clc$range_type, clc$real_type, clc$record_type,                      ',
          '        clc$scu_line_identifier_type, clc$statistic_code_type,               ',
          '        clc$status_type, clc$status_code_type, clc$string_type,              ',
          '        clc$string_pattern_type, clc$time_increment_type, clc$time_zone_type,',
          '        clc$type_specification_type, clc$union_type);                        ',
          'TYPE                                                                         ',
          '  clt$type_name = clt$variable_name;                                         ',
          'TYPE                                                                         ',
          '  clt$variable_name = ost$name;                                              ',
          'TYPE                                                                         ',
          '  clt$union_type_qualifier = record                                          ',
          '    kinds: clt$type_kinds,                                                   ',
          '    information: clt$union_type_information,                                 ',
          '    case number_of_members: clt$union_member_number of                       ',
          '    = 0 =                                                                    ',
          '      { The union consists of all possible types. } ,                        ',
          '    = 1 .. clc$max_union_members =                                           ',
          '      { There are number_of_members occurrences of a }                       ',
          '      { clt$type_specification_size followed by a clt$type_specification }   ',
          '      { following the clt$union_type_qualifier. }                            ',
          '    casend,                                                                  ',
          '  recend;                                                                    ',
          'CONST                                                                        ',
          '  clc$max_union_members = 7fffffff(16);                                      ',
          'TYPE                                                                         ',
          '  clt$type_kinds = set of clt$type_kind;                                     ',
          'TYPE                                                                         ',
          '  clt$union_member_number = 0 .. clc$max_union_members;                      ',
          'TYPE                                                                         ',
          '  clt$union_type_information = record                                        ',
          '    only_standard_types_in_union: boolean,                                   ',
          '    { The "standard" types have non-conflicting expression forms, therefore  ',
          '    { an expression for a union of them can be evaluated without the need for',
          '    { trying each type individually.  The "standard" types are:  boolean,    ',
          '    { file, integer (if default radix is 10), name, real, status, string (if ',
          '    { not literal), string_pattern, and union (consisting only of these      ',
          '    { "standard" types).                                                     ',
          '    min_integer_value: integer,                                              ',
          '    max_integer_value: integer,                                              ',
          '    default_radix: 2 .. 16,                                                  ',
          '    min_real_value: clt$longreal,                                            ',
          '    max_real_value: clt$longreal,                                            ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  fst$file_reference = string ( * <= fsc$max_path_size);                     ',
          'CONST                                                                        ',
          '  nac$max_title_length = 255;                                                ',
          'TYPE                                                                         ',
          '  nat$title_length = 1 .. nac$max_title_length,                              ',
          '  nat$title = string ( * <= nac$max_title_length);                           ',
          'TYPE                                                                         ',
          '  ost$time_zone = record                                                     ',
          '    hours_from_gmt: -12 .. 12,                                               ',
          '    minutes_offset: -30 .. 30,                                               ',
          '    daylight_saving_time: boolean,                                           ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  pmt$entry_point_reference = record                                         ',
          '    entry_point: pmt$program_name,                                           ',
          '    object_library: fst$path,                                                ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  pmt$time_increment = record                                                ',
          '    year: integer,                                                           ',
          '    month: integer,                                                          ',
          '    day: integer,                                                            ',
          '    hour: integer,                                                           ',
          '    minute: integer,                                                         ',
          '    second: integer,                                                         ',
          '    millisecond: integer,                                                    ',
          '  recend;                                                                    ',
          'CONST                                                                        ',
          '  sfc$max_threshold = 7fffffffffff(16),                                      ',
          '  sfc$max_time_interval = 0ffffffff(16);                                     ',
          'CONST                                                                        ',
          '  sfc$max_statistic_code = osc$max_condition;                                ',
          'TYPE                                                                         ',
          '  sft$statistic_code = 0 .. sfc$max_statistic_code;                          ',
          'TYPE                                                                         ',
          '  sft$statistic_identifier = string (2);                                     ',
          'CONST                                                                        ',
          '  sfc$max_descriptive_data_size = 255;                                       ',
          'TYPE                                                                         ',
          '  sft$descriptive_data = string ( * );                                       ',
          'CONST                                                                        ',
          '  sfc$max_number_of_counters = 255;                                          ',
          'TYPE                                                                         ',
          '  sft$counters = ^array [1 .. * ] of sft$counter;                            ',
          'TYPE                                                                         ',
          '  sft$counter = integer;                                                     ',
          'TYPE                                                                         ',
          '  sft$statistic_record = record                                              ',
          '    statistic_code: sft$statistic_code,                                      ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  sft$statistic_group = array [1 .. * ] of sft$statistic_record;             ',
          'TYPE                                                                         ',
          '  clt$work_area = SEQ ( * );                                                 ',
          'TYPE                                                                         ',
          '  clt$function_table = array [1 .. * ] of clt$function_table_entry;          ',
          'TYPE                                                                         ',
          '  clt$function_table_entry = record                                          ',
          '    name: clt$function_name,                                                 ',
          '    class: clt$named_entry_class,                                            ',
          '    availability: clt$named_entry_availability,                              ',
          '    ordinal: clt$named_entry_ordinal,                                        ',
          '    case call_method: clt$function_call_method of                            ',
          '    = clc$linked_call =                                                      ',
          '      func: clt$function,                                                    ',
          '    = clc$unlinked_call, clc$proc_call =                                     ',
          '      procedure_name: pmt$program_name,                                      ',
          '    casend,                                                                  ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$function = ^procedure (    function_name: clt$name;                    ',
          '                                 argument_list: string ( * );                ',
          '                             VAR value: clt$value;                           ',
          '                             VAR status: ost$status);                        ',
          'TYPE                                                                         ',
          '  clt$value = record                                                         ',
          '    descriptor: string (osc$max_name_size),                                  ',
          '    case kind: clc$unknown_value .. clc$status_value of                      ',
          '    = clc$unknown_value =                                                    ',
          '      ,                                                                      ',
          '    = clc$application_value =                                                ',
          '      application: clt$application_value,                                    ',
          '    = clc$variable_reference =                                               ',
          '      var_ref: clt$variable_reference,                                       ',
          '    = clc$string_value =                                                     ',
          '      str: ost$string,                                                       ',
          '    = clc$file_value =                                                       ',
          '      file: clt$file,                                                        ',
          '    = clc$name_value =                                                       ',
          '      name: clt$name,                                                        ',
          '    = clc$real_value =                                                       ',
          '      rnum: clt$real,                                                        ',
          '    = clc$integer_value =                                                    ',
          '      int: clt$integer,                                                      ',
          '    = clc$boolean_value =                                                    ',
          '      bool: clt$boolean,                                                     ',
          '    = clc$status_value =                                                     ',
          '      status: ost$status,                                                    ',
          '    casend,                                                                  ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$variable_reference = record                                            ',
          '    reference: ost$string,                                                   ',
          '    lower_bound: clt$variable_dimension,                                     ',
          '    upper_bound: clt$variable_dimension,                                     ',
          '    value: clt$variable_value,                                               ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$variable_value = record                                                ',
          '    descriptor: string (osc$max_name_size),                                  ',
          '    case kind: clt$variable_kinds of                                         ',
          '    = clc$string_value =                                                     ',
          '      max_string_size: ost$string_size,                                      ',
          '      string_value: ^array [1 .. * ] of cell,                                ',
          '    = clc$real_value =                                                       ',
          '      real_value: ^array [1 .. * ] of clt$real,                              ',
          '    = clc$integer_value =                                                    ',
          '      integer_value: ^array [1 .. * ] of clt$integer,                        ',
          '    = clc$boolean_value =                                                    ',
          '      boolean_value: ^array [1 .. * ] of clt$boolean,                        ',
          '    = clc$status_value =                                                     ',
          '      status_value: ^array [1 .. * ] of clt$status,                          ',
          '    casend,                                                                  ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$status = record                                                        ',
          '    normal: clt$boolean,                                                     ',
          '    identifier: clt$status_identifier,                                       ',
          '    condition: clt$integer,                                                  ',
          '    text: ost$string,                                                        ',
          '  recend,                                                                    ',
          '  clt$status_identifier = record                                             ',
          '    size: ost$string_size,                                                   ',
          '    value: string (2),                                                       ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  clt$variable_dimension = clc$min_variable_dimension ..                     ',
          '        clc$max_variable_dimension;                                          ',
          'CONST                                                                        ',
          '  clc$min_variable_dimension = -7fffffff(16),                                ',
          '  clc$max_variable_dimension = 7fffffff(16);                                 ',
          'TYPE                                                                         ',
          '  clt$variable_scope = record                                                ',
          '    case kind: clt$variable_scope_kind of                                    ',
          '    = clc$local_variable .. clc$xref_variable =                              ',
          '      ,                                                                      ',
          '    = clc$utility_variable =                                                 ',
          '      utility_name: ost$name,                                                ',
          '    casend,                                                                  ',
          '  recend,                                                                    ',
          '  clt$variable_scope_kind = (clc$local_variable, clc$job_variable,           ',
          '        clc$xdcl_variable, clc$xref_variable, clc$utility_variable);         ',
          'TYPE                                                                         ',
          '  clt$variable_kinds = clc$string_value .. clc$status_value;                 ',
          'TYPE                                                                         ',
          '  clt$value_kinds = clt$data_value_kind;                                     ',
          'CONST                                                                        ',
          '  clc$variable_reference = clc$deferred_value,                               ',
          '  clc$any_value = clc$array_value,                                           ',
          '  clc$unknown_value = clc$unspecified_value;                                 ',
          'TYPE                                                                         ',
          '  clt$data_value_kind = (clc$unspecified_value, clc$application_value,       ',
          '        clc$deferred_value, clc$file_value, clc$name_value, clc$string_value,',
          '        clc$real_value, clc$integer_value, clc$boolean_value,                ',
          '        clc$status_value, clc$array_value, clc$cobol_name_value,             ',
          '        clc$date_time_value, clc$entry_point_reference_value,                ',
          '        clc$keyword_value, clc$list_value, clc$lock_value,                   ',
          '        clc$network_title_value, clc$range_value, clc$record_value,          ',
          '        clc$scu_line_identifier_value, clc$string_pattern_value,             ',
          '        clc$time_increment_value, clc$type_specification_value);             ',
          'TYPE                                                                         ',
          '  clt$application_value = SEQ (ost$string);                                  ',
          'TYPE                                                                         ',
          '  clt$application_value_name = ost$name;                                     ',
          'TYPE                                                                         ',
          '  clt$file = record                                                          ',
          '    local_file_name: amt$local_file_name,                                    ',
          '  recend;                                                                    ',
          'TYPE                                                                         ',
          '  amt$local_file_name = ost$name;                                            ',
          'TYPE                                                                         ',
          '  clt$name = record                                                          ',
          '    size: ost$name_size,                                                     ',
          '    value: ost$name,                                                         ',
          '  recend;                                                                    '];

?? TITLE := 'echo_input', EJECT ??

  PROCEDURE echo_input
    (    parameter_list: clt$parameter_list;
         command: string ( * );
     VAR status: ost$status);

    CONST
      indentation = 8;

    VAR
      command_size: integer,
      echo_length: integer,
      echo_line: string (osc$max_string_size),
      parameter_list_text: ^clt$parameter_list_text,
      parm_list_size: clt$parameter_list_size,
      parm_list_text: ^clt$parameter_list_text,
      terminate_string: string (2);


    terminate_string := '..';

    clp$get_parameter_list_text (^parameter_list, parameter_list_text, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    parm_list_size := STRLENGTH (parameter_list_text^);
    PUSH parm_list_text: [parm_list_size];
    #TRANSLATE (osv$upper_to_lower, parameter_list_text^, parm_list_text^);
    command_size := STRLENGTH (command);

    IF (command_size + parm_list_size + 3) <= (page_width - 2) THEN
      STRINGREP (echo_line, echo_length, '{ ', command (1, command_size),
            ' ', parm_list_text^ (1, parm_list_size));
      put_line (echo_line (1, echo_length));
      RETURN;
    IFEND;

    build_and_put (parm_list_text, parm_list_size, (page_width - indentation - 6), command, 0);

  PROCEND echo_input;
?? TITLE := 'build_and_put', EJECT ??

  PROCEDURE build_and_put
    (    line: ^clt$parameter_list_text;
         line_length: 1 .. clc$max_parameter_list_size;
         width: amt$page_width;
         command: string ( * );
         indentation: integer);

    VAR
      break_position: 0 .. clc$max_parameter_list_size,
      current_character_position: 0 .. clc$max_parameter_list_size,
      current_length: 0 .. clc$max_parameter_list_size,
      remaining_text: 0 .. clc$max_parameter_list_size,
      starting_position: 1 .. clc$max_parameter_list_size,
      terminate_string: string (2),
      command_size: 0 .. osc$max_name_size,
      count: 0 .. clc$max_command_chunk,
      position: 0 .. clc$max_parameter_list_size,
      length: 0 .. clc$max_parameter_list_size,
      indentation_string: string (8);

?? NEWTITLE := 'put', EJECT ??

    PROCEDURE [INLINE] put;

      VAR
        built_line: string (osc$max_string_size),
        built_line_length: integer;


      IF command <> '' THEN
        IF count = 1 THEN
          STRINGREP (built_line, built_line_length, '{ ', command (1, command_size),
                ' ', line^ (position, length), terminate_string);
        ELSE
          IF remaining_text <= width THEN
            terminate_string := '  ';
          IFEND;
          STRINGREP (built_line, built_line_length, '{   ', line^ (position, length), terminate_string);
        IFEND;
        put_line (built_line (1, built_line_length));
      ELSE
        IF count = 1 THEN
          put_line (line^ (position, length));
        ELSE
          STRINGREP (built_line, built_line_length, indentation_string (1, indentation),
                line^ (position, length));
          put_line (built_line (1, built_line_length));
        IFEND;
      IFEND;

    PROCEND put;
?? OLDTITLE, EJECT ??

    current_character_position := 1;  { This is always the next character to examine
    break_position := 1;              { This is the last identified char pos that can start a new line
    remaining_text := line_length;
    count := 0;
    starting_position := 1;           { This is the char position to start the next line to be PUT.
    terminate_string := '..';
    indentation_string := ' ';
    command_size := STRLENGTH (command);

    WHILE remaining_text > 0 DO
      count := count + 1;
      IF remaining_text <= width THEN
        position := starting_position;
        length := remaining_text;
        put;
        RETURN;
      IFEND;

{  FOR loop:
{
{  If we get here then there are more than WIDTH characters left in the line.
{  WIDTH characters are examined to find the last delimiter (space or comma).
{  Whenever a delimiter is found, break_position is set to the following character
{  position.
{
{  Initial conditions:  current_character_position = starting_position
{                       width > 0
{                       break_position = starting_position
{
{  Final conditions:    current_character_position = starting_position + width
{                       current_character_position > starting_position
{                       break_position >= starting_position
{                       break_position <= current_character_position

      break_position := starting_position;
      FOR position := 1 TO width DO
        IF (line^ (current_character_position) = ',') OR (line^ (current_character_position) = ' ') THEN
          break_position := current_character_position + 1;
        IFEND;
        current_character_position := current_character_position + 1;
      FOREND;

      IF break_position > starting_position THEN
        current_character_position := break_position;
      IFEND;

      IF count <> 1 THEN
        WHILE line^ (starting_position) = ' ' DO
          starting_position := starting_position + 1;
        WHILEND;
      IFEND;

      current_length := current_character_position - starting_position;
      position := starting_position;
      length := current_length;
      put;
      starting_position := current_character_position;
      remaining_text := line_length - starting_position + 1;
    WHILEND;

  PROCEND build_and_put;
?? TITLE := 'table_command', EJECT ??

  PROCEDURE table_command
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (osm$genct_table) table (
{   name, n: name 1..24 = $required
{   type, t: key
{       (command, c)
{       (function, f)
{     keyend = command
{   section_name, sn: data_name = $optional
{   scope, s: key
{       local, xdcl
{     keyend = local
{   module, m: data_name = $optional
{   version, v: integer 0..1 = 1
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 13] of clt$pdt_parameter_name,
        parameters: array [1 .. 7] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        type2: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 4] of clt$keyword_specification,
          default_value: string (7),
        recend,
        type3: record
          header: clt$type_specification_header,
        recend,
        type4: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
          default_value: string (5),
        recend,
        type5: record
          header: clt$type_specification_header,
        recend,
        type6: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
          default_value: string (1),
        recend,
        type7: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [88, 10, 27, 14, 30, 48, 739], clc$command, 13, 7, 1, 0, 0, 0, 7, 'OSM$GENCT_TABLE'],
            [['M                              ', clc$abbreviation_entry, 5],
            ['MODULE                         ', clc$nominal_entry, 5],
            ['N                              ', clc$abbreviation_entry, 1],
            ['NAME                           ', clc$nominal_entry, 1],
            ['S                              ', clc$abbreviation_entry, 4],
            ['SCOPE                          ', clc$nominal_entry, 4],
            ['SECTION_NAME                   ', clc$nominal_entry, 3],
            ['SN                             ', clc$abbreviation_entry, 3],
            ['STATUS                         ', clc$nominal_entry, 7],
            ['T                              ', clc$abbreviation_entry, 2],
            ['TYPE                           ', clc$nominal_entry, 2],
            ['V                              ', clc$abbreviation_entry, 6],
            ['VERSION                        ', clc$nominal_entry, 6]], [

{ PARAMETER 1

      [4, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 5, clc$required_parameter, 0, 0],

{ PARAMETER 2

      [11, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 155, clc$optional_default_parameter, 0, 7],

{ PARAMETER 3

      [7, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0],

{ PARAMETER 4

      [6, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 81, clc$optional_default_parameter, 0, 5],

{ PARAMETER 5

      [2, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0],

{ PARAMETER 6

      [13, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 20, clc$optional_default_parameter, 0, 1],

{ PARAMETER 7

      [9, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods [clc$specify_by_name],
            clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
            clc$optional_parameter, 0, 0]],

{ PARAMETER 1

      [[1, 0, clc$name_type], [1, 24]],

{ PARAMETER 2

      [[1, 0, clc$keyword_type], [4], [['C                              ', clc$abbreviation_entry,
            clc$normal_usage_entry, 1], ['COMMAND                        ', clc$nominal_entry,
            clc$normal_usage_entry, 1], ['F                              ', clc$abbreviation_entry,
            clc$normal_usage_entry, 2], ['FUNCTION                       ', clc$nominal_entry,
            clc$normal_usage_entry, 2]], 'command'],

{ PARAMETER 3

      [[1, 0, clc$data_name_type]],

{ PARAMETER 4

      [[1, 0, clc$keyword_type], [2], [['LOCAL                          ', clc$nominal_entry,
            clc$normal_usage_entry, 1], ['XDCL                           ', clc$nominal_entry,
            clc$normal_usage_entry, 2]], 'local'],

{ PARAMETER 5

      [[1, 0, clc$data_name_type]],

{ PARAMETER 6

      [[1, 0, clc$integer_type], [0, 1, 10], '1'],

{ PARAMETER 7

      [[1, 0, clc$status_type]]];

?? POP ??

    CONST
      p$name = 1,
      p$type = 2,
      p$section_name = 3,
      p$scope = 4,
      p$module = 5,
      p$version = 6,
      p$status = 7;

    VAR
      pvt: array [1 .. 7] of clt$parameter_value;


    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    IF entry_count > 0 THEN
      complete_current_table;
      new_table_started := FALSE;
    ELSEIF new_table_started = TRUE THEN
      put_table_header;
      new_table_started := FALSE;
    IFEND;

    table_type := pvt [p$type].value^.keyword_value;

    IF pvt [p$section_name].specified THEN
      section_name := pvt [p$section_name].value^.name_value;
    ELSE
      section_name := '';
    IFEND;

    IF pvt [p$scope].value^.keyword_value = 'LOCAL' THEN
      scope := 'STATIC';
    ELSE
      scope := pvt [p$scope].value^.keyword_value;
    IFEND;

    IF pvt [p$module].specified THEN
      #TRANSLATE (osv$upper_to_lower, pvt [p$module].value^.name_value, module_name);
      IF module_name (3, 2) <> 'm$' THEN
        osp$set_status_abnormal ('CL', cle$improper_module_name, module_name, status);
        RETURN;
      IFEND;
      module_name_size := clp$trimmed_string_size (module_name);
      put_line ('?? RIGHT := 110 ??');
    ELSE
      module_name := '';
    IFEND;

    version := pvt [p$version].value^.integer_value.value;

    table_name := pvt [p$name].value^.name_value;
    name_size := clp$trimmed_string_size (table_name);

    echo_input (parameter_list, 'table', status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    new_table_started := TRUE;

  PROCEND table_command;
?? TITLE := 'complete_current_table', EJECT ??

  PROCEDURE [INLINE] complete_current_table;


    sort_table_entries;
    put_table_header;
    put_table_entries;

    IF xref_count > 0 THEN
      sort_xref_procedures;
      put_xref_procedures;
    IFEND;

    entry_count := 0;
    xref_count := 0;
    ordinal_count := 0;

  PROCEND complete_current_table;
?? TITLE := 'sort_table_entries', EJECT ??

  PROCEDURE [INLINE] sort_table_entries;

    VAR
      current: integer,
      gap: integer,
      start: integer,
      swap: entry;


    gap := entry_count;
    WHILE gap > 1 DO
      gap := 2 * (gap DIV 4) + 1;
      FOR start := 1 TO entry_count - gap DO
        current := start;
        WHILE (current > 0) AND (entry_array^ [current].name > entry_array^ [current + gap].name) DO
          swap := entry_array^ [current];
          entry_array^ [current] := entry_array^ [current + gap];
          entry_array^ [current + gap] := swap;
          current := current - gap;
        WHILEND;
      FOREND;
    WHILEND;

  PROCEND sort_table_entries;
?? TITLE := 'sort_xref_procedures', EJECT ??

  PROCEDURE [INLINE] sort_xref_procedures;

    VAR
      current: integer,
      gap: integer,
      start: integer,
      swap: ost$name;


    gap := xref_count;
    WHILE gap > 1 DO
      gap := 2 * (gap DIV 4) + 1;
      FOR start := 1 TO xref_count - gap DO
        current := start;
        WHILE (current > 0) AND (xref_array^ [current] > xref_array^ [current + gap]) DO
          swap := xref_array^ [current];
          xref_array^ [current] := xref_array^ [current + gap];
          xref_array^ [current + gap] := swap;
          current := current - gap;
        WHILEND;
      FOREND;
    WHILEND;

  PROCEND sort_xref_procedures;
?? TITLE := 'put_line', EJECT ??

  PROCEDURE [INLINE] put_line
    (    line: string ( * ));

    VAR
      ignore_byte_address: amt$file_byte_address,
      status: ost$status;


    amp$put_next (output_file_id, ^line, clp$trimmed_string_size (line), ignore_byte_address, status);
    IF NOT status.normal THEN
      pmp$exit (status);
    IFEND;

  PROCEND put_line;
?? TITLE := 'write_line', EJECT ??

  PROCEDURE write_line
    (    line: ^clt$parameter_list_text;
         indentation: integer);


    IF clp$trimmed_string_size (line^) <= page_width THEN
      put_line (line^);
    ELSE
      build_and_put (line, clp$trimmed_string_size (line^), page_width - indentation, '', indentation);
    IFEND;

  PROCEND write_line;
?? TITLE := 'put_table_header', EJECT ??

  PROCEDURE put_table_header;

    VAR
      header_length: integer,
      header_line: string (osc$max_string_size),
      ignore_status: ost$status,
      index: integer,
      number_string: ost$string,
      scope_size: integer,
      section_size: integer,
      section_string: string (max_page_width),
      string_size: integer,
      table_entry_type: ost$name,
      table_entry_type_size: ost$name_size,
      table_pointer_type: ost$name,
      table_pointer_type_size: ost$name_size,
      temp_length: integer,
      temp_line: string (osc$max_string_size),
      temp_name: ost$name,
      temp_section: ost$name;


    status.normal := TRUE;
    #TRANSLATE (osv$upper_to_lower, table_name, temp_name);
    IF table_type = 'COMMAND' THEN
      table_entry_type := 'clt$command_table_entry';
      table_entry_type_size := 23;
      table_pointer_type := 'clt$command_table';
      table_pointer_type_size := 17;
    ELSEIF version = 0 THEN
      table_entry_type := 'clt$function_table_entry';
      table_entry_type_size := 24;
      table_pointer_type := 'clt$function_table';
      table_pointer_type_size := 18;
    ELSE
      table_entry_type := 'clt$function_proc_table_entry';
      table_entry_type_size := 29;
      table_pointer_type := 'clt$function_processor_table';
      table_pointer_type_size := 28;
    IFEND;
    scope_size := clp$trimmed_string_size (scope);

    IF section_name = '' THEN
      section_string := '';
      string_size := 0;
    ELSE
      #TRANSLATE (osv$upper_to_lower, section_name, temp_section);
      section_size := clp$trimmed_string_size (temp_section);
      STRINGREP (section_string, string_size, ', ', temp_section (1, section_size));
    IFEND;

    IF module_name <> '' THEN
      STRINGREP (header_line, header_length, 'MODULE ', module_name (1, module_name_size), ';');
      put_line (header_line (1, header_length));
      put_line ('?? PUSH (LISTEXT := ON) ??');

      FOR index := 1 TO number_of_types_lines DO
        put_line (types [index] (1, clp$trimmed_string_size (types [index])));
      FOREND;

      IF section_name <> '' THEN
        put_line ('');
        put_line ('  SECTION');
        STRINGREP (header_line, header_length, '    ', temp_section (1, section_size), ': READ;');
        put_line (header_line (1, header_length));
      IFEND;
    ELSE
      put_line ('');
      put_line ('?? PUSH (LISTEXT := ON) ??');
    IFEND;

    put_line ('');
    put_line ('VAR');

    STRINGREP (temp_line, temp_length, '  ', temp_name (1, name_size), ': [', scope (1, scope_size),
          ', READ', section_string (1, string_size), '] ^', table_pointer_type (1, table_pointer_type_size),
          ' := ');

    IF entry_count = 0 THEN
      STRINGREP (header_line, header_length, temp_line (1, temp_length), 'NIL;');
      write_line (^header_line (1, header_length), 6);
      put_line ('');
      put_line ('?? POP ??');
      IF module_name <> '' THEN
        STRINGREP (header_line, header_length, 'MODEND ', module_name (1, module_name_size), ';');
        put_line (header_line (1, header_length));
      IFEND;
    ELSE
      STRINGREP (header_line, header_length, temp_line (1, temp_length), '^', temp_name (1, name_size),
            '_entries,');
      write_line (^header_line (1, header_length), 6);

      put_line ('');
      clp$convert_integer_to_string (entry_count, 10, FALSE, number_string, ignore_status);
      STRINGREP (header_line, header_length, '  ', temp_name (1, name_size), '_entries: [STATIC, READ',
            section_string (1, string_size), '] array [1 .. ', number_string.value (1, number_string.size),
            '] of ', table_entry_type (1, table_entry_type_size), ' := [');
      write_line (^header_line (1, header_length), 6);
    IFEND;

  PROCEND put_table_header;
?? TITLE := 'put_table_entries', EJECT ??

  PROCEDURE put_table_entries;

    CONST
      max_availability_size = 24, {clc$advanced_usage_entry
      max_class_size = 22, {clc$abbreviation_entry
      max_call_method_size = 20, {clc$unspecified_call
      max_log_option_size = 21; {clc$automatically_log

    VAR
      availabilities: [STATIC, READ, oss$job_paged_literal] array [clt$named_entry_availability] of record
        size: 1 .. max_availability_size,
        value: string (max_availability_size),
      recend := [[22, 'clc$normal_usage_entry'], [16, 'clc$hidden_entry'], [24, 'clc$advanced_usage_entry']],
      call_methods: [STATIC, READ, oss$job_paged_literal] array [clt$call_method] of record
        size: 1 .. max_call_method_size,
        value: string (max_call_method_size),
      recend := [[20, 'clc$unspecified_call'], [15, 'clc$linked_call'], [17, 'clc$unlinked_call'], [13,
            'clc$proc_call'], [16, 'clc$program_call']],
      classes: [STATIC, READ, oss$job_paged_literal] array [clt$named_entry_class] of record
        size: 1 .. max_class_size,
        value: string (max_class_size),
      recend := [[17, 'clc$nominal_entry'], [15, 'clc$alias_entry'], [22, 'clc$abbreviation_entry']],
      log_options: [STATIC, READ, oss$job_paged_literal] array [clt$command_log_option] of record
        size: 1 .. max_log_option_size,
        value: string (max_log_option_size),
      recend := [[21, 'clc$automatically_log'], [16, 'clc$manually_log']],
      end_delimeter: string (3),
      ignore_status: ost$status,
      index: integer,
      number_string: ost$string,
      log_option_string: ost$name,
      log_option_length: integer,
      partial_line: string (osc$max_string_size),
      partial_length: integer,
      procedure_name: ost$name,
      procedure_name_size: integer,
      result_length: integer,
      result_line: string (osc$max_string_size);


    status.normal := TRUE;
    end_delimeter := '],';

    FOR index := 1 TO entry_count DO
      procedure_name_size := clp$trimmed_string_size (entry_array^ [index].procedure_name);
      clp$convert_integer_to_string (entry_array^ [index].ordinal, 10, FALSE, number_string, ignore_status);

      IF index = entry_count THEN
        end_delimeter := ']];';
      IFEND;

      STRINGREP (partial_line, partial_length, '  {} [''', entry_array^ [index].
            name, ''', ', classes [entry_array^ [index].class].value (1,
            classes [entry_array^ [index].class].size), ', ',
            availabilities [entry_array^ [index].availability].value (1,
            availabilities [entry_array^ [index].availability].size),
            ', ', number_string.value (1, number_string.size), ',');

      IF table_type = 'COMMAND' THEN
        STRINGREP (log_option_string, log_option_length, ' ',
              log_options [entry_array^ [index].log_option].value
              (1, log_options [entry_array^ [index].log_option].size), ',');
      ELSE
        log_option_string := '';
        log_option_length := 0;
      IFEND;
      CASE entry_array^ [index].call_method OF
      = clc$linked_call =
        #TRANSLATE (osv$upper_to_lower, entry_array^ [index].procedure_name, procedure_name);
        STRINGREP (result_line, result_length, partial_line (1, partial_length),
              log_option_string (1, log_option_length), ' ', call_methods [entry_array^ [index].call_method].
              value (1, call_methods [entry_array^ [index].call_method].size),
              ', ^', procedure_name (1, procedure_name_size), end_delimeter);

      = clc$unlinked_call, clc$proc_call, clc$program_call =
        STRINGREP (result_line, result_length, partial_line (1, partial_length),
              log_option_string (1, log_option_length), ' ', call_methods [entry_array^ [index].call_method].
              value (1, call_methods [entry_array^ [index].call_method].size), ', ''',
              entry_array^ [index].procedure_name (1, procedure_name_size), '''', end_delimeter);

      CASEND;
      write_line (^result_line (1, result_length), 8);

    FOREND;

    IF xref_count = 0 THEN
      put_line ('');
      put_line ('?? POP ??');
      IF module_name <> '' THEN
        put_line ('');
        STRINGREP (result_line, result_length, 'MODEND ', module_name (1, module_name_size), ';');
        put_line (result_line (1, result_length));
      IFEND;
    IFEND;

  PROCEND put_table_entries;
?? TITLE := 'put_xref_procedures', EJECT ??

  PROCEDURE put_xref_procedures;

    VAR
      declaration_count: integer,
      length: integer,
      name_size: 0 .. osc$max_name_size,
      temp_name: ost$name,
      xref_line: string (osc$max_string_size);


  /check_for_duplicates/
    FOR declaration_count := 1 TO xref_count DO
      IF declaration_count < xref_count THEN
        IF xref_array^ [declaration_count] = xref_array^ [declaration_count + 1] THEN
          CYCLE /check_for_duplicates/;
        IFEND;
      IFEND;

      #TRANSLATE (osv$upper_to_lower, xref_array^ [declaration_count], temp_name);
      name_size := clp$trimmed_string_size (temp_name);

      put_line ('');
      STRINGREP (xref_line, length, '  PROCEDURE [XREF] ', temp_name (1, name_size));
      write_line (^xref_line (1, length), 4);
      IF table_type = 'COMMAND' THEN
        put_line ('    (    parameter_list: clt$parameter_list;');
      ELSEIF version = 1 THEN
        put_line ('    (    parameter_list: clt$parameter_list;');
        put_line ('     VAR work_area {input, output} : ^clt$work_area;');
        put_line ('     VAR result: ^clt$data_value;');
      ELSE
        put_line ('    (    function_name: clt$name;');
        put_line ('         argument_list: string ( * );');
        put_line ('     VAR value: clt$value;');
      IFEND;
      put_line ('     VAR status: ost$status);');
    FOREND /check_for_duplicates/;

    put_line ('');
    put_line ('?? POP ??');
    put_line ('');
    IF module_name <> '' THEN
      STRINGREP (xref_line, length, 'MODEND ', module_name (1, module_name_size), ';');
      put_line (xref_line (1, length));
      put_line ('');
    IFEND;

  PROCEND put_xref_procedures;
?? TITLE := 'command_command', EJECT ??

  PROCEDURE command_command
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (osm$genct_command) command (
{   name, names, n: any of
{       data_name
{       list of data_name
{     anyend = $required
{   processor, p: data_name = $required
{   call_method, cm: key
{       local, xref, load, procedure, proc, program
{     keyend = local
{   availability, a: key
{       (normal_usage, a, advertised, nu)
{       (advanced_usage, au)
{       (hidden, h)
{     keyend = normal_usage
{   log, l: key
{       (automatic, a)
{       (manual, m)
{     keyend = automatic
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 12] of clt$pdt_parameter_name,
      parameters: array [1 .. 6] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
          recend,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 6] of clt$keyword_specification,
        default_value: string (5),
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 8] of clt$keyword_specification,
        default_value: string (12),
      recend,
      type5: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
        default_value: string (9),
      recend,
      type6: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 5, 10, 9, 28, 28, 646],
    clc$command, 12, 6, 2, 0, 0, 0, 6, 'OSM$GENCT_COMMAND'], [
    ['A                              ',clc$abbreviation_entry, 4],
    ['AVAILABILITY                   ',clc$nominal_entry, 4],
    ['CALL_METHOD                    ',clc$nominal_entry, 3],
    ['CM                             ',clc$abbreviation_entry, 3],
    ['L                              ',clc$abbreviation_entry, 5],
    ['LOG                            ',clc$nominal_entry, 5],
    ['N                              ',clc$abbreviation_entry, 1],
    ['NAME                           ',clc$nominal_entry, 1],
    ['NAMES                          ',clc$alias_entry, 1],
    ['P                              ',clc$abbreviation_entry, 2],
    ['PROCESSOR                      ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 6]],
    [
{ PARAMETER 1
    [8, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 42, clc$required_parameter, 0, 0],
{ PARAMETER 2
    [11, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$required_parameter, 0, 0],
{ PARAMETER 3
    [3, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 229, clc$optional_default_parameter, 0, 5],
{ PARAMETER 4
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 303, clc$optional_default_parameter, 0, 12],
{ PARAMETER 5
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 155, clc$optional_default_parameter, 0, 9],
{ PARAMETER 6
    [12, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$data_name_type,
    clc$list_type],
    FALSE, 2],
    3, [[1, 0, clc$data_name_type]],
    19, [[1, 0, clc$list_type], [3, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$data_name_type]]
      ]
    ],
{ PARAMETER 2
    [[1, 0, clc$data_name_type]],
{ PARAMETER 3
    [[1, 0, clc$keyword_type], [6], [
    ['LOAD                           ', clc$nominal_entry,
  clc$normal_usage_entry, 3],
    ['LOCAL                          ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
    ['PROC                           ', clc$nominal_entry,
  clc$normal_usage_entry, 5],
    ['PROCEDURE                      ', clc$nominal_entry,
  clc$normal_usage_entry, 4],
    ['PROGRAM                        ', clc$nominal_entry,
  clc$normal_usage_entry, 6],
    ['XREF                           ', clc$nominal_entry,
  clc$normal_usage_entry, 2]]
    ,
    'local'],
{ PARAMETER 4
    [[1, 0, clc$keyword_type], [8], [
    ['A                              ', clc$alias_entry,
  clc$normal_usage_entry, 1],
    ['ADVANCED_USAGE                 ', clc$nominal_entry,
  clc$normal_usage_entry, 2],
    ['ADVERTISED                     ', clc$alias_entry,
  clc$normal_usage_entry, 1],
    ['AU                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 2],
    ['H                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 3],
    ['HIDDEN                         ', clc$nominal_entry,
  clc$normal_usage_entry, 3],
    ['NORMAL_USAGE                   ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
    ['NU                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 1]]
    ,
    'normal_usage'],
{ PARAMETER 5
    [[1, 0, clc$keyword_type], [4], [
    ['A                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 1],
    ['AUTOMATIC                      ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
    ['M                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 2],
    ['MANUAL                         ', clc$nominal_entry,
  clc$normal_usage_entry, 2]]
    ,
    'automatic'],
{ PARAMETER 6
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$name = 1,
      p$processor = 2,
      p$call_method = 3,
      p$availability = 4,
      p$log = 5,
      p$status = 6;

    VAR
      pvt: array [1 .. 6] of clt$parameter_value;


    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    IF table_name = '' THEN
      osp$set_status_abnormal ('CL', cle$unexpected_entry, 'TABLE', status);
      osp$append_status_parameter (osc$status_parameter_delimiter, 'COMMAND', status);
      RETURN;
    ELSEIF table_type <> 'COMMAND' THEN
      osp$set_status_abnormal ('CL', cle$unexpected_entry, table_type, status);
      osp$append_status_parameter (osc$status_parameter_delimiter, 'COMMAND', status);
      RETURN;
    IFEND;

    echo_input (parameter_list, 'command', status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    save_entries (pvt [p$name].value, pvt [p$processor].value^.data_name_value,
          pvt [p$call_method].value^.keyword_value, pvt [p$availability].value^.keyword_value,
          pvt [p$log].value^.keyword_value, status);

  PROCEND command_command;
?? TITLE := 'function_command', EJECT ??

  PROCEDURE function_command
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (osm$genct_function) function (
{   name, names, n: any of
{       data_name
{       list of data_name
{     anyend = $required
{   processor, p: data_name = $required
{   call_method, cm: key
{       local, xref, load, procedure, proc, program
{     keyend = local
{   availability, a: key
{       (normal_usage, a, advertised, nu)
{       (advanced_usage, au)
{       (hidden, h)
{     keyend = normal_usage
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 10] of clt$pdt_parameter_name,
      parameters: array [1 .. 5] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
          recend,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 6] of clt$keyword_specification,
        default_value: string (5),
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 8] of clt$keyword_specification,
        default_value: string (12),
      recend,
      type5: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 5, 10, 9, 26, 16, 908],
    clc$command, 10, 5, 2, 0, 0, 0, 5, 'OSM$GENCT_FUNCTION'], [
    ['A                              ',clc$abbreviation_entry, 4],
    ['AVAILABILITY                   ',clc$nominal_entry, 4],
    ['CALL_METHOD                    ',clc$nominal_entry, 3],
    ['CM                             ',clc$abbreviation_entry, 3],
    ['N                              ',clc$abbreviation_entry, 1],
    ['NAME                           ',clc$nominal_entry, 1],
    ['NAMES                          ',clc$alias_entry, 1],
    ['P                              ',clc$abbreviation_entry, 2],
    ['PROCESSOR                      ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 5]],
    [
{ PARAMETER 1
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 42, clc$required_parameter, 0, 0],
{ PARAMETER 2
    [9, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$required_parameter, 0, 0],
{ PARAMETER 3
    [3, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 229, clc$optional_default_parameter, 0, 5],
{ PARAMETER 4
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 303, clc$optional_default_parameter, 0, 12],
{ PARAMETER 5
    [10, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$data_name_type,
    clc$list_type],
    FALSE, 2],
    3, [[1, 0, clc$data_name_type]],
    19, [[1, 0, clc$list_type], [3, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$data_name_type]]
      ]
    ],
{ PARAMETER 2
    [[1, 0, clc$data_name_type]],
{ PARAMETER 3
    [[1, 0, clc$keyword_type], [6], [
    ['LOAD                           ', clc$nominal_entry,
  clc$normal_usage_entry, 3],
    ['LOCAL                          ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
    ['PROC                           ', clc$nominal_entry,
  clc$normal_usage_entry, 5],
    ['PROCEDURE                      ', clc$nominal_entry,
  clc$normal_usage_entry, 4],
    ['PROGRAM                        ', clc$nominal_entry,
  clc$normal_usage_entry, 6],
    ['XREF                           ', clc$nominal_entry,
  clc$normal_usage_entry, 2]]
    ,
    'local'],
{ PARAMETER 4
    [[1, 0, clc$keyword_type], [8], [
    ['A                              ', clc$alias_entry,
  clc$normal_usage_entry, 1],
    ['ADVANCED_USAGE                 ', clc$nominal_entry,
  clc$normal_usage_entry, 2],
    ['ADVERTISED                     ', clc$alias_entry,
  clc$normal_usage_entry, 1],
    ['AU                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 2],
    ['H                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 3],
    ['HIDDEN                         ', clc$nominal_entry,
  clc$normal_usage_entry, 3],
    ['NORMAL_USAGE                   ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
    ['NU                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 1]]
    ,
    'normal_usage'],
{ PARAMETER 5
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$name = 1,
      p$processor = 2,
      p$call_method = 3,
      p$availability = 4,
      p$status = 5;

    VAR
      pvt: array [1 .. 5] of clt$parameter_value;


    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    IF table_name = '' THEN
      osp$set_status_abnormal ('CL', cle$unexpected_entry, 'TABLE', status);
      osp$append_status_parameter (osc$status_parameter_delimiter, 'FUNCTION', status);
      RETURN;
    ELSEIF table_type <> 'FUNCTION' THEN
      osp$set_status_abnormal ('CL', cle$unexpected_entry, table_type, status);
      osp$append_status_parameter (osc$status_parameter_delimiter, 'FUNCTION', status);
      RETURN;
    IFEND;

    echo_input (parameter_list, 'function', status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    save_entries (pvt [p$name].value, pvt [p$processor].value^.data_name_value,
          pvt [p$call_method].value^.keyword_value, pvt [p$availability].value^.keyword_value, osc$null_name,
          status);

  PROCEND function_command;
?? TITLE := 'save_entries', EJECT ??

  PROCEDURE save_entries
    (    name_parameter: ^clt$data_value;
         processor: ost$name;
         call_method_keyword: clt$keyword;
         availability_keyword: clt$keyword;
         log_option_keyword: clt$keyword;
     VAR status: ost$status);

    VAR
      availability: clt$named_entry_availability,
      call_method: clt$call_method,
      call_method_is_xref: boolean,
      class: clt$named_entry_class,
      first_name: boolean,
      index: integer,
      log_option: clt$command_log_option,
      node: ^clt$data_value;


    status.normal := TRUE;
    ordinal_count := ordinal_count + 1;

    call_method_is_xref := FALSE;
    IF call_method_keyword = 'XREF' THEN
      call_method := clc$linked_call;
      call_method_is_xref := TRUE;
    ELSEIF call_method_keyword = 'LOCAL' THEN
      call_method := clc$linked_call;
    ELSEIF call_method_keyword = 'LOAD' THEN
      call_method := clc$unlinked_call;
    ELSEIF (call_method_keyword = 'PROCEDURE') OR (call_method_keyword = 'PROC') THEN
      call_method := clc$proc_call;
    ELSE {call_method_keyword = 'PROGRAM'}
      call_method := clc$program_call;
    IFEND;

    IF availability_keyword = 'NORMAL_USAGE' THEN
      availability := clc$normal_usage_entry;
    ELSEIF availability_keyword = 'ADVANCED_USAGE' THEN
      availability := clc$advanced_usage_entry;
    ELSE {availability_keyword = 'HIDDEN'}
      availability := clc$hidden_entry;
    IFEND;

    IF log_option_keyword = 'MANUAL' THEN
      log_option := clc$manually_log;
    ELSE {log_option_keyword = 'AUTOMATIC' OR table_type = 'FUNCTION'}
      log_option := clc$automatically_log;
    IFEND;

    IF name_parameter^.kind = clc$data_name THEN
      PUSH node;
      node^.kind := clc$list;
      node^.element_value := name_parameter;
      node^.link := NIL;
      node^.generated_via_list_rest := FALSE;
    ELSE
      node := name_parameter;
    IFEND;

    first_name := TRUE;
    WHILE node <> NIL DO
      IF (table_name = 'FUNCTION') AND (node^.element_value^.data_name_value (1) <> '$') THEN
        osp$set_status_abnormal ('CL', cle$function_name_needs_$, node^.element_value^.data_name_value,
              status);
        RETURN;
      IFEND;

      FOR index := 1 TO entry_count DO
        IF node^.element_value^.data_name_value = entry_array^ [index].name THEN
          osp$set_status_abnormal ('CL', cle$duplicate_cmnd_or_fcn_name, node^.element_value^.data_name_value,
                status);
          RETURN;
        IFEND;
      FOREND;

      entry_count := entry_count + 1;
      entry_array^ [entry_count].name := node^.element_value^.data_name_value;
      entry_array^ [entry_count].availability := availability;
      entry_array^ [entry_count].ordinal := ordinal_count;
      entry_array^ [entry_count].procedure_name := processor;
      entry_array^ [entry_count].call_method := call_method;
      entry_array^ [entry_count].log_option := log_option;
      IF first_name THEN
        entry_array^ [entry_count].class := clc$nominal_entry;
      ELSEIF node^.link = NIL THEN
        entry_array^ [entry_count].class := clc$abbreviation_entry;
      ELSE
        entry_array^ [entry_count].class := clc$alias_entry;
      IFEND;

      first_name := FALSE;
      node := node^.link;
    WHILEND;

    IF call_method_is_xref THEN
      xref_count := xref_count + 1;
      xref_array^ [xref_count] := processor;
    IFEND;

  PROCEND save_entries;
?? TITLE := 'tablend_command', EJECT ??

  PROCEDURE tablend_command
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (osm$genct_tablend) tablend, end (
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 1] of clt$pdt_parameter_name,
        parameters: array [1 .. 1] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [88, 10, 27, 13, 24, 44, 521], clc$command, 1, 1, 0, 0, 0, 0, 1, 'OSM$GENCT_TABLEND'],
            [['STATUS                         ', clc$nominal_entry, 1]], [

{ PARAMETER 1

      [1, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods [clc$specify_by_name],
            clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
            clc$optional_parameter, 0, 0]],

{ PARAMETER 1

      [[1, 0, clc$status_type]]];

?? POP ??

    CONST
      p$status = 1;

    VAR
      pvt: array [1 .. 1] of clt$parameter_value;

    VAR
      interactive: boolean;


    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    echo_input (parameter_list, 'tablend', status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$get_command_origin (interactive, status);
    IF status.normal AND interactive THEN
      clp$end_include (utility_name, status);
    IFEND;

  PROCEND tablend_command;
?? TITLE := 'clp$generate_command_table', EJECT ??

  PROGRAM clp$generate_command_table
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (osm$genct) generate_command_table, genct (
{   input, i: file = $required
{   output, o: file = $required
{   page_width, pw: integer 79..110 = 79
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 7] of clt$pdt_parameter_name,
        parameters: array [1 .. 4] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
        recend,
        type2: record
          header: clt$type_specification_header,
        recend,
        type3: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
          default_value: string (2),
        recend,
        type4: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [88, 10, 28, 11, 51, 42, 665], clc$command, 7, 4, 2, 0, 0, 0, 4, 'OSM$GENCT'],
            [['I                              ', clc$abbreviation_entry, 1],
            ['INPUT                          ', clc$nominal_entry, 1],
            ['O                              ', clc$abbreviation_entry, 2],
            ['OUTPUT                         ', clc$nominal_entry, 2],
            ['PAGE_WIDTH                     ', clc$nominal_entry, 3],
            ['PW                             ', clc$abbreviation_entry, 3],
            ['STATUS                         ', clc$nominal_entry, 4]], [

{ PARAMETER 1

      [2, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 3, clc$required_parameter, 0, 0],

{ PARAMETER 2

      [4, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 3, clc$required_parameter, 0, 0],

{ PARAMETER 3

      [5, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 20, clc$optional_default_parameter, 0, 2],

{ PARAMETER 4

      [7, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods [clc$specify_by_name],
            clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
            clc$optional_parameter, 0, 0]],

{ PARAMETER 1

      [[1, 0, clc$file_type]],

{ PARAMETER 2

      [[1, 0, clc$file_type]],

{ PARAMETER 3

      [[1, 0, clc$integer_type], [79, 110, 10], '79'],

{ PARAMETER 4

      [[1, 0, clc$status_type]]];

?? POP ??

    CONST
      p$input = 1,
      p$output = 2,
      p$page_width = 3,
      p$status = 4;

    VAR
      pvt: array [1 .. 4] of clt$parameter_value;

{ table command_table t=c sn=oss$job_paged_literal s=local
{ command command        command_command  cm=local
{ command function       function_command cm=local
{ command table          table_command    cm=local
{ command (tablend, end) tablend_command  cm=local
{ tablend

?? PUSH (LISTEXT := ON) ??

    VAR
      command_table: [STATIC, READ, oss$job_paged_literal] ^clt$command_table := ^command_table_entries,

      command_table_entries: [STATIC, READ, oss$job_paged_literal] array [1 .. 5] of
            clt$command_table_entry := [
            {} ['COMMAND                        ', clc$nominal_entry, clc$normal_usage_entry, 1,
            clc$automatically_log, clc$linked_call, ^command_command],
            {} ['END                            ', clc$abbreviation_entry, clc$normal_usage_entry, 4,
            clc$automatically_log, clc$linked_call, ^tablend_command],
            {} ['FUNCTION                       ', clc$nominal_entry, clc$normal_usage_entry, 2,
            clc$automatically_log, clc$linked_call, ^function_command],
            {} ['TABLE                          ', clc$nominal_entry, clc$normal_usage_entry, 3,
            clc$automatically_log, clc$linked_call, ^table_command],
            {} ['TABLEND                        ', clc$nominal_entry, clc$normal_usage_entry, 4,
            clc$automatically_log, clc$linked_call, ^tablend_command]];

?? POP ??

    VAR
      attachment_options: array [1 .. 3] of fst$attachment_option,
      default_creation_attributes: array [1 .. 2] of fst$file_cycle_attribute,
      local_status: ost$status,
      segment_pointer: amt$segment_pointer,
      utility_attributes: array [1 .. 4] of clt$utility_attribute,
      validation_attributes: array [1 .. 4] of fst$file_cycle_attribute;


    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    page_width := pvt [p$page_width].value^.integer_value.value;

    attachment_options [1].selector := fsc$access_and_share_modes;
    attachment_options [1].access_modes.selector := fsc$specific_access_modes;
    attachment_options [1].access_modes.value := $fst$file_access_options [fsc$append, fsc$shorten];
    attachment_options [1].share_modes.selector := fsc$specific_share_modes;
    attachment_options [1].share_modes.value := $fst$file_access_options [];
    attachment_options [2].selector := fsc$access_and_share_modes;
    attachment_options [2].access_modes.selector := fsc$specific_access_modes;
    attachment_options [2].access_modes.value := $fst$file_access_options [fsc$append];
    attachment_options [2].share_modes.selector := fsc$specific_share_modes;
    attachment_options [2].share_modes.value := $fst$file_access_options [];
    attachment_options [3].selector := fsc$open_share_modes;
    attachment_options [3].open_share_modes := -$fst$file_access_options [];
    validation_attributes [1].selector := fsc$file_contents_and_processor;
    validation_attributes [1].file_contents := fsc$legible_data;
    validation_attributes [1].file_processor := osc$null_name;
    validation_attributes [2].selector := fsc$file_contents_and_processor;
    validation_attributes [2].file_contents := amc$legible;
    validation_attributes [2].file_processor := osc$null_name;
    validation_attributes [3].selector := fsc$file_contents_and_processor;
    validation_attributes [3].file_contents := fsc$data;
    validation_attributes [3].file_processor := osc$null_name;
    validation_attributes [4].selector := fsc$file_contents_and_processor;
    validation_attributes [4].file_contents := fsc$unknown_contents;
    validation_attributes [4].file_processor := osc$null_name;
    default_creation_attributes [1].selector := fsc$file_contents_and_processor;
    default_creation_attributes [1].file_contents := fsc$legible_data;
    default_creation_attributes [1].file_processor := osc$null_name;
    default_creation_attributes [2].selector := fsc$page_format;
    default_creation_attributes [2].page_format := amc$untitled_form;
    fsp$open_file (pvt [p$output].value^.file_value^, amc$record, ^attachment_options,
          ^default_creation_attributes, NIL, ^validation_attributes, NIL, output_file_id, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  /generate_command_table/
    BEGIN
      mmp$create_scratch_segment (amc$sequence_pointer, mmc$as_sequential, segment_pointer, status);
      IF NOT status.normal THEN
        EXIT /generate_command_table/;
      IFEND;
      RESET segment_pointer.sequence_pointer;
      NEXT entry_array: [1 .. #SIZE (segment_pointer.sequence_pointer^) DIV #SIZE (entry)] IN
            segment_pointer.sequence_pointer;

      mmp$create_scratch_segment (amc$sequence_pointer, mmc$as_sequential, segment_pointer, status);
      IF NOT status.normal THEN
        EXIT /generate_command_table/;
      IFEND;
      RESET segment_pointer.sequence_pointer;
      NEXT xref_array: [1 .. #SIZE (segment_pointer.sequence_pointer^) DIV #SIZE (ost$name)] IN
            segment_pointer.sequence_pointer;

      utility_attributes [1].key := clc$utility_command_search_mode;
      utility_attributes [1].command_search_mode := clc$global_command_search;
      utility_attributes [2].key := clc$utility_command_table;
      utility_attributes [2].command_table := command_table;
      utility_attributes [3].key := clc$utility_termination_command;
      utility_attributes [3].termination_command := 'tablend';
      utility_attributes [4].key := clc$utility_prompt;
      utility_attributes [4].prompt.value := prompt_string;
      utility_attributes [4].prompt.size := prompt_string_size;
      clp$begin_utility (utility_name, utility_attributes, status);
      IF NOT status.normal THEN
        EXIT /generate_command_table/;
      IFEND;

      clp$include_file (pvt [p$input].value^.file_value^, prompt_string, utility_name, status);
      IF NOT status.normal THEN
        EXIT /generate_command_table/;
      IFEND;

      clp$end_utility (utility_name, status);
      IF NOT status.normal THEN
        EXIT /generate_command_table/;
      IFEND;

      IF entry_count > 0 THEN
        complete_current_table;
      ELSEIF new_table_started = TRUE THEN
        put_table_header;
        new_table_started := FALSE;
      IFEND;
    END /generate_command_table/;

    fsp$close_file (output_file_id, local_status);
    IF (NOT local_status.normal) AND status.normal THEN
      status := local_status;
    IFEND;

  PROCEND clp$generate_command_table;

MODEND clm$generate_command_table;
