
?? LEFT := 1, RIGHT := 110 ??
?? FMT (FORMAT := ON) ??
?? SET (LIST := ON, LISTCTS := OFF) ??
?? NEWTITLE := 'Analyze_Binary_Log - Analyze NOS/VE Binary Log' ??
MODULE ptm$analyze_binary_log;

{ PURPOSE:
{   This module contains the command and subcommands for the NOS/VE Analyze Binary Log Utility.  The utility
{ is used to read and report the contents of NOS/VE binary logs.
{
{ DESIGN:
{   This utility is a standalone utility outside of the operating system.  It is available to all users.
{
{   The utility can read active and non active logs.  Some active logs are restricted to certain  users,
{ e.g. account_log is restricted to an accounting administrator and the engineering_log is restricted to an
{ engineering_administrator.  This restriction will be implemented in a future release.  The only protection
{ for these logs are a file's ring attributes.
{
{   This utility runs in the caller's ring.
{
{ NOTES:
{   Applicable documents for the Analyze_Binary_Log utility include:
{   NOS/VE System Performance and maintenance, Volume 1
{
{   The procedures are arranged in two groups:
{   1)  Internal procedures are in alphabetical order
{   2)  Subcommand procedures are ordered as follows:
{       Add_Selection
{       Change_Selection
{       Delete_Selection
{       Display_Selection
{       Add_Field
{       Change_Field
{       Delete_Field
{       Display_Field
{       Put_Field_summary
{       Put_interval_Field
{       Put_Field
{       Put_String
{       Put_Record
{       Change_Put
{       Delete_Put
{       Display_Put
{       Generate_Report
{       Generate_Log
{       Change_Defaults
{       Display_Defaults
{       Display_Logged_Statistic
{       Quit

?? NEWTITLE := 'Global Declarations Referenced By This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc sfd$type_declarations
*copyc bat$record_header_type
*copyc clt$file_reference
*copyc clt$parameter_list
*copyc lgt$log_read_activity
*copyc sft$statistic_buffer
*copyc sft$statistic_header
?? POP ??
*copyc clf#make_date_time_value
*copyc clf#make_integer_value
*copyc clf#make_list_value
*copyc clf#make_name_value
*copyc clf#make_record_header_value
*copyc clp#add_record_field

*copyc amp$fetch_access_information
*copyc amp$get_file_attributes
*copyc amp$get_next
*copyc amp$get_segment_pointer
*copyc amp$put_next
*copyc amp$set_segment_eoi
*copyc clp$begin_utility
*copyc clp$convert_date_time_to_string
*copyc clp$convert_integer_to_rjstring
*copyc clp$convert_integer_to_string
*copyc clp$convert_string_to_file_ref
*copyc clp$convert_string_to_integer
*copyc clp$end_include
*copyc clp$end_utility
*copyc clp$evaluate_parameters
*copyc clp$get_reason_for_call
*copyc clp$get_variable
*copyc clp$include_file
*copyc clp$trimmed_string_size
*copyc cyp$close_file
*copyc cyp$current_display_line
*copyc cyp$display_page_eject
*copyc cyp$display_page_length
*copyc cyp$display_standard_title
*copyc cyp$file_connected_to_terminal
*copyc cyp$open_file
*copyc cyp$page_width
*copyc cyp$put_next_line
*copyc cyp$start_new_display_page
*copyc cyp$write_end_of_line
*copyc fsp$close_file
*copyc fsp$open_file
*copyc lgp$close_log_file
*copyc lgp$get_next_statistic
*copyc lgp$open_log_file
*copyc lgp$rewind_log_file
*copyc mlp$rsqrt
*copyc mmp$create_scratch_segment
*copyc mmp$delete_scratch_segment
*copyc osp$append_status_file
*copyc osp$append_status_integer
*copyc osp$append_status_parameter
*copyc osp$disestablish_cond_handler
*copyc osp$establish_condition_handler
*copyc osp$format_message
*copyc osp$set_status_abnormal
*copyc osp$set_status_condition
*copyc osp$set_status_from_condition
*copyc pmp$compute_date_time
*copyc pmp$compute_date_time_increment
*copyc pmp$continue_to_cause
*copyc pmp$get_unique_name
*copyc sfp$convert_stat_code_to_name
*copyc sfp$convert_stat_name_to_code
?? OLDTITLE ??
?? NEWTITLE := 'Command Table', EJECT ??

{ table n=anabl_cmd_table t=command s=local
{ command n=(add_selection, adds)                         p=add_selection_cmd             cm=local
{ command n=(change_selection, chas)                      p=change_selection_cmd          cm=local
{ command n=(delete_selection, delete_selections, dels)   p=delete_selection_cmd          cm=local
{ command n=(display_selection, display_selections, diss) p=display_selection_cmd         cm=local
{ command n=(add_field, addf)                             p=add_field_cmd                 cm=local
{ command n=(change_field, chaf)                          p=change_field_cmd              cm=local
{ command n=(delete_field, delete_fields, delf)           p=delete_field_cmd              cm=local
{ command n=(display_field, display_fields, disf)         p=display_field_cmd             cm=local
{ command n=(pop_page_header, popph)                      p=pop_page_header_cmd           cm=local
{ command n=(push_page_header, pusph)                     p=push_page_header_cmd          cm=local
{ command n=(put_field_summary, putfs)                    p=put_field_summary_cmd         cm=local
{ command n=(put_interval_field, putif)                   p=put_interval_field_cmd        cm=local
{ command n=(put_field, putf)                             p=put_field_cmd                 cm=local
{ command n=(put_new_page, putnp)                         p=put_new_page_cmd              cm=local
{ command n=(put_string, puts)                            p=put_string_cmd                cm=local
{ command n=(put_record, put_records, putr)               p=put_record_cmd                cm=local
{ command n=(change_put, chap)                            p=change_put_cmd                cm=local
{ command n=(delete_put, delp)                            p=delete_put_cmd                cm=local
{ command n=(display_put, disp)                           p=display_put_cmd               cm=local
{ command n=(generate_report, genr)                       p=generate_report_cmd           cm=local
{ command n=(generate_log, genl)                          p=generate_log_cmd              cm=local
{ command n=(change_defaults, change_default, chad)       p=change_defaults_cmd           cm=local
{ command n=(display_defaults, display_default, disd)     p=display_defaults_cmd          cm=local
{ command n=(display_logged_statistics, disls)            p=display_logged_statistics_cmd cm=local
{ command n=(quit, qui)                                   p=quit_cmd                      cm=local
{ tablend

?? PUSH (LISTEXT := ON) ??

VAR
  anabl_cmd_table: [STATIC, READ] ^clt$command_table := ^anabl_cmd_table_entries,

  anabl_cmd_table_entries: [STATIC, READ] array [1 .. 57] of clt$command_table_entry := [
  {} ['ADDF                           ', clc$abbreviation_entry, clc$normal_usage_entry, 5,
        clc$automatically_log, clc$linked_call, ^add_field_cmd],
  {} ['ADDS                           ', clc$abbreviation_entry, clc$normal_usage_entry, 1,
        clc$automatically_log, clc$linked_call, ^add_selection_cmd],
  {} ['ADD_FIELD                      ', clc$nominal_entry, clc$normal_usage_entry, 5,
        clc$automatically_log, clc$linked_call, ^add_field_cmd],
  {} ['ADD_SELECTION                  ', clc$nominal_entry, clc$normal_usage_entry, 1,
        clc$automatically_log, clc$linked_call, ^add_selection_cmd],
  {} ['CHAD                           ', clc$abbreviation_entry, clc$normal_usage_entry, 22,
        clc$automatically_log, clc$linked_call, ^change_defaults_cmd],
  {} ['CHAF                           ', clc$abbreviation_entry, clc$normal_usage_entry, 6,
        clc$automatically_log, clc$linked_call, ^change_field_cmd],
  {} ['CHANGE_DEFAULT                 ', clc$alias_entry, clc$normal_usage_entry, 22,
        clc$automatically_log, clc$linked_call, ^change_defaults_cmd],
  {} ['CHANGE_DEFAULTS                ', clc$nominal_entry, clc$normal_usage_entry, 22,
        clc$automatically_log, clc$linked_call, ^change_defaults_cmd],
  {} ['CHANGE_FIELD                   ', clc$nominal_entry, clc$normal_usage_entry, 6,
        clc$automatically_log, clc$linked_call, ^change_field_cmd],
  {} ['CHANGE_PUT                     ', clc$nominal_entry, clc$normal_usage_entry, 17,
        clc$automatically_log, clc$linked_call, ^change_put_cmd],
  {} ['CHANGE_SELECTION               ', clc$nominal_entry, clc$normal_usage_entry, 2,
        clc$automatically_log, clc$linked_call, ^change_selection_cmd],
  {} ['CHAP                           ', clc$abbreviation_entry, clc$normal_usage_entry, 17,
        clc$automatically_log, clc$linked_call, ^change_put_cmd],
  {} ['CHAS                           ', clc$abbreviation_entry, clc$normal_usage_entry, 2,
        clc$automatically_log, clc$linked_call, ^change_selection_cmd],
  {} ['DELETE_FIELD                   ', clc$nominal_entry, clc$normal_usage_entry, 7,
        clc$automatically_log, clc$linked_call, ^delete_field_cmd],
  {} ['DELETE_FIELDS                  ', clc$alias_entry, clc$normal_usage_entry, 7,
        clc$automatically_log, clc$linked_call, ^delete_field_cmd],
  {} ['DELETE_PUT                     ', clc$nominal_entry, clc$normal_usage_entry, 18,
        clc$automatically_log, clc$linked_call, ^delete_put_cmd],
  {} ['DELETE_SELECTION               ', clc$nominal_entry, clc$normal_usage_entry, 3,
        clc$automatically_log, clc$linked_call, ^delete_selection_cmd],
  {} ['DELETE_SELECTIONS              ', clc$alias_entry, clc$normal_usage_entry, 3,
        clc$automatically_log, clc$linked_call, ^delete_selection_cmd],
  {} ['DELF                           ', clc$abbreviation_entry, clc$normal_usage_entry, 7,
        clc$automatically_log, clc$linked_call, ^delete_field_cmd],
  {} ['DELP                           ', clc$abbreviation_entry, clc$normal_usage_entry, 18,
        clc$automatically_log, clc$linked_call, ^delete_put_cmd],
  {} ['DELS                           ', clc$abbreviation_entry, clc$normal_usage_entry, 3,
        clc$automatically_log, clc$linked_call, ^delete_selection_cmd],
  {} ['DISD                           ', clc$abbreviation_entry, clc$normal_usage_entry, 23,
        clc$automatically_log, clc$linked_call, ^display_defaults_cmd],
  {} ['DISF                           ', clc$abbreviation_entry, clc$normal_usage_entry, 8,
        clc$automatically_log, clc$linked_call, ^display_field_cmd],
  {} ['DISLS                          ', clc$abbreviation_entry, clc$normal_usage_entry, 24,
        clc$automatically_log, clc$linked_call, ^display_logged_statistics_cmd],
  {} ['DISP                           ', clc$abbreviation_entry, clc$normal_usage_entry, 19,
        clc$automatically_log, clc$linked_call, ^display_put_cmd],
  {} ['DISPLAY_DEFAULT                ', clc$alias_entry, clc$normal_usage_entry, 23,
        clc$automatically_log, clc$linked_call, ^display_defaults_cmd],
  {} ['DISPLAY_DEFAULTS               ', clc$nominal_entry, clc$normal_usage_entry, 23,
        clc$automatically_log, clc$linked_call, ^display_defaults_cmd],
  {} ['DISPLAY_FIELD                  ', clc$nominal_entry, clc$normal_usage_entry, 8,
        clc$automatically_log, clc$linked_call, ^display_field_cmd],
  {} ['DISPLAY_FIELDS                 ', clc$alias_entry, clc$normal_usage_entry, 8,
        clc$automatically_log, clc$linked_call, ^display_field_cmd],
  {} ['DISPLAY_LOGGED_STATISTICS      ', clc$nominal_entry, clc$normal_usage_entry, 24,
        clc$automatically_log, clc$linked_call, ^display_logged_statistics_cmd],
  {} ['DISPLAY_PUT                    ', clc$nominal_entry, clc$normal_usage_entry, 19,
        clc$automatically_log, clc$linked_call, ^display_put_cmd],
  {} ['DISPLAY_SELECTION              ', clc$nominal_entry, clc$normal_usage_entry, 4,
        clc$automatically_log, clc$linked_call, ^display_selection_cmd],
  {} ['DISPLAY_SELECTIONS             ', clc$alias_entry, clc$normal_usage_entry, 4,
        clc$automatically_log, clc$linked_call, ^display_selection_cmd],
  {} ['DISS                           ', clc$abbreviation_entry, clc$normal_usage_entry, 4,
        clc$automatically_log, clc$linked_call, ^display_selection_cmd],
  {} ['GENERATE_LOG                   ', clc$nominal_entry, clc$normal_usage_entry, 21,
        clc$automatically_log, clc$linked_call, ^generate_log_cmd],
  {} ['GENERATE_REPORT                ', clc$nominal_entry, clc$normal_usage_entry, 20,
        clc$automatically_log, clc$linked_call, ^generate_report_cmd],
  {} ['GENL                           ', clc$abbreviation_entry, clc$normal_usage_entry, 21,
        clc$automatically_log, clc$linked_call, ^generate_log_cmd],
  {} ['GENR                           ', clc$abbreviation_entry, clc$normal_usage_entry, 20,
        clc$automatically_log, clc$linked_call, ^generate_report_cmd],
  {} ['POPPH                          ', clc$abbreviation_entry, clc$normal_usage_entry, 9,
        clc$automatically_log, clc$linked_call, ^pop_page_header_cmd],
  {} ['POP_PAGE_HEADER                ', clc$nominal_entry, clc$normal_usage_entry, 9,
        clc$automatically_log, clc$linked_call, ^pop_page_header_cmd],
  {} ['PUSH_PAGE_HEADER               ', clc$nominal_entry, clc$normal_usage_entry, 10,
        clc$automatically_log, clc$linked_call, ^push_page_header_cmd],
  {} ['PUSPH                          ', clc$abbreviation_entry, clc$normal_usage_entry, 10,
        clc$automatically_log, clc$linked_call, ^push_page_header_cmd],
  {} ['PUTF                           ', clc$abbreviation_entry, clc$normal_usage_entry, 13,
        clc$automatically_log, clc$linked_call, ^put_field_cmd],
  {} ['PUTFS                          ', clc$abbreviation_entry, clc$normal_usage_entry, 11,
        clc$automatically_log, clc$linked_call, ^put_field_summary_cmd],
  {} ['PUTIF                          ', clc$abbreviation_entry, clc$normal_usage_entry, 12,
        clc$automatically_log, clc$linked_call, ^put_interval_field_cmd],
  {} ['PUTNP                          ', clc$abbreviation_entry, clc$normal_usage_entry, 14,
        clc$automatically_log, clc$linked_call, ^put_new_page_cmd],
  {} ['PUTR                           ', clc$abbreviation_entry, clc$normal_usage_entry, 16,
        clc$automatically_log, clc$linked_call, ^put_record_cmd],
  {} ['PUTS                           ', clc$abbreviation_entry, clc$normal_usage_entry, 15,
        clc$automatically_log, clc$linked_call, ^put_string_cmd],
  {} ['PUT_FIELD                      ', clc$nominal_entry, clc$normal_usage_entry, 13,
        clc$automatically_log, clc$linked_call, ^put_field_cmd],
  {} ['PUT_FIELD_SUMMARY              ', clc$nominal_entry, clc$normal_usage_entry, 11,
        clc$automatically_log, clc$linked_call, ^put_field_summary_cmd],
  {} ['PUT_INTERVAL_FIELD             ', clc$nominal_entry, clc$normal_usage_entry, 12,
        clc$automatically_log, clc$linked_call, ^put_interval_field_cmd],
  {} ['PUT_NEW_PAGE                   ', clc$nominal_entry, clc$normal_usage_entry, 14,
        clc$automatically_log, clc$linked_call, ^put_new_page_cmd],
  {} ['PUT_RECORD                     ', clc$nominal_entry, clc$normal_usage_entry, 16,
        clc$automatically_log, clc$linked_call, ^put_record_cmd],
  {} ['PUT_RECORDS                    ', clc$alias_entry, clc$normal_usage_entry, 16,
        clc$automatically_log, clc$linked_call, ^put_record_cmd],
  {} ['PUT_STRING                     ', clc$nominal_entry, clc$normal_usage_entry, 15,
        clc$automatically_log, clc$linked_call, ^put_string_cmd],
  {} ['QUI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 25,
        clc$automatically_log, clc$linked_call, ^quit_cmd],
  {} ['QUIT                           ', clc$nominal_entry, clc$normal_usage_entry, 25,
        clc$automatically_log, clc$linked_call, ^quit_cmd]];

?? POP ??
?? OLDTITLE ??
?? NEWTITLE := 'Function Table', EJECT ??

{ table n=anabl_func_table t=function s=local
{ function n=($logged_statistics, $ls) p=p$$logged_statistics cm=local
{ tablend

?? PUSH (LISTEXT := ON) ??

VAR
  anabl_func_table: [STATIC, READ] ^clt$function_processor_table := ^anabl_func_table_entries,

  anabl_func_table_entries: [STATIC, READ] array [1 .. 2] of clt$function_proc_table_entry := [
  {} ['$LOGGED_STATISTICS             ', clc$nominal_entry, clc$normal_usage_entry, 1,
        clc$linked_call, ^p$$logged_statistics],
  {} ['$LS                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1,
        clc$linked_call, ^p$$logged_statistics]];

?? POP ??
?? OLDTITLE ??
*copyc pte$ecc_anabl_exceptions

?? NEWTITLE := 'Const', EJECT ??

  CONST
    ptc$blanks = '                                                                   ',
    ptc$stars = '*******************************************************************',
    ptc$base_2_length = 69, { String size for integer in base 2  (64 digits + 1 sign + 3 radix + 1 space) }
    ptc$base_8_length = 27, { String size for integer in base 8  (22 digits + 1 sign + 3 radix + 1 space) }
    ptc$base_10_length = 21, { String size for integer in base 10 (19 digits + 1 sign           + 1 space) }
    ptc$base_16_length = 22, { String size for integer in base 16 (16 digits + 1 sign + 4 radix + 1 space) }
    ptc$base_16_group_length = 26, { String size for integer in base 16 group (19 digits + 4 radix + 3 space)}
    ptc$date_time_record_size = 8, { #size(ost$date_time) }
    ptc$default_counter_fraction = 3,
    ptc$default_date_time_format = 'ISOD MILLISECOND',
    ptc$default_time_inc_format = 'SECONDS',
    ptc$default_row_label_size = osc$max_name_size,
    ptc$ddl_string_size = 3, { String size for descriptive_data_length - integer in the range of 0..255 }
    ptc$field_vector_size = 25,
    ptc$key_all_occurrences = 'ALL_OCCURRENCES',
    ptc$key_count = 'COUNT',
    ptc$key_count_per_second = 'COUNT_PER_SECOND',
    ptc$key_default = 'DEFAULT',
    ptc$key_end_time = 'END_TIME',
    ptc$key_first_occurrence = 'FIRST_OCCURRENCE',
    ptc$key_global_task_id = 'GLOBAL_TASK_ID',
    ptc$key_interval = 'INTERVAL',
    ptc$key_last_occurrence = 'LAST_OCCURRENCE',
    ptc$key_maximum = 'MAXIMUM',
    ptc$key_mean = 'MEAN',
    ptc$key_minimum = 'MINIMUM',
    ptc$key_seconds = 'SECONDS',
    ptc$key_standard_deviation = 'STANDARD_DEVIATION',
    ptc$key_sum = 'SUM',
    ptc$key_sum_per_second = 'SUM_PER_SECOND',
    ptc$key_start_time = 'START_TIME',
    ptc$key_statistic_code = 'STATISTIC_CODE',
    ptc$key_date_time = 'DATE_TIME',
    ptc$key_system_job_name = 'SYSTEM_JOB_NAME',
    ptc$key_time_increment = 'TIME_INCREMENT',
    ptc$key_time_range = 'TIME_RANGE',
    ptc$key_unspecified = 'UNSPECIFIED',
    ptc$key_none = 'NONE',
    ptc$key_number_of_counters = 'NUMBER_OF_COUNTERS',
    ptc$key_descriptive_data_length = 'DESCRIPTIVE_DATA_LENGTH',
    ptc$key_previous_occurrence = 'PREVIOUS_OCCURRENCE',
    ptc$key_predecessor = 'PREDECESSOR',
    ptc$key_predecessor_chain_head = 'PREDECESSOR_CHAIN_HEAD',
    ptc$key_occurrence_per_second = 'OCCURRENCE_PER_SECOND',
    ptc$key_value_per_second = 'VALUE_PER_SECOND',
    ptc$length_of_counter_field = 20,
    ptc$max_output_line_length = ptc$max_page_width,
    ptc$max_output_line_log_length = 20000,
    ptc$max_page_width = 10000,
    ptc$max_real = 5.2e1232,
    ptc$max_row_label_size = ptc$max_page_width,
    ptc$num_of_counter_string_size = 3, { String size for number_of_counters - integer in the range of 0..255}

{ Change ptc$max_tasks const to osc$max_tasks when osc$max_tasks changes from 4095 to 65535.

    ptc$max_tasks = 65535,
    ptc$statistics_array_size = 100,
    ptc$summary_vector_size = 10,
    ptc$tab = 9,
    ptc$task_id_index_string_size = 5, { String size for  task_id_index - integer in the range of 0..65535 }
    ptc$task_id_seqno_string_size = 3, { String size for  task_id_seqno - integer in the range of 0..255 }
    ptc$time_length = 12,
    ptc$utility_name = 'ANALYZE_BINARY_LOG             ';

?? OLDTITLE ??
?? NEWTITLE := 'Type', EJECT ??
?? NEWTITLE := 'field' ??

{  ANABL fields correspond to statistic counters and descriptive data fields.
{    They can also be simple strings.  A field is the basic addressable unit
{    in ANABL.

  TYPE
    field = record
      field_name: ost$name,
      field_chain_link_p: ^field,
      selection_p: ^selection,
      original_selection_p: ^selection,
      report_list_p: ^report_list,

      first_value: boolean,
      collect_summary: boolean,
      collect_all_occurrences: boolean,

      field_summary: field_summary_type,

{ These counter attributes are shared by counter_field and value_per_second_field.
{   Therefore they are fixed fields rather than in the variable part of the record.

      counter_number: 1 .. sfc$max_number_of_counters,
      multiplier: real,
      incremental: boolean,
      allow_negative_increment: boolean,
      last_value: integer,

      case field_type: type_of_field of

      = counter_field =
        first_counter_value: integer,
        last_counter_value: integer,
        counter_value_head_p: ^counter_value,
        counter_value_tail_p: ^counter_value,

      = descriptive_data_field =
        first_descriptive_value_p: ^sft$descriptive_data,
        last_descriptive_value_p: ^sft$descriptive_data,
        descriptive_value_head_p: ^descriptive_value,
        descriptive_value_tail_p: ^descriptive_value,

        subfield_position: 1 .. sfc$max_descriptive_data_size,
        subfield_length: 1 .. sfc$max_descriptive_data_size,
        subfield_number: 0 .. sfc$max_descriptive_data_size,
        subfield_delimiter: char,

      = date_time_field =
        first_date_time_value: ost$date_time,
        last_date_time_value: ost$date_time,
        date_time_value_head_p: ^date_time_value,
        date_time_value_tail_p: ^date_time_value,

      = statistic_code_field =
        first_statistic_code_value: sft$statistic_code,
        last_statistic_code_value: sft$statistic_code,
        statistic_code_value_head_p: ^statistic_code_value,
        statistic_code_value_tail_p: ^statistic_code_value,

      = system_job_name_field =
        first_system_job_name_value: jmt$system_supplied_name,
        last_system_job_name_value: jmt$system_supplied_name,
        system_job_name_value_head_p: ^system_job_name_value,
        system_job_name_value_tail_p: ^system_job_name_value,

      = global_task_id_field =
        first_global_task_id_value: ost$global_task_id,
        last_global_task_id_value: ost$global_task_id,
        global_task_id_value_head_p: ^global_task_id_value,
        global_task_id_value_tail_p: ^global_task_id_value,

      = number_of_counters_field =
        first_num_of_counters_value: 0 .. sfc$max_number_of_counters,
        last_num_of_counters_value: 0 .. sfc$max_number_of_counters,
        number_of_counters_value_head_p: ^number_of_counters_value,
        number_of_counters_value_tail_p: ^number_of_counters_value,

      = descriptive_data_size_field =
        first_dd_size_value: 0 .. sfc$max_descriptive_data_size,
        last_dd_size_value: 0 .. sfc$max_descriptive_data_size,
        dd_size_value_head_p: ^dd_size_value,
        dd_size_value_tail_p: ^dd_size_value,

      = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =
        first_elapsed_time_value: integer,
        last_elapsed_time_value: integer,
        elapsed_time_value_head_p: ^counter_value,
        elapsed_time_value_tail_p: ^counter_value,

      = value_per_second_field, occurrence_per_second_field =
        first_value_per_second_value: real,
        last_value_per_second_value: real,
        value_per_second_sum: real,
        value_per_second_minimum: real,
        value_per_second_maximum: real,
        value_per_second_value_head_p: ^real_value,
        value_per_second_value_tail_p: ^real_value,

        elapsed_time: elapsed_time_type,

      = text_field =
        descriptive_text_p: ^sft$descriptive_data,

      casend
    recend;

?? OLDTITLE ??
?? NEWTITLE := 'put_entry', EJECT ??

{  The put_entry is the basic report specification unit in ANABL.

  TYPE
    put_entry = record
      name: ost$name,
      put_chain_link_p: ^put_entry,
      field_vector: field_vector_type,
      header_1: string (ptc$max_page_width),
      header_2: string (ptc$max_page_width),
      max_used_column: 0..clc$max_integer,
      case put: put_type of

      = put_field_summary =
        fields_p: ^field_list,
        summary_vector: summary_vector_type,
        row_label_start_column: report_column,
        row_label_column_width: report_column,
        display_headers: boolean,

      = put_interval_field =
        row_label_type: (start_time, end_time, time_range, row_label_none, string_label),
        row_label: string (ptc$max_row_label_size),
        date_time_start_column: report_column,
        date_time_column_width: report_column,
        date_time_format_p: ^clt$date_time_form_string,
        report_interval: integer,

      = put_field =
        all_occurrences: boolean,

      = put_string =
        ,

      = put_record =
        selection_p: ^selection_list,
        delete_counters: boolean,
        counter_base: array [1 .. sfc$max_number_of_counters] of radix,
        descriptive_text_p: ^sft$descriptive_data,
        subfield_position: 1 .. sfc$max_descriptive_data_size,
        subfield_length: 1 .. sfc$max_descriptive_data_size,
        subfield_number: 0 .. sfc$max_descriptive_data_size,
        subfield_delimiter: char,

      = put_new_page =
        use_page_headers: boolean,

      = push_page_header =
        default_header: boolean,

      = pop_page_header =
        pop_all_headers: boolean,
        pop_count: integer,

      casend
    recend;

?? OLDTITLE ??
?? NEWTITLE := 'selection', EJECT ??

{  An ANABL selection corresponds to a statistic in a binary log.  A selection
{    lets the user specify criteria for choosing and grouping statistics from
{    a binary log.

  TYPE
    selection = record

{ Identification

      name: ost$name,
      selection_chain_link_p: ^selection,
      inverted_selection: boolean,

{ Statistic Code selection

      statistic_specified: boolean,
      statistic_name: ost$name,
      statistic_code: sft$statistic_code,

{ Time selection

      date_time_specified: boolean,
      start_date_time: ost$date_time,
      end_date_time: ost$date_time,
      continuous_date_time: boolean,
      new_day_date_time: ost$date_time,

{ Descriptive data selection

      descriptive_specified: boolean,
      descriptive_subfield_p: ^descriptive_data_subfield,

{ Job predecessor selection

      predecessor_job_statistic_p: ^selection,

{ Task predecessor selection

      predecessor_task_statistic_p: ^selection,

{ Job membership selection

      job_name: jmt$system_supplied_name,

{ Task membership selection

      task_id_specified: boolean,
      task_id: ost$global_task_id,

      log_entry_p: ^put_entry,
      field_chain_p: ^field,
      number_of_successor_statistics: 0 .. clc$max_integer,
      successor_list_head_p: ^successor,
      successor_list_tail_p: ^successor,
      collect_date_time: boolean,
      date_time_value_head_p: ^date_time_value,
      date_time_value_tail_p: ^date_time_value,
      collect_predecessor_date_time: boolean,
      predecessor_dt_value_head_p: ^date_time_value,
      predecessor_dt_value_tail_p: ^date_time_value,
      statistic_location_p: ^statistic_location,
      incremental: boolean,
      incremental_counter_p: ^field,
      lost_interval: integer,
      skip_date_time: boolean,
      skip_date_time_head_p: ^skip_date_time,
      skip_date_time_tail_p: ^skip_date_time,
      shadow_fields: boolean,
      shadow_field_chain_p: ^field,
    recend;

?? OLDTITLE, EJECT ??

  TYPE
    active_fields_set = set of 1 .. ptc$field_vector_size,

    counter_value = record
      link_p: ^counter_value,
      index: 0 .. ptc$statistics_array_size,
      value_array: array [1 .. ptc$statistics_array_size] of integer,
    recend,

    dd_size_value = record
      link_p: ^dd_size_value,
      index: 0 .. ptc$statistics_array_size,
      value_array: array [1 .. ptc$statistics_array_size] of 0 .. sfc$max_descriptive_data_size,
    recend,

    descriptive_data_subfield = record
      descriptive_data_string_p: ^descriptive_data_string,
      subfield_position: 0 .. sfc$max_descriptive_data_size,
      subfield_length: 0 .. sfc$max_descriptive_data_size,
      subfield_number: 0 .. sfc$max_descriptive_data_size,
      subfield_delimiter: char,
      descriptive_subfield_link_p: ^descriptive_data_subfield,
    recend,

    descriptive_data_string = record
      descriptive_string_link_p: ^descriptive_data_string,
      descriptive_text: sft$descriptive_data,
    recend,

    descriptive_value = record
      link_p: ^descriptive_value,
      index: 0 .. ptc$statistics_array_size,
      value_array: array [1 .. ptc$statistics_array_size] of ^sft$descriptive_data,
    recend,

    date_time_value = record
      link_p: ^date_time_value,
      index: 0 .. ptc$statistics_array_size,
      value_array: array [1 .. ptc$statistics_array_size] of ost$date_time,
    recend,

    display_format_type = (binary, legible_data, list),

    elapsed_time_type = (previous_occurrence, predecessor, predecessor_chain_head),
    field_list = record
      field_p: ^field,
      link_p: ^field_list,
      row_label: string (ptc$max_row_label_size),
    recend,

    field_record_type = record
      field_p: ^field,
      summary: summary_type,
      start_column: report_column,
      column_width: report_column,
      shadow_field: boolean,
      shadow_field_p: ^field,
    recend,

    field_summary_type = record
      count: integer,
      sum: integer,
      mean: real,
      standard_deviation: real,
      square_sum: real,
      minimum: integer,
      maximum: integer,
      interval: integer,
      elapsed_time_since_predecessor: integer,
      count_per_second: real,
      sum_per_second: real,
      first_date_time: ost$date_time,
      last_date_time: ost$date_time,
      sum_overflow: boolean,
    recend,

    field_value_pointers = record
      counter_value_p: ^counter_value,
      descriptive_value_p: ^descriptive_value,
      date_time_p: ^date_time_value,
      statistic_code_value_p: ^statistic_code_value,
      system_job_name_value_p: ^system_job_name_value,
      global_task_id_value_p: ^global_task_id_value,
      number_of_counters_value_p: ^number_of_counters_value,
      dd_size_value_p: ^dd_size_value,
      elapsed_time_value_p: ^counter_value,
      value_per_second_value_p: ^real_value,
      skip_date_time_p: ^skip_date_time,
      lost_interval: integer,
      predecessor_date_time_p: ^date_time_value,
      value_index: 0 .. ptc$statistics_array_size,
      first_date_time: ost$date_time,
      last_date_time: ost$date_time,
      first: boolean,
    recend,

    field_value_type = array [1 .. ptc$field_vector_size] of field_value_pointers,

    field_vector_type = array [1 .. ptc$field_vector_size] of field_record_type,

    type_of_field = (undefined_field, counter_field, descriptive_data_field, date_time_field,
          statistic_code_field, system_job_name_field, global_task_id_field, number_of_counters_field,
          descriptive_data_size_field, text_field, previous_occurrence_field, predecessor_field,
          predecessor_chain_head_field, value_per_second_field, occurrence_per_second_field),

    global_task_id_value = record
      link_p: ^global_task_id_value,
      index: 0 .. ptc$statistics_array_size,
      value_array: array [1 .. ptc$statistics_array_size] of ost$global_task_id,
    recend,

    join_predecessor_status_type = (one_selection, no_predecessor_path, predecessor_path),

    log_file = record
      log_chain_link_p: ^log_file,
      active_log: boolean,
      log_file_identifier: lgt$log_file_identifier,
      file_identifier: amt$file_identifier,
      segment_pointer: amt$segment_pointer,
      access_level: amt$access_level,
      start_time: ost$date_time,
      end_time: ost$date_time,
      open: boolean,
      statistics_list_p: ^logged_statistic,
      log_file_name: fst$file_reference,
    recend,

    logged_statistic = record
      statistic_code: sft$statistic_code,
      link_p: ^logged_statistic,
      statistic_location_p: ^statistic_location,
      number_of_occurrences: 0 .. clc$max_integer,
      time_of_first_occurrences: ost$date_time,
      time_of_last_occurrences: ost$date_time,
    recend,

    name_list = record
      name: ost$name,
      link_p: ^name_list,
    recend,

    number_of_counters_value = record
      link_p: ^number_of_counters_value,
      index: 0 .. ptc$statistics_array_size,
      value_array: array [1 .. ptc$statistics_array_size] of 0 .. sfc$max_number_of_counters,
    recend,

    numbers_set = set of 1 .. 32767, { The maximum number elements in a set is 32767 }

    page_header_list_entry = record
      fwd_p: ^page_header_list_entry,
      bkw_p: ^page_header_list_entry,
      default_header: boolean,
      header_string: string (ptc$max_page_width),
    recend,

    put_type = (put_record, put_field, put_field_summary, put_interval_field, put_string, put_new_page,
                push_page_header, pop_page_header),

{ The order in radix is the order of the fixed counter length (see ptc$base_xx_length).

    radix = (base_0, base_10, base_16, base_16_group, base_8, base_2),

    real_value = record
      link_p: ^real_value,
      index: 0 .. ptc$statistics_array_size,
      value_array: array [1 .. ptc$statistics_array_size] of real,
    recend,

    report_column = 1 .. ptc$max_page_width,

    report_column_set = set of report_column,

    report_list = record
      report_p: ^put_entry,
      link_p: ^report_list,
      shadow: boolean,
    recend,

    selection_list = record
      selection_p: ^selection,
      link_p: ^selection_list,
    recend,

    selection_list_join = record
      selection_p: ^selection,
      tail: boolean,
      link_p: ^selection_list_join,
    recend,

    skip_date_time = record
      link_p: ^skip_date_time,
      skip_date_time: ost$date_time,
      date_time_after_skip: ost$date_time,
    recend,

    statistic_code_value = record
      link_p: ^statistic_code_value,
      index: 0 .. ptc$statistics_array_size,
      value_array: array [1 .. ptc$statistics_array_size] of sft$statistic_code,
    recend,

    statistic_location = record
      statistic_location_chain_link_p: ^statistic_location,
      statistic_index: 0 .. ptc$statistics_array_size,
      statistic_array: array [1 .. ptc$statistics_array_size] of ^sft$statistic_header,
    recend,

    successor = record
      global_task_id: ost$global_task_id,
      job_seq_number: jmt$system_supplied_name,
      successor_link_p: ^successor,
      date_time: ost$date_time,
      statistic_header_p: ^sft$statistic_header,
      counters_p: sft$counters,
      descriptive_data_p: ^sft$descriptive_data,
      predecessor_p: ^successor,
      selection_p: ^selection,
    recend,

    summary_type = (null, count, sum, mean, standard_deviation, minimum, maximum, first_occurrence,
          last_occurrence, all_occurrences, text, count_per_second, sum_per_second, interval,
          elapsed_time_since_predecessor),

    summary_vector_type = array [1 .. ptc$summary_vector_size] of record
      summary: summary_type,
      start_column: report_column,
      column_width: report_column,
    recend,

    system_job_name_value = record
      link_p: ^system_job_name_value,
      index: 0 .. ptc$statistics_array_size,
      value_array: array [1 .. ptc$statistics_array_size] of jmt$system_supplied_name,
    recend,

    time_increment_value = record
      link_p: ^time_increment_value,
      index: 0 .. ptc$statistics_array_size,
      value_array: array [1 .. ptc$statistics_array_size] of pmt$time_increment,
    recend,

    write_statistic_p = ^procedure (    log_entry_p: ^put_entry;
                                        statistic_header_p: ^sft$statistic_header;
                                        counters_p: sft$counters;
                                        descriptive_data_p: ^sft$descriptive_data;
                                    VAR status: ost$status);

?? OLDTITLE ??
?? NEWTITLE := 'Var', EJECT ??

  VAR
    ptv$active_log: boolean,
    ptv$clt_date_time: clt$date_time := [ * , TRUE, TRUE],
    ptv$conditions: [STATIC, READ] pmt$condition := [pmc$condition_combination,
          [pmc$block_exit_processing, ifc$interactive_condition]],
    ptv$counter_fraction: [STATIC] 0..clc$max_integer := ptc$default_counter_fraction,
    ptv$data_segment_p: amt$segment_pointer,
    ptv$date_time_format: string (clc$max_date_time_form_string) := ptc$default_date_time_format,
    ptv$default_input_log_list_p: [STATIC] ^clt$data_value := NIL,
    ptv$descriptive_data_size: record
      case float: boolean of
      = TRUE =
        ,
      = FALSE =
        number: 0 .. sfc$max_descriptive_data_size,
      casend
    recend,
    ptv$dt_format_for_increment: string (clc$max_date_time_form_string) := 'H24:MM:SS.S1000',
    ptv$display_file: fst$path,
    ptv$display_file_specifications: [STATIC, READ] array
          [1 .. 2] of cyt$file_specification := [[cyc$file_kind, cyc$display_file],
          [cyc$new_page_procedure, [cyc$standard_procedure, ptc$utility_name]]],
    ptv$display_format: display_format_type,
    ptv$display_report_header: boolean,
    ptv$end_of_segment: amt$segment_pointer,
    ptv$excel: boolean,
    ptv$fixed_counter_length: integer,
    ptv$generate: (none, log, report) := none,
    ptv$headers_specified: boolean,
    ptv$information_request: boolean,
    ptv$initial_field_summary: [STATIC, READ] field_summary_type := [0
          { count } , 0 { sum } , 0.0 { mean } , 0.0 { standard_deviation } , 0.0
          { square_sum } , clc$max_integer { minimum } , -clc$max_integer { maximum } , 0 { interval } , 0
          { elapsed_time_since_predecessor } , 0.0 { count_per_sec } , 0.0 { sum_per_sec } , *
          { first_date_time } , * { last_date_time } , FALSE { sum_overflow } ],
    ptv$input_log_chain_head_p: ^log_file := NIL,
    ptv$interval: [STATIC] pmt$time_increment := [0, 0, 0, 0, 0, 0, 0],
    ptv$interval_0: [STATIC, READ] pmt$time_increment := [0, 0, 0, 0, 0, 0, 0],
    ptv$legible_data_max_page_width: 1..ptc$max_page_width := ptc$max_page_width,
    ptv$line_length: 0 .. 65535,
    ptv$list_max_page_width: 1..ptc$max_page_width := cyc$wide_page_width,
    ptv$log_entry_chain_head_p: ^put_entry := NIL,

{ The value osc$null_name for file_processor is used to indicate a "don't care" state.

    ptv$log_file_attributes: [STATIC, READ] array [1 .. 2] of fst$file_cycle_attribute :=
          [[fsc$record_type, amc$variable], [fsc$file_contents_and_processor, fsc$binary_log, osc$null_name]],
    ptv$logged_statistic_chain_head: ^logged_statistic := NIL,
    ptv$maximum_line_length: 0..ptc$max_page_width,
    ptv$max_date_time: [STATIC, READ] ost$date_time := [255, 12, 31, 23, 59, 59, 999],
    ptv$min_date_time: [STATIC, READ] ost$date_time := [0, 1, 1, 0, 0, 0, 0],
    ptv$max_report_page_width: 1..ptc$max_page_width := ptc$max_page_width,
    ptv$max_report_width: integer := 0,
    ptv$number_of_counters: record
      fixed_format: boolean,
      case float: boolean of
      = TRUE =
        ,
      = FALSE =
        number: 0 .. sfc$max_number_of_counters,
      casend
    recend,
    ptv$one_day: pmt$time_increment := [0, 0, 1, 0, 0, 0, 0],
    ptv$output_file: cyt$file,
    ptv$output_line: string (ptc$max_output_line_length),
    ptv$output_line_length: integer,
    ptv$output_line_log: string (ptc$max_output_line_log_length),
    ptv$output_log_p: ^log_file := NIL,
    ptv$page_header_list_head_p: ^page_header_list_entry,
    ptv$page_header_list_tail_p: ^page_header_list_entry,
    ptv$predecessor_job_date_time: ost$date_time,
    ptv$predecessor_task_date_time: ost$date_time,
    ptv$predecessor_log_p: amt$segment_pointer,
    ptv$previous_header_fba: amt$file_byte_address,
    ptv$prompting_activted: boolean,
    ptv$report_entry_chain_head_p: ^put_entry := NIL,
    ptv$statistic_header_size: [STATIC, READ] integer := #SIZE (sft$statistic_header),
    ptv$selection_chain_head_p: ^selection := NIL,
    ptv$selection_chain_tail_p: ^selection := NIL,
    ptv$statistic_record_buffer: sft$statistic_buffer,
    ptv$text_file_specifications: [STATIC, READ] array [1 .. 2] of cyt$file_specification :=
          [[cyc$file_kind, cyc$text_file], [cyc$page_width, ptc$max_page_width]],
    ptv$time_increment_format: string (14) := ptc$default_time_inc_format;

?? OLDTITLE ??
?? NEWTITLE := 'anabl_new_page_procedure', EJECT ??

{ The purpose of this procedure is to print page headers for new pages of a generated report.
{   It is only used for reports with display_format = LIST.

  PROCEDURE anabl_new_page_procedure (
        output_file: cyt$file;
        next_page_number: integer;
    VAR status: ost$status);

    VAR
      page_header_p: ^page_header_list_entry;

    cyp$display_page_eject (ptv$output_file, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF ptv$page_header_list_tail_p <> NIL THEN
{ At least one entry in page header list

      page_header_p := ptv$page_header_list_head_p;

{ Loop until the physical or logical end of the page header chain
{   physical end: page_header_p = NIL
{   logical end: page_header_p^.bkw_p = ptv$page_header_list_tail_p
{       Last page header we processed was the last one we wanted.

      WHILE (page_header_p <> NIL) AND (page_header_p^.bkw_p <> ptv$page_header_list_tail_p) DO
        IF page_header_p^.default_header THEN
{ Print default header
          cyp$display_standard_title (ptv$output_file, ptc$utility_name, 1, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        ELSE
{ Print header string
          ptv$output_line_length := clp$trimmed_string_size (page_header_p^.header_string);
          cyp$put_next_line (ptv$output_file, page_header_p^.header_string(1, ptv$output_line_length),
                status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        IFEND;

        page_header_p := page_header_p^.fwd_p;
      WHILEND;

    IFEND;

  PROCEND anabl_new_page_procedure;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] add_statistic_to_successor_list', EJECT ??

{ PURPOSE:
{   The purpose of this request is to add a statistic to a job or task successor list.
{
{ DESIGN:
{      This procedure is called when a statistic is selected and checks if the current selection is a job
{   and/or task predecessor for another selection.  If the selection is a job predecessor then get the system
{   job name and date time from the curent statistic's header and save them.  If the selection is a task
{   predecessor then get the global task id, system job name and date time from the curent statistic's header
{   and save them.
{
{      Typically predecessors are used to match statistics emitted by the same task (or job) e.g. end of task
{   (or job) with the beginning of the task (or job).
{
{      The statistics data is saved in reverse order chain (new data added to the beginning of the chain).
{   That helps to improve select_statistic function performance because typically tasks (or jobs) that begin
{   earlier will end earlier and the predecessor scan in select_statistic will scan only the beginning of the
{   chain in order to find a matching predecessor.
{
{      There is a good chance of finding that the Global task id is not unique in the log (when the task ended
{   the global task id is free to be a global task id of another task).  In order to improve the matching
{   between statistics emitted by the same task a system job name is added to the data saved and the chain is
{   organized in reverse order.

  PROCEDURE [INLINE] add_statistic_to_successor_list
    (    selection_p { input, output } : ^selection;
         statistic_header_p: ^sft$statistic_header;
         counters_p: sft$counters;
         descriptive_data_p: ^sft$descriptive_data;
         predecessor_p: ^successor);

    VAR
      successor_p: ^successor;

    IF selection_p^.number_of_successor_statistics > 0 THEN
      NEXT successor_p IN ptv$data_segment_p.sequence_pointer;
      successor_p^.global_task_id := statistic_header_p^.task_id;
      successor_p^.job_seq_number := statistic_header_p^.job_name;
      successor_p^.date_time := statistic_header_p^.date_time;
      successor_p^.statistic_header_p := statistic_header_p;
      successor_p^.counters_p := counters_p;
      successor_p^.descriptive_data_p := descriptive_data_p;
      successor_p^.predecessor_p := predecessor_p;
      successor_p^.selection_p := selection_p;
      successor_p^.successor_link_p := selection_p^.successor_list_head_p;
      selection_p^.successor_list_head_p := successor_p;
    IFEND;

  PROCEND add_statistic_to_successor_list;

?? OLDTITLE ??
?? NEWTITLE := 'check_counter_parameter', EJECT ??

{ PURPOSE:
{   The purpose of this request is to check and process the counter parameter in
{ put_record & change_put subcommands.
{
{ DESIGN:
{   The procedure marks all the counters as base 0 (counters marked as base 0 are not printed).  If the
{ parameter is a keyword (NONE) then set delete_counters flag and return.  Or else for each record in the
{ record list set the range of counters with the base of that record.  If the keyword ALL is specified for
{ a range no other range can be specified.

  PROCEDURE check_counter_parameter
    (    counters: clt$parameter_value;
         temp_log_entry: ^put_entry;
     VAR status: ost$status);

    TYPE
      counter_change_set = set of 1 .. sfc$max_number_of_counters;

    VAR
      base: radix,
      counter_base_init_0: [STATIC, READ] array [1 .. sfc$max_number_of_counters] of radix :=
            [REP sfc$max_number_of_counters of base_0],
      counter_base_init_2: [STATIC, READ] array [1 .. sfc$max_number_of_counters] of radix :=
            [REP sfc$max_number_of_counters of base_2],
      counter_base_init_8: [STATIC, READ] array [1 .. sfc$max_number_of_counters] of radix :=
            [REP sfc$max_number_of_counters of base_8],
      counter_base_init_10: [STATIC, READ] array [1 .. sfc$max_number_of_counters] of radix :=
            [REP sfc$max_number_of_counters of base_10],
      counter_base_init_16: [STATIC, READ] array [1 .. sfc$max_number_of_counters] of radix :=
            [REP sfc$max_number_of_counters of base_16],
      counter_base_init_16_g: [STATIC, READ] array [1 .. sfc$max_number_of_counters] of radix :=
            [REP sfc$max_number_of_counters of base_16_group],
      counter_change: counter_change_set,
      counter_change_init: [STATIC, READ] array [1 .. sfc$max_number_of_counters] of boolean :=
            [REP sfc$max_number_of_counters of FALSE],
      errors_detected: boolean,
      failing_status: ost$status,
      high_counter: integer,
      index: integer,
      index_string: ost$string,
      low_counter: integer,
      value_p: ^clt$data_value;

    status.normal := TRUE;

    temp_log_entry^.delete_counters := FALSE;
    IF counters.specified THEN
      temp_log_entry^.counter_base := counter_base_init_0;
      IF counters.value^.kind = clc$keyword THEN
        temp_log_entry^.delete_counters := TRUE;
      ELSE
        value_p := counters.value;
        counter_change := $counter_change_set [];
        errors_detected := FALSE;
        WHILE value_p <> NIL DO
          IF value_p^.element_value^.field_values^ [2].value^.keyword_value = 'BASE_2' THEN
            base := base_2;
          ELSEIF value_p^.element_value^.field_values^ [2].value^.keyword_value = 'BASE_8' THEN
            base := base_8;
          ELSEIF value_p^.element_value^.field_values^ [2].value^.keyword_value = 'BASE_10' THEN
            base := base_10;
          ELSEIF value_p^.element_value^.field_values^ [2].value^.keyword_value = 'BASE_16' THEN
            base := base_16;
          ELSEIF value_p^.element_value^.field_values^ [2].value^.keyword_value = 'BASE_16_GROUP' THEN
            base := base_16_group;
          IFEND;

{ Keyword could be NONE, so must explicitly check for ALL

          IF (value_p^.element_value^.field_values^ [1].value^.kind = clc$keyword) AND
                (value_p^.element_value^.field_values^ [1].value^.keyword_value = 'ALL') THEN

{ ALL

            IF counter_change = $counter_change_set [] THEN
              CASE base OF
              = base_2 =
                temp_log_entry^.counter_base := counter_base_init_2;
              = base_8 =
                temp_log_entry^.counter_base := counter_base_init_8;
              = base_10 =
                temp_log_entry^.counter_base := counter_base_init_10;
              = base_16 =
                temp_log_entry^.counter_base := counter_base_init_16;
              = base_16_group =
                temp_log_entry^.counter_base := counter_base_init_16_g;
              ELSE
              CASEND;
            ELSE
              osp$set_status_condition (pte$counters_changed, failing_status);
              report_intermediate_error (failing_status, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;
              errors_detected := TRUE;
            IFEND;
            counter_change := -$counter_change_set [];
          ELSE
            low_counter := value_p^.element_value^.field_values^ [1].value^.low_value^.integer_value.value;
            high_counter := value_p^.element_value^.field_values^ [1].value^.high_value^.integer_value.value;
            IF low_counter > high_counter THEN
              STRINGREP (ptv$output_line, ptv$output_line_length, low_counter, ' ..', high_counter);
              osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$low_greater_than_high,
                    ptv$output_line (1, ptv$output_line_length), failing_status);
              report_intermediate_error (failing_status, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;
              errors_detected := TRUE;
            IFEND;

            FOR index := low_counter TO high_counter DO
              IF NOT (index IN counter_change) THEN
                temp_log_entry^.counter_base [index] := base;
                counter_change := counter_change + $counter_change_set [index];
              ELSE
                clp$convert_integer_to_string (index, 10, FALSE, index_string, status);
                IF NOT status.normal THEN
                  RETURN; {----->
                IFEND;
                osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$counter_changed, index_string.
                      value (1, index_string.size), failing_status);
                report_intermediate_error (failing_status, status);
                errors_detected := TRUE;
              IFEND;
            FOREND;
          IFEND;

          value_p := value_p^.link;
        WHILEND;

        IF errors_detected THEN
          osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$error_processing_parameter, 'COUNTERS',
                status);
        IFEND;

        index := 1;
        WHILE (index <= sfc$max_number_of_counters) AND NOT temp_log_entry^.delete_counters DO
          IF temp_log_entry^.counter_base [index] = base_0 THEN
            temp_log_entry^.delete_counters := TRUE;
          IFEND;
          index := index + 1;
        WHILEND;
      IFEND;
    IFEND;

  PROCEND check_counter_parameter;

?? OLDTITLE ??
?? NEWTITLE := 'check_display_option', EJECT ??

{ PURPOSE:
{    The purpose of this request is to check the Display_Option field in the FIELD parameter for put_field and
{ change_put (field entries type) subcommands.
{
{ DESIGN:
{   The procedure counts the number of ALL_OCCURRENCES Display_Options and the number of any other
{ Display_Options.  If there is mix of ALL_OCCURRENCES and other Display_Options the procedure returns an
{ error.  The procedure returns parameter all_occurrences = TRUE if all the Display_Options are
{ ALL_OCCURRENCES.
{
{ NOTE:
{  - If ALL_OCCURRENCES display_option is used all the display_options must be ALL_OCCURRENCES.
{  - The Display_Option default is ALL_OCCURENCES.

  PROCEDURE check_display_option
    (    value: ^clt$data_value;
     VAR all_occurrences: boolean;
     VAR status: ost$status);

    VAR
      other_keyword: boolean,
      value_p: ^clt$data_value;

    status.normal := TRUE;

    all_occurrences := FALSE;
    other_keyword := FALSE;
    value_p := value;
    WHILE value_p <> NIL DO
      IF (value_p^.element_value^.field_values^ [2].value = NIL) OR
            (value_p^.element_value^.field_values^ [2].value^.keyword_value = ptc$key_all_occurrences) THEN
        all_occurrences := TRUE;
      ELSE
        other_keyword := TRUE;
      IFEND;
      value_p := value_p^.link;
    WHILEND;

    IF all_occurrences AND other_keyword THEN
      osp$set_status_condition (pte$all_occurrences_and_other, status);
      RETURN; {----->
    IFEND;

  PROCEND check_display_option;

?? OLDTITLE ??
?? NEWTITLE := 'check_fields_and_put_pointers', EJECT ??

{ PURPOSE:
{    The purpose of this request is to check and report if a selection(s) has field(s) and/or put(s).

  PROCEDURE check_fields_and_put_pointers
    (    selection_p: ^selection;
     VAR errors_detected: boolean;
     VAR status: ost$status);

    VAR
      failing_status: ost$status;

    status.normal := TRUE;

    IF selection_p^.field_chain_p <> NIL THEN
      osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$selection_has_field, selection_p^.name,
            failing_status);
      report_intermediate_error (failing_status, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      errors_detected := TRUE;
    IFEND;

    IF selection_p^.log_entry_p <> NIL THEN
      osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$selection_has_put, selection_p^.name,
            failing_status);
      report_intermediate_error (failing_status, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      errors_detected := TRUE;
    IFEND;

  PROCEND check_fields_and_put_pointers;

?? OLDTITLE ??
?? NEWTITLE := 'check_predecessor_path', EJECT ??

{ PURPOSE:
{   The purpose of this request is to ensure that the list of selections from a single put_field report
{     entry with ALL_OCCURRENCES all belong to a single predecessor path.
{
{ DESIGN:
{   The procedure scans the list of selections and sets all the selections that have a predecessor as tail
{ selection (only the selection at the head of the predecessor chain can not have a predecessor).  Then the
{ procedure resets the tail flag in any selection that is predecessor to another selection in the list.
{ Finally, if only one selection is the tail, the procedure checks if it is possible to get to all other
{ selections through the predecessor pointer.  If so there is a predecessor path.

  PROCEDURE check_predecessor_path
    (    report_entry_p: ^put_entry;
     VAR join_predecessor_status: join_predecessor_status_type;
     VAR selection_p: ^selection);

    VAR
      index: integer,
      selection_list_head_p: ^selection_list_join,
      selection_list_p: ^selection_list_join,
      prev_p: ^selection_list_join,
      next_p: ^selection_list_join,
      selection_list_tail_p: ^selection_list_join,
      tail_selection_p: ^selection_list_join;

?? NEWTITLE := 'sel1_in_sel2_chain', EJECT ??

{ PURPOSE:  Check if the first specified selection is in the second selection's
{   predecessor path.
{   Returns TRUE if sel1 is in sel2 predecessor path.
{   Returns FALSE if sel1 is not in sel2 predecessor path.

    FUNCTION sel1_in_sel2_chain
      (    sel1_p,
           sel2_p: ^selection_list_join): boolean;

      VAR
        pred_chain_entry_p: ^selection;

      sel1_in_sel2_chain := FALSE;

      IF sel2_p^.selection_p^.predecessor_job_statistic_p <> NIL THEN
        pred_chain_entry_p := sel2_p^.selection_p^.predecessor_job_statistic_p;
      ELSE
        pred_chain_entry_p := sel2_p^.selection_p^.predecessor_task_statistic_p;
      IFEND;
      WHILE pred_chain_entry_p <> NIL DO
        IF pred_chain_entry_p = sel1_p^.selection_p THEN
          sel1_in_sel2_chain := TRUE;
          RETURN; {----->
        ELSEIF pred_chain_entry_p^.predecessor_job_statistic_p <> NIL THEN
          pred_chain_entry_p := pred_chain_entry_p^.predecessor_job_statistic_p;
        ELSE
          pred_chain_entry_p := pred_chain_entry_p^.predecessor_task_statistic_p;
        IFEND;
      WHILEND;

{ Made it through sel2_p chain without finding a match
      sel1_in_sel2_chain := FALSE;

    FUNCEND sel1_in_sel2_chain;

?? OLDTITLE ??

{ Make list of selections involved in the put_field with all_occurrences

    selection_list_head_p := NIL;
    index := LOWERBOUND (field_vector_type);
    WHILE (index <= UPPERBOUND (field_vector_type)) AND (report_entry_p^.field_vector [index].
          summary <> null) DO
      selection_p := report_entry_p^.field_vector [index].field_p^.selection_p;

{ Check if the selection is in the selection list from previous field.

      selection_list_p := selection_list_head_p;
      WHILE (selection_list_p <> NIL) AND (selection_list_p^.selection_p <> selection_p) DO
        selection_list_p := selection_list_p^.link_p;
      WHILEND;

{ If selection isn't in the selection list add it to the list.

      IF selection_list_p = NIL THEN
        NEXT selection_list_p IN ptv$data_segment_p.sequence_pointer;
        selection_list_p^.link_p := NIL;
        selection_list_p^.selection_p := selection_p;
        IF selection_list_head_p = NIL THEN { The first selection in the list.
          selection_list_head_p := selection_list_p;
        ELSE
          selection_list_tail_p^.link_p := selection_list_p;
        IFEND;
        selection_list_tail_p := selection_list_p;
      IFEND;
      index := index + 1;
    WHILEND;

{  Check for only one selection involved in the put_field

    IF selection_list_head_p^.link_p = NIL THEN
      join_predecessor_status := one_selection;
      RETURN; {----->
    IFEND;

{ There is more than one selection in the put_field

    prev_p := selection_list_head_p;
    next_p := prev_p^.link_p;
{ Order selection list so that every entry after the head is contained in
{ the head's predecessor path
    WHILE next_p <> NIL DO
      IF sel1_in_sel2_chain (next_p, selection_list_head_p) THEN
{ advance next and previous pointers
        prev_p := next_p;
        next_p := next_p^.link_p;
      ELSEIF sel1_in_sel2_chain (selection_list_head_p, next_p) THEN
{ move next to head of list
        prev_p^.link_p := next_p^.link_p;
        next_p^.link_p := selection_list_head_p^.link_p;
        selection_list_head_p := next_p;
{ advance next, but not previous
        next_p := prev_p^.link_p;
      ELSE
{ Neither selection is contained in the other's chain, so no single chain exists
        join_predecessor_status := no_predecessor_path;
        RETURN; {----->
      IFEND;
    WHILEND;

{ Made it to end of selection list, so a single path exists
    selection_p := selection_list_head_p^.selection_p;
    join_predecessor_status := predecessor_path;

  PROCEND check_predecessor_path;

?? OLDTITLE ??
?? NEWTITLE := 'check_recursive_predecessor', EJECT ??

{ PURPOSE:
{   The purpose of this request is to ensure the selection's predecessor chain is not recursive.

  PROCEDURE check_recursive_predecessor
    (    selection_p: ^selection;
         predecessor_p: ^selection;
     VAR status: ost$status);

    VAR
      predecessor_selection_p: ^selection;

    status.normal := TRUE;

    predecessor_selection_p := predecessor_p;
    REPEAT
      IF predecessor_selection_p^.predecessor_job_statistic_p <> NIL THEN
        predecessor_selection_p := predecessor_selection_p^.predecessor_job_statistic_p;
      ELSE { Must be task predecessor
        predecessor_selection_p := predecessor_selection_p^.predecessor_task_statistic_p;
      IFEND;
    UNTIL (predecessor_selection_p = NIL) OR (predecessor_selection_p = selection_p);

    IF predecessor_selection_p = selection_p THEN
      osp$set_status_condition (pte$predecessor_itself, status);
    IFEND;

  PROCEND check_recursive_predecessor;

?? OLDTITLE ??
?? NEWTITLE := 'check_duplicate_field_name', EJECT ??

{ PURPOSE:
{   The purpose of this request is to ensure that the field_name is not used by a previously defined field in
{ any of the selections.
{
{ DESIGN:
{   Scan the field list in each of the selections in the selection list and check
{ if the field_name is the same as the new field name.

  PROCEDURE check_duplicate_field_name
    (    field_name: ost$name;
     VAR status: ost$status);

    VAR
      field_p: ^field,
      selection_p: ^selection;

    status.normal := TRUE;

    selection_p := ptv$selection_chain_head_p;
    WHILE selection_p <> NIL DO
      field_p := selection_p^.field_chain_p;
      WHILE (field_p <> NIL) AND (field_p^.field_name <> field_name) DO
        field_p := field_p^.field_chain_link_p;
      WHILEND;

      IF field_p <> NIL THEN
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$redefined_field, field_name, status);
        RETURN; {----->
      IFEND;
      selection_p := selection_p^.selection_chain_link_p;
    WHILEND;

  PROCEND check_duplicate_field_name;

?? OLDTITLE ??
?? NEWTITLE := 'check_duplicate_selection_name', EJECT ??

{ PURPOSE:
{   The purpose of this request is to ensure that the selection_name is not used by a previously defined
{ selection.
{
{ DESIGN:
{   Scan the selection list and check if the selection_name is the same as the new selection name.

  PROCEDURE check_duplicate_selection_name
    (    selection_name: ost$name;
     VAR status: ost$status);

    VAR
      selection_p: ^selection;

    status.normal := TRUE;

    selection_p := ptv$selection_chain_head_p;
    WHILE (selection_p <> NIL) AND (selection_p^.name <> selection_name) DO
      selection_p := selection_p^.selection_chain_link_p;
    WHILEND;
    IF selection_p <> NIL THEN
      osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$redefined_selection, selection_name, status);
    IFEND;

  PROCEND check_duplicate_selection_name;

?? OLDTITLE ??
?? NEWTITLE := 'check_summary', EJECT ??

{ PURPOSE:
{   The purpose of this request is to check if the display option that the user selected is allowed for the
{ field type.

  PROCEDURE check_summary
    (    field_type: type_of_field;
         field_name: ost$name;
         display_option: ost$name;
     VAR summary: summary_type;
     VAR status: ost$status);

    TYPE
      summary_set_type = set of summary_type;

    CASE field_type OF

    = counter_field =
      { Counter field accept all display options.

    = number_of_counters_field, descriptive_data_size_field =
      IF summary IN $summary_set_type [interval, elapsed_time_since_predecessor] THEN
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$unsupported_display_option, display_option,
              status);
        osp$append_status_parameter (osc$status_parameter_delimiter, field_name, status);
        CASE field_type OF
        = number_of_counters_field =
          osp$append_status_parameter (osc$status_parameter_delimiter, 'NUMBER OF COUNTER', status);
        = descriptive_data_size_field =
          osp$append_status_parameter (osc$status_parameter_delimiter, 'DESCRIPTIVE DATA SIZE', status);
        ELSE
        CASEND;
      IFEND;

    = descriptive_data_field, date_time_field, statistic_code_field, system_job_name_field,
          global_task_id_field =
      IF summary = sum THEN
        summary := first_occurrence;
      ELSEIF summary IN $summary_set_type [mean, standard_deviation, minimum, maximum, sum_per_second,
            interval, elapsed_time_since_predecessor] THEN
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$unsupported_display_option, display_option,
              status);
        osp$append_status_parameter (osc$status_parameter_delimiter, field_name, status);
      IFEND;

    = previous_occurrence_field, predecessor_field, predecessor_chain_head_field, value_per_second_field,
          occurrence_per_second_field =
      IF summary IN $summary_set_type [sum_per_second, interval, elapsed_time_since_predecessor] THEN
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$unsupported_display_option, display_option,
              status);
        osp$append_status_parameter (osc$status_parameter_delimiter, field_name, status);
      IFEND;

    = text_field =
      IF summary = sum THEN
        summary := first_occurrence;
      ELSEIF summary IN $summary_set_type [mean, standard_deviation, minimum, maximum, sum_per_second,
            interval, elapsed_time_since_predecessor, count, count_per_second] THEN
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$unsupported_display_option, display_option,
              status);
        osp$append_status_parameter (osc$status_parameter_delimiter, field_name, status);
      IFEND;

    ELSE
    CASEND;

  PROCEND check_summary;

?? OLDTITLE ??
?? NEWTITLE := 'check_undefined_selection', EJECT ??

{ PURPOSE:
{   The purpose of this request is to find the input selection name.
{     If the selection is defined then the procedure returns a pointer to the selection record,
{     If the selection is not defined, the procedure sets the status to abnormal.
{
{ DESIGN:
{   Scan the selection list and check if the selection_name is the name of a defined selection.

  PROCEDURE check_undefined_selection
    (    selection_name: ost$name;
         condition_code: integer;
     VAR selection_p: ^selection;
     VAR status: ost$status);

    status.normal := TRUE;

    selection_p := ptv$selection_chain_head_p;
    WHILE (selection_p <> NIL) AND (selection_p^.name <> selection_name) DO
      selection_p := selection_p^.selection_chain_link_p;
    WHILEND;
    IF selection_p = NIL THEN
      osp$set_status_abnormal (ptc$analyze_binary_log_id, condition_code, selection_name, status);
    IFEND;

  PROCEND check_undefined_selection;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] collect_counter', EJECT ??

{ PURPOSE
{   The purpose of this request is to collect information for a counter.
{
{ DESIGN
{   If the counter value is large, a sum overflow can occur when it computes the sum of the counter values.
{ If that happens, the utility issues an error message and all the summaries that depended on the sum (sum,
{ mean, standard_deviation and sum_per_second) are meaningless.
{   If a negative value is computed for an incremental counter and negative increments are not allowed, the
{ procedure does not use this value for any summary information.  The negative value
{ is allowed to be kept if all occurrences are being collected.  Write_field_all_occurrences and
{ write_interval_field will detect undesirable negative increments and not report them.
{
{
{ NOTE:
{  - IF a counter is missing from the statistic record (counter number is greater than the number of counters
{    in the statistic record) the counter value will be 0.

  PROCEDURE [INLINE] collect_counter
    (    statistic_header_p: ^sft$statistic_header;
         selection_p: ^selection;
         counters_p: sft$counters;
         field_p { input, output } : ^field);

    VAR
      counter_value: integer,
      counter_value_real: real,
      interval: pmt$time_increment,
      local_status: ost$status;

    IF field_p^.counter_number <= statistic_header_p^.number_of_counters THEN

      IF field_p^.incremental THEN
        IF field_p^.field_summary.count = 0 THEN
          field_p^.last_value := counters_p^ [field_p^.counter_number];
          field_p^.field_summary.first_date_time := statistic_header_p^.date_time;

{  Need to set count to 1 to get past here next time.  Count is decremented by
{    one in compute_summary.

          field_p^.field_summary.count := 1;
          RETURN; {----->
        ELSE
          counter_value := counters_p^ [field_p^.counter_number] - field_p^.last_value;
          field_p^.last_value := counters_p^ [field_p^.counter_number];
        IFEND;
      ELSE
        counter_value := counters_p^ [field_p^.counter_number];
      IFEND;
    ELSE
      counter_value := 0;
    IFEND;

{ Summary
{  Don't collect summary information if the counter value is negative and
{    negative increments are not allowed

      IF field_p^.collect_summary AND ((NOT field_p^.incremental) OR (counter_value >= 0) OR
            (field_p^.allow_negative_increment)) THEN

{ First Occurrence - in case of incremental counter this is the second count.

        IF field_p^.first_value THEN
          IF NOT field_p^.incremental THEN
            field_p^.field_summary.first_date_time := statistic_header_p^.date_time;
          IFEND;
          field_p^.first_counter_value := counter_value;
          field_p^.first_value := FALSE;
        IFEND;

{ Last Occurrence

        field_p^.last_counter_value := counter_value;

{ Count

        field_p^.field_summary.count := field_p^.field_summary.count + 1;

{ Sum

        IF NOT field_p^.field_summary.sum_overflow THEN
          IF UPPERVALUE (field_p^.field_summary.sum) - field_p^.field_summary.sum > counter_value THEN
            field_p^.field_summary.sum := field_p^.field_summary.sum + counter_value;
            counter_value_real := $REAL (counter_value);
            field_p^.field_summary.square_sum := field_p^.field_summary.square_sum + counter_value_real *
                  counter_value_real;
          ELSE
            field_p^.field_summary.sum_overflow := TRUE;
          IFEND;
        IFEND;

{ Minimum

        IF counter_value < field_p^.field_summary.minimum THEN
          field_p^.field_summary.minimum := counter_value;
        IFEND;

{ Maximum

        IF counter_value > field_p^.field_summary.maximum THEN
          field_p^.field_summary.maximum := counter_value;
        IFEND;

{ Elapsed_time_since_predecessor

        IF (selection_p^.predecessor_job_statistic_p <> NIL) OR
              (selection_p^.predecessor_task_statistic_p <> NIL) THEN
          IF selection_p^.predecessor_job_statistic_p <> NIL THEN
            pmp$compute_date_time_increment (ptv$predecessor_job_date_time, statistic_header_p^.date_time,
                  interval, local_status);
          ELSE
            pmp$compute_date_time_increment (ptv$predecessor_task_date_time, statistic_header_p^.date_time,
                  interval, local_status);
          IFEND;
          IF local_status.normal THEN
            field_p^.field_summary.elapsed_time_since_predecessor :=
                  field_p^.field_summary.elapsed_time_since_predecessor + interval_to_millisecond (interval);
          IFEND;
        IFEND;

      IFEND;

{ All Occurrences

      IF field_p^.collect_all_occurrences THEN
        IF field_p^.counter_value_tail_p^.index = ptc$statistics_array_size THEN
          NEXT field_p^.counter_value_tail_p^.link_p IN ptv$data_segment_p.sequence_pointer;
          field_p^.counter_value_tail_p := field_p^.counter_value_tail_p^.link_p;
          field_p^.counter_value_tail_p^.link_p := NIL;
          field_p^.counter_value_tail_p^.index := 0;
        IFEND;
        field_p^.counter_value_tail_p^.index := field_p^.counter_value_tail_p^.index + 1;
        field_p^.counter_value_tail_p^.value_array [field_p^.counter_value_tail_p^.index] := counter_value;
      IFEND;

  PROCEND collect_counter;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] collect_date_time', EJECT ??

{ PURPOSE
{   The purpose of this request is to collect date_time data.
{

  PROCEDURE [INLINE] collect_date_time
    (    statistic_header_p: ^sft$statistic_header;
         field_p { input, output } : ^field);

{ Summary

    IF field_p^.collect_summary THEN

{ First Occurrence

      IF field_p^.first_value THEN
        field_p^.first_date_time_value := statistic_header_p^.date_time;
        field_p^.field_summary.first_date_time := statistic_header_p^.date_time;
        field_p^.first_value := FALSE;
      IFEND;

{ Last Occurrence

      field_p^.last_date_time_value := statistic_header_p^.date_time;

{ Count

      field_p^.field_summary.count := field_p^.field_summary.count + 1;

    IFEND;

{ All Occurrences

    IF field_p^.collect_all_occurrences THEN
      IF field_p^.date_time_value_tail_p^.index = ptc$statistics_array_size THEN
        NEXT field_p^.date_time_value_tail_p^.link_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.date_time_value_tail_p := field_p^.date_time_value_tail_p^.link_p;
        field_p^.date_time_value_tail_p^.link_p := NIL;
        field_p^.date_time_value_tail_p^.index := 0;
      IFEND;
      field_p^.date_time_value_tail_p^.index := field_p^.date_time_value_tail_p^.index + 1;
      field_p^.date_time_value_tail_p^.value_array [field_p^.date_time_value_tail_p^.index] :=
            statistic_header_p^.date_time;
    IFEND;

  PROCEND collect_date_time;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] collect_descriptive_data', EJECT ??

{ PURPOSE
{   The purpose of this request is to collect descriptive data for put_field (display_option all_occurrences)
{ and put_interval_field report entry.

  PROCEDURE [INLINE] collect_descriptive_data
    (    statistic_header_p: ^sft$statistic_header;
         descriptive_p: ^sft$descriptive_data;
         field_p { input, output } : ^field);

    VAR
      null_subfield: boolean,
      substring_found: boolean,
      descriptive_data_length: integer,
      descriptive_data_start: integer;

{ Summary

    IF field_p^.collect_summary THEN

{ First Occurrence

      IF field_p^.first_value THEN
        field_p^.field_summary.first_date_time := statistic_header_p^.date_time;
        field_p^.first_value := FALSE;
        IF descriptive_p <> NIL THEN
          get_descriptive_data_subfield (descriptive_p, statistic_header_p^.descriptive_data_size,
                field_p^.subfield_position, field_p^.subfield_length, field_p^.subfield_number,
                field_p^.subfield_delimiter, null_subfield, substring_found, descriptive_data_start,
                descriptive_data_length);

          IF substring_found THEN
            NEXT field_p^.first_descriptive_value_p: [descriptive_data_length] IN
                  ptv$data_segment_p.sequence_pointer;
            field_p^.first_descriptive_value_p^ := descriptive_p^
                  (descriptive_data_start, descriptive_data_length);
          IFEND;
        IFEND;
      IFEND;

{ Last Occurrence
{    See end of collect all occurrences IF statement.

{ Count

      field_p^.field_summary.count := field_p^.field_summary.count + 1;

    IFEND;

{ All Occurrences

    IF field_p^.collect_all_occurrences THEN
      IF field_p^.descriptive_value_tail_p^.index = ptc$statistics_array_size THEN
        NEXT field_p^.descriptive_value_tail_p^.link_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.descriptive_value_tail_p := field_p^.descriptive_value_tail_p^.link_p;
        field_p^.descriptive_value_tail_p^.link_p := NIL;
        field_p^.descriptive_value_tail_p^.index := 0;
      IFEND;
      field_p^.descriptive_value_tail_p^.index := field_p^.descriptive_value_tail_p^.index + 1;

      IF descriptive_p <> NIL THEN
        get_descriptive_data_subfield (descriptive_p, statistic_header_p^.descriptive_data_size,
              field_p^.subfield_position, field_p^.subfield_length, field_p^.subfield_number,
              field_p^.subfield_delimiter, null_subfield, substring_found, descriptive_data_start,
              descriptive_data_length);
      ELSE
        substring_found := FALSE;
      IFEND;

      IF substring_found THEN
        NEXT field_p^.descriptive_value_tail_p^.value_array [field_p^.descriptive_value_tail_p^.
              index]: [descriptive_data_length] IN ptv$data_segment_p.sequence_pointer;
        field_p^.descriptive_value_tail_p^.value_array [field_p^.descriptive_value_tail_p^.index]^ :=
              descriptive_p^ (descriptive_data_start, descriptive_data_length);
      ELSE
        field_p^.descriptive_value_tail_p^.value_array [field_p^.descriptive_value_tail_p^.index] := NIL;
      IFEND;
      IF field_p^.collect_summary THEN
{  Assign last value pointer when all occurrences are being collected
        field_p^.last_descriptive_value_p := field_p^.descriptive_value_tail_p^.
              value_array [field_p^.descriptive_value_tail_p^.index]
      IFEND;
    ELSEIF field_p^.collect_summary THEN
      IF descriptive_p <> NIL THEN
        get_descriptive_data_subfield (descriptive_p, statistic_header_p^.descriptive_data_size,
              field_p^.subfield_position, field_p^.subfield_length, field_p^.subfield_number,
              field_p^.subfield_delimiter, null_subfield, substring_found, descriptive_data_start,
              descriptive_data_length);
      ELSE
        substring_found := FALSE;
      IFEND;

      IF substring_found THEN

{  Assign last value pointer if not collect all occurrences
        IF field_p^.last_descriptive_value_p = NIL THEN
          NEXT field_p^.last_descriptive_value_p: [sfc$max_descriptive_data_size] IN
                ptv$data_segment_p.sequence_pointer;
        IFEND;
        field_p^.last_descriptive_value_p^ := descriptive_p^ (descriptive_data_start,
              descriptive_data_length);
      IFEND;
    IFEND;

  PROCEND collect_descriptive_data;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] collect_descriptive_data_size', EJECT ??

{ PURPOSE
{   The purpose of this request is to collect data about the size of descriptive data fields.
{

  PROCEDURE [INLINE] collect_descriptive_data_size
    (    statistic_header_p: ^sft$statistic_header;
         field_p { input, output } : ^field);

    VAR
      counter_value_real: real;

{ Summary

    IF field_p^.collect_summary THEN

{ First Occurrence

      IF field_p^.first_value THEN
        field_p^.first_dd_size_value := statistic_header_p^.descriptive_data_size;
        field_p^.field_summary.first_date_time := statistic_header_p^.date_time;
        field_p^.first_value := FALSE;
      IFEND;

{ Last Occurrence

      field_p^.last_dd_size_value := statistic_header_p^.descriptive_data_size;

{ Count

      field_p^.field_summary.count := field_p^.field_summary.count + 1;

{ Sum

      IF NOT field_p^.field_summary.sum_overflow THEN
        IF UPPERVALUE (field_p^.field_summary.sum) - field_p^.field_summary.sum >
              statistic_header_p^.descriptive_data_size THEN
          field_p^.field_summary.sum := field_p^.field_summary.sum +
                statistic_header_p^.descriptive_data_size;
          counter_value_real := $REAL (statistic_header_p^.descriptive_data_size);
          field_p^.field_summary.square_sum := field_p^.field_summary.square_sum + counter_value_real *
                counter_value_real;
        ELSE
          field_p^.field_summary.sum_overflow := TRUE;
        IFEND;
      IFEND;

{ Minimum

      IF statistic_header_p^.descriptive_data_size < field_p^.field_summary.minimum THEN
        field_p^.field_summary.minimum := statistic_header_p^.descriptive_data_size;
      IFEND;

{ Maximum

      IF statistic_header_p^.descriptive_data_size > field_p^.field_summary.maximum THEN
        field_p^.field_summary.maximum := statistic_header_p^.descriptive_data_size;
      IFEND;

    IFEND;

{ All Occurrences

    IF field_p^.collect_all_occurrences THEN
      IF field_p^.dd_size_value_tail_p^.index = ptc$statistics_array_size THEN
        NEXT field_p^.dd_size_value_tail_p^.link_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.dd_size_value_tail_p := field_p^.dd_size_value_tail_p^.link_p;
        field_p^.dd_size_value_tail_p^.link_p := NIL;
        field_p^.dd_size_value_tail_p^.index := 0;
      IFEND;
      field_p^.dd_size_value_tail_p^.index := field_p^.dd_size_value_tail_p^.index + 1;
      field_p^.dd_size_value_tail_p^.value_array [field_p^.dd_size_value_tail_p^.index] :=
            statistic_header_p^.descriptive_data_size;
    IFEND;

  PROCEND collect_descriptive_data_size;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] collect_elapsed_time', EJECT ??

{ PURPOSE
{   The purpose of this request is to collect data about elapsed time fields.
{

  PROCEDURE [INLINE] collect_elapsed_time
    (    date_time_1: ost$date_time;
         date_time_2: ost$date_time;
         field_p { input, output } : ^field);

    VAR
      interval: pmt$time_increment,
      interval_value: integer,
      interval_value_real: real,
      local_status: ost$status;

    pmp$compute_date_time_increment (date_time_1, date_time_2, interval, local_status);
    interval_value := interval_to_millisecond (interval);

{ Summary

    IF field_p^.collect_summary THEN

{ First Occurrence

      IF field_p^.first_value THEN
        field_p^.first_elapsed_time_value := interval_value;
        field_p^.field_summary.first_date_time := date_time_1;
        field_p^.first_value := FALSE;
      IFEND;

{ Predecessor or predecessor_chain_head beginning statistics may not occur in
{  The same order as the successors, so test for earliest date_time.

      IF date_time_1_gt_date_time_2 (field_p^.field_summary.first_date_time, date_time_1) THEN
        field_p^.field_summary.first_date_time := date_time_1;
      IFEND;

{ Last Occurrence

      field_p^.last_elapsed_time_value := interval_value;

{ Count

      field_p^.field_summary.count := field_p^.field_summary.count + 1;

{ Sum

      IF NOT field_p^.field_summary.sum_overflow THEN
        IF UPPERVALUE (field_p^.field_summary.sum) - field_p^.field_summary.sum > interval_value THEN
          field_p^.field_summary.sum := field_p^.field_summary.sum + interval_value;
          interval_value_real := $REAL (interval_value);
          field_p^.field_summary.square_sum := field_p^.field_summary.square_sum + interval_value_real *
                interval_value_real;
        ELSE
          field_p^.field_summary.sum_overflow := TRUE;
        IFEND;
      IFEND;

{ Minimum

      IF interval_value < field_p^.field_summary.minimum THEN
        field_p^.field_summary.minimum := interval_value;
      IFEND;

{ Maximum

      IF interval_value > field_p^.field_summary.maximum THEN
        field_p^.field_summary.maximum := interval_value;
      IFEND;

    IFEND;

{ All Occurrences

    IF field_p^.collect_all_occurrences THEN
      IF field_p^.elapsed_time_value_tail_p^.index = ptc$statistics_array_size THEN
        NEXT field_p^.elapsed_time_value_tail_p^.link_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.elapsed_time_value_tail_p := field_p^.elapsed_time_value_tail_p^.link_p;
        field_p^.elapsed_time_value_tail_p^.link_p := NIL;
        field_p^.elapsed_time_value_tail_p^.index := 0;
      IFEND;
      field_p^.elapsed_time_value_tail_p^.index := field_p^.elapsed_time_value_tail_p^.index + 1;
      field_p^.elapsed_time_value_tail_p^.value_array [field_p^.elapsed_time_value_tail_p^.index] :=
            interval_value;
    IFEND;

  PROCEND collect_elapsed_time;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] collect_elapsed_time_calc', EJECT ??

{ PURPOSE
{   The purpose of this request is to collect data from calculations involving elapsed time values as
{ the denominator and possibly counter values as the numerator.
{

  PROCEDURE [INLINE] collect_elapsed_time_calc
    (    date_time_1: ost$date_time;
         date_time_2: ost$date_time;
         value: real;
         field_p { input, output } : ^field);

    VAR
      elapsed_time_value: real,
      field_value: real,
      interval: pmt$time_increment,
      local_status: ost$status;

    pmp$compute_date_time_increment (date_time_1, date_time_2, interval, local_status);
    elapsed_time_value := $REAL (interval_to_millisecond (interval));

{  Assign a value of 1 millisecond to the elapsed time if it equals 0

    IF elapsed_time_value < 1.0 THEN
      elapsed_time_value := 1.0;
    IFEND;
    field_value := value / elapsed_time_value;

{ Summary
{  Don't collect summary information if the field value is negative and
{    negative increments are not allowed

    IF field_p^.collect_summary AND ((field_value >= 0.0) OR (field_p^.allow_negative_increment)) THEN

{ First Occurrence

      IF field_p^.first_value THEN
        field_p^.first_value_per_second_value := field_value;
        field_p^.field_summary.first_date_time := date_time_2;
        field_p^.first_value := FALSE;
      IFEND;

{ Predecessor or predecessor_chain_head beginning statistics may not occur in
{  The same order as the successors, so test for earliest date_time.

      IF date_time_1_gt_date_time_2 (field_p^.field_summary.first_date_time, date_time_1) THEN
        field_p^.field_summary.first_date_time := date_time_1;
      IFEND;

{ Last Occurrence

      field_p^.last_value_per_second_value := field_value;

{ Count

      field_p^.field_summary.count := field_p^.field_summary.count + 1;

{ Sum

      field_p^.value_per_second_sum := field_p^.value_per_second_sum + field_value;
      field_p^.field_summary.square_sum := field_p^.field_summary.square_sum + field_value * field_value;

{ Minimum

      IF field_value < field_p^.value_per_second_minimum THEN
        field_p^.value_per_second_minimum := field_value;
      IFEND;

{ Maximum

      IF field_value > field_p^.value_per_second_maximum THEN
        field_p^.value_per_second_maximum := field_value;
      IFEND;

    IFEND;

{ All Occurrences

    IF field_p^.collect_all_occurrences THEN
      IF field_p^.value_per_second_value_tail_p^.index = ptc$statistics_array_size THEN
        NEXT field_p^.value_per_second_value_tail_p^.link_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.value_per_second_value_tail_p := field_p^.value_per_second_value_tail_p^.link_p;
        field_p^.value_per_second_value_tail_p^.link_p := NIL;
        field_p^.value_per_second_value_tail_p^.index := 0;
      IFEND;
      field_p^.value_per_second_value_tail_p^.index := field_p^.value_per_second_value_tail_p^.index + 1;
      field_p^.value_per_second_value_tail_p^.value_array [field_p^.value_per_second_value_tail_p^.index] :=
            field_value;
    IFEND;

  PROCEND collect_elapsed_time_calc;

?? OLDTITLE ??
?? NEWTITLE := 'collect_field', EJECT ??

{ PURPOSE:
{   The purpose of this request is to collect data from all types of fields based on the report entry
{     specifications.
{
{ DESIGN:
{   The procedure collects all the data that it needs for the defined report for the current selection.  If
{ one or more of the counters defined for the selection is incremental,
{ the procedure checks if the current statistic selection is based on date_time
{ with continuous_date_time = FALSE (selecting statistics in a window of time in the day) and the current
{ statistic is the first statistic in a new day, then the current statistic counter's value is a new base for
{ the incremental calculations.  The value of the nonincremental counters are ignored in order to match the
{ number of values collected for incremental and nonincremental counters defined for the same selection.  The
{ interval between the current statistic and the previous one is ignored.
{
{   The procedure collects date_time and predecessor date_time at the selection level.  That data will be
{ available for each field defined for that selection for the interval report.  At the field level the
{ procedure collects summary data for summary report and counter values for an interval report.
{
{ NOTE:
{   The feature called skip deadstart described above causes problems when incremental counters can receive
{ negative increments.  Analyze_Binary_Log assumes that there was a deadstart and computes the wrong values.
{ Because of that feature test PT0002 failed.
{   The feature statistic header fields undoes some of skip deadstart (New counter value < old counter value).
{ The number of values are matched in write_field_ao_report and write_interval_report.

  PROCEDURE collect_field
    (    selection_p: ^selection;
         statistic_header_p: ^sft$statistic_header;
         counters_p: sft$counters;
         descriptive_p: ^sft$descriptive_data;
         predecessor_p: ^successor;
     VAR status: ost$status);

    VAR
      field_p: ^field,
      successor_p: ^successor;

    status.normal := TRUE;

    IF selection_p^.incremental THEN
      process_incremental_selection (statistic_header_p, selection_p, counters_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    IFEND;

    collect_selection (statistic_header_p, selection_p);

    field_p := selection_p^.field_chain_p;
    WHILE field_p <> NIL DO

      CASE field_p^.field_type OF

      = counter_field =
        collect_counter (statistic_header_p, selection_p, counters_p, field_p);

      = descriptive_data_field =
        collect_descriptive_data (statistic_header_p, descriptive_p, field_p);

      = date_time_field =
        collect_date_time (statistic_header_p, field_p);

      = statistic_code_field =
        collect_statistic_code (statistic_header_p, field_p);

      = system_job_name_field =
        collect_system_job_name (statistic_header_p, field_p);

      = global_task_id_field =
        collect_global_task_id (statistic_header_p, field_p);

      = number_of_counters_field =
        collect_number_of_counters (statistic_header_p, field_p);

      = descriptive_data_size_field =
        collect_descriptive_data_size (statistic_header_p, field_p);

      = previous_occurrence_field, predecessor_field, predecessor_chain_head_field, value_per_second_field,
            occurrence_per_second_field =
        elapsed_time_calculation (statistic_header_p^.date_time, predecessor_p, statistic_header_p,
              counters_p, field_p);

      = text_field =
      CASEND;

      field_p^.field_summary.last_date_time := statistic_header_p^.date_time;
      field_p := field_p^.field_chain_link_p;

    WHILEND;

    field_p := selection_p^.shadow_field_chain_p;
    WHILE field_p <> NIL DO
      successor_p := predecessor_p;
      WHILE successor_p^.selection_p <> field_p^.original_selection_p DO
        successor_p := successor_p^.predecessor_p;
      WHILEND;

      CASE field_p^.field_type OF

      = counter_field =
        collect_counter (successor_p^.statistic_header_p, successor_p^.selection_p, successor_p^.counters_p,
              field_p);

      = descriptive_data_field =
        collect_descriptive_data (successor_p^.statistic_header_p, successor_p^.descriptive_data_p, field_p);

      = date_time_field =
        collect_date_time (successor_p^.statistic_header_p, field_p);

      = statistic_code_field =
        collect_statistic_code (successor_p^.statistic_header_p, field_p);

      = system_job_name_field =
        collect_system_job_name (successor_p^.statistic_header_p, field_p);

      = global_task_id_field =
        collect_global_task_id (successor_p^.statistic_header_p, field_p);

      = number_of_counters_field =
        collect_number_of_counters (successor_p^.statistic_header_p, field_p);

      = descriptive_data_size_field =
        collect_descriptive_data_size (successor_p^.statistic_header_p, field_p);

      = previous_occurrence_field, predecessor_field, predecessor_chain_head_field, value_per_second_field,
            occurrence_per_second_field =
        elapsed_time_calculation (successor_p^.statistic_header_p^.date_time, successor_p^.predecessor_p,
              successor_p^.statistic_header_p, successor_p^.counters_p, field_p);

      = text_field =
      CASEND;

      field_p^.field_summary.last_date_time := statistic_header_p^.date_time;
      field_p := field_p^.field_chain_link_p;

    WHILEND;

  PROCEND collect_field;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] collect_global_task_id', EJECT ??

{ PURPOSE
{   The purpose of this request is to collect global task id data.
{

  PROCEDURE [INLINE] collect_global_task_id
    (    statistic_header_p: ^sft$statistic_header;
         field_p { input, output } : ^field);

{ Summary

    IF field_p^.collect_summary THEN

{ First Occurrence

      IF field_p^.first_value THEN
        field_p^.first_global_task_id_value := statistic_header_p^.task_id;
        field_p^.field_summary.first_date_time := statistic_header_p^.date_time;
        field_p^.first_value := FALSE;
      IFEND;

{ Last Occurrence

      field_p^.last_global_task_id_value := statistic_header_p^.task_id;

{ Count

      field_p^.field_summary.count := field_p^.field_summary.count + 1;

    IFEND;

{ All Occurrences

    IF field_p^.collect_all_occurrences THEN
      IF field_p^.global_task_id_value_tail_p^.index = ptc$statistics_array_size THEN
        NEXT field_p^.global_task_id_value_tail_p^.link_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.global_task_id_value_tail_p := field_p^.global_task_id_value_tail_p^.link_p;
        field_p^.global_task_id_value_tail_p^.link_p := NIL;
        field_p^.global_task_id_value_tail_p^.index := 0;
      IFEND;
      field_p^.global_task_id_value_tail_p^.index := field_p^.global_task_id_value_tail_p^.index + 1;
      field_p^.global_task_id_value_tail_p^.value_array [field_p^.global_task_id_value_tail_p^.index] :=
            statistic_header_p^.task_id;
    IFEND;

  PROCEND collect_global_task_id;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] collect_number_of_counters', EJECT ??

{ PURPOSE
{   The purpose of this request is to collect data about the number of counters.
{

  PROCEDURE [INLINE] collect_number_of_counters
    (    statistic_header_p: ^sft$statistic_header;
         field_p { input, output } : ^field);

    VAR
      counter_value_real: real;

{ Summary

    IF field_p^.collect_summary THEN

{ First Occurrence

      IF field_p^.first_value THEN
        field_p^.first_num_of_counters_value := statistic_header_p^.number_of_counters;
        field_p^.field_summary.first_date_time := statistic_header_p^.date_time;
        field_p^.first_value := FALSE;
      IFEND;

{ Last Occurrence

      field_p^.last_num_of_counters_value := statistic_header_p^.number_of_counters;

{ Count

      field_p^.field_summary.count := field_p^.field_summary.count + 1;

{ Sum

      IF NOT field_p^.field_summary.sum_overflow THEN
        IF UPPERVALUE (field_p^.field_summary.sum) - field_p^.field_summary.sum >
              statistic_header_p^.number_of_counters THEN
          field_p^.field_summary.sum := field_p^.field_summary.sum + statistic_header_p^.number_of_counters;
          counter_value_real := $REAL (statistic_header_p^.number_of_counters);
          field_p^.field_summary.square_sum := field_p^.field_summary.square_sum + counter_value_real *
                counter_value_real;
        ELSE
          field_p^.field_summary.sum_overflow := TRUE;
        IFEND;
      IFEND;

{ Minimum

      IF statistic_header_p^.number_of_counters < field_p^.field_summary.minimum THEN
        field_p^.field_summary.minimum := statistic_header_p^.number_of_counters;
      IFEND;

{ Maximum

      IF statistic_header_p^.number_of_counters > field_p^.field_summary.maximum THEN
        field_p^.field_summary.maximum := statistic_header_p^.number_of_counters;
      IFEND;

    IFEND;

{ All Occurrences

    IF field_p^.collect_all_occurrences THEN
      IF field_p^.number_of_counters_value_tail_p^.index = ptc$statistics_array_size THEN
        NEXT field_p^.number_of_counters_value_tail_p^.link_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.number_of_counters_value_tail_p := field_p^.number_of_counters_value_tail_p^.link_p;
        field_p^.number_of_counters_value_tail_p^.link_p := NIL;
        field_p^.number_of_counters_value_tail_p^.index := 0;
      IFEND;
      field_p^.number_of_counters_value_tail_p^.index := field_p^.number_of_counters_value_tail_p^.index + 1;
      field_p^.number_of_counters_value_tail_p^.value_array
            [field_p^.number_of_counters_value_tail_p^.index] := statistic_header_p^.number_of_counters;
    IFEND;

  PROCEND collect_number_of_counters;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] collect_selection', EJECT ??

{ PURPOSE
{   The purpose of this request is to collect selection level data.
{     This is only date_time data.
{

  PROCEDURE [INLINE] collect_selection
    (    statistic_header_p: ^sft$statistic_header;
         selection_p { input, output } : ^selection);

    IF selection_p^.collect_date_time THEN
      IF selection_p^.date_time_value_tail_p^.index = ptc$statistics_array_size THEN
        NEXT selection_p^.date_time_value_tail_p^.link_p IN ptv$data_segment_p.sequence_pointer;
        selection_p^.date_time_value_tail_p := selection_p^.date_time_value_tail_p^.link_p;
        selection_p^.date_time_value_tail_p^.link_p := NIL;
        selection_p^.date_time_value_tail_p^.index := 0;
      IFEND;
      selection_p^.date_time_value_tail_p^.index := selection_p^.date_time_value_tail_p^.index + 1;
      selection_p^.date_time_value_tail_p^.value_array [selection_p^.date_time_value_tail_p^.index] :=
            statistic_header_p^.date_time;
      IF selection_p^.skip_date_time THEN
        selection_p^.skip_date_time_tail_p^.date_time_after_skip := statistic_header_p^.date_time;
        selection_p^.skip_date_time := FALSE;
      IFEND;
    IFEND;

    IF selection_p^.collect_predecessor_date_time THEN
      IF selection_p^.predecessor_dt_value_tail_p^.index = ptc$statistics_array_size THEN
        NEXT selection_p^.predecessor_dt_value_tail_p^.link_p IN ptv$data_segment_p.sequence_pointer;
        selection_p^.predecessor_dt_value_tail_p := selection_p^.predecessor_dt_value_tail_p^.link_p;
        selection_p^.predecessor_dt_value_tail_p^.link_p := NIL;
        selection_p^.predecessor_dt_value_tail_p^.index := 0;
      IFEND;
      selection_p^.predecessor_dt_value_tail_p^.index := selection_p^.predecessor_dt_value_tail_p^.index + 1;
      IF selection_p^.predecessor_job_statistic_p <> NIL THEN
        selection_p^.predecessor_dt_value_tail_p^.value_array
              [selection_p^.predecessor_dt_value_tail_p^.index] := ptv$predecessor_job_date_time;
      ELSEIF selection_p^.predecessor_task_statistic_p <> NIL THEN
        selection_p^.predecessor_dt_value_tail_p^.value_array
              [selection_p^.predecessor_dt_value_tail_p^.index] := ptv$predecessor_task_date_time;
      IFEND;
    IFEND;

  PROCEND collect_selection;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] collect_statistic_code', EJECT ??

{ PURPOSE
{   The purpose of this request is to collect statistic code data.
{

  PROCEDURE [INLINE] collect_statistic_code
    (    statistic_header_p: ^sft$statistic_header;
         field_p { input, output } : ^field);

{ Summary

    IF field_p^.collect_summary THEN

{ First Occurrence

      IF field_p^.first_value THEN
        field_p^.first_statistic_code_value := statistic_header_p^.statistic_code;
        field_p^.field_summary.first_date_time := statistic_header_p^.date_time;
        field_p^.first_value := FALSE;
      IFEND;

{ Last Occurrence

      field_p^.last_statistic_code_value := statistic_header_p^.statistic_code;

{ Count

      field_p^.field_summary.count := field_p^.field_summary.count + 1;

    IFEND;

{ All Occurrences

    IF field_p^.collect_all_occurrences THEN
      IF field_p^.statistic_code_value_tail_p^.index = ptc$statistics_array_size THEN
        NEXT field_p^.statistic_code_value_tail_p^.link_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.statistic_code_value_tail_p := field_p^.statistic_code_value_tail_p^.link_p;
        field_p^.statistic_code_value_tail_p^.link_p := NIL;
        field_p^.statistic_code_value_tail_p^.index := 0;
      IFEND;
      field_p^.statistic_code_value_tail_p^.index := field_p^.statistic_code_value_tail_p^.index + 1;
      field_p^.statistic_code_value_tail_p^.value_array [field_p^.statistic_code_value_tail_p^.index] :=
            statistic_header_p^.statistic_code;
    IFEND;

  PROCEND collect_statistic_code;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] collect_system_job_name', EJECT ??

{ PURPOSE
{   The purpose of this request is to collect system job name data.
{

  PROCEDURE [INLINE] collect_system_job_name
    (    statistic_header_p: ^sft$statistic_header;
         field_p { input, output } : ^field);

{ Summary

    IF field_p^.collect_summary THEN

{ First Occurrence

      IF field_p^.first_value THEN
        field_p^.first_system_job_name_value := statistic_header_p^.job_name;
        field_p^.field_summary.first_date_time := statistic_header_p^.date_time;
        field_p^.first_value := FALSE;
      IFEND;

{ Last Occurrence

      field_p^.last_system_job_name_value := statistic_header_p^.job_name;

{ Count

      field_p^.field_summary.count := field_p^.field_summary.count + 1;

    IFEND;

{ All Occurrences

    IF field_p^.collect_all_occurrences THEN
      IF field_p^.system_job_name_value_tail_p^.index = ptc$statistics_array_size THEN
        NEXT field_p^.system_job_name_value_tail_p^.link_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.system_job_name_value_tail_p := field_p^.system_job_name_value_tail_p^.link_p;
        field_p^.system_job_name_value_tail_p^.link_p := NIL;
        field_p^.system_job_name_value_tail_p^.index := 0;
      IFEND;
      field_p^.system_job_name_value_tail_p^.index := field_p^.system_job_name_value_tail_p^.index + 1;
      field_p^.system_job_name_value_tail_p^.value_array [field_p^.system_job_name_value_tail_p^.index] :=
            statistic_header_p^.job_name;
    IFEND;

  PROCEND collect_system_job_name;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] date_time_1_gt_date_time_2', EJECT ??

{ PURPOSE:
{   The purpose of this request is to check if date_time_1 is later than date_time_2.

  FUNCTION [INLINE] date_time_1_gt_date_time_2
    (    date_time_1: ost$date_time;
         date_time_2: ost$date_time): boolean;

    VAR
      date_time_c: ^cell,
      date_time_s_1: ^string (ptc$date_time_record_size),
      date_time_s_2: ^string (ptc$date_time_record_size);

{ Compare Date_Time mapped to string, because the comparison operators (>, <, >= & <=) cannot compare
{ date_time records. The alternative is to compare the fields.

    date_time_c := ^date_time_1;
    date_time_s_1 := date_time_c;
    date_time_c := ^date_time_2;
    date_time_s_2 := date_time_c;
    date_time_1_gt_date_time_2 := date_time_s_1^ > date_time_s_2^;

  FUNCEND date_time_1_gt_date_time_2;

?? OLDTITLE ??
?? NEWTITLE := 'compute_summary', EJECT ??

{ PURPOSE:
{   The purpose of this request is to compute the summary for put_field and put_field_summary reports.
{
{ DESIGN
{   The procedure computes mean, standard deviation, interval, count per second , sum per second and elapsed
{ time since predecessor.  If the counter is incremental the count is reduced by 1 to exclude the base value.
{ IF the count is 0 then the minimum and maximum are set to 0.

  PROCEDURE compute_summary
    (VAR status: ost$status);

    VAR
      failing_status: ost$status,
      interval: pmt$time_increment,
      interval_ms: integer,
      field_p: ^field,
      selection_p: ^selection,
      standard_deviation_v: real;

    status.normal := TRUE;

    selection_p := ptv$selection_chain_head_p;
    WHILE selection_p <> NIL DO
      field_p := selection_p^.field_chain_p;
      WHILE field_p <> NIL DO

        IF field_p^.collect_summary THEN

{ If counter is incremental then the first value is a base value and doesn't count.

          IF (field_p^.field_summary.count > 0) AND ((field_p^.incremental) OR
                (field_p^.field_type = previous_occurrence_field) OR
                ((field_p^.field_type = value_per_second_field) AND
                (field_p^.elapsed_time = previous_occurrence)) OR
                ((field_p^.field_type = occurrence_per_second_field) AND
                (field_p^.elapsed_time = previous_occurrence))) THEN
            field_p^.field_summary.count := field_p^.field_summary.count - 1;
          IFEND;

          IF field_p^.field_summary.count > 0 THEN

{  SUM

            IF field_p^.field_summary.sum_overflow THEN
              field_p^.field_summary.sum := 0;
              osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$sum_overflow, field_p^.field_name,
                    failing_status);
              report_intermediate_error (failing_status, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;
            IFEND;

{  MEAN

            IF (field_p^.field_type = value_per_second_field) OR
                  (field_p^.field_type = occurrence_per_second_field) THEN

              field_p^.field_summary.mean := field_p^.value_per_second_sum /
                    $REAL (field_p^.field_summary.count);
            ELSE
              field_p^.field_summary.mean := $REAL (field_p^.field_summary.sum) /
                    $REAL (field_p^.field_summary.count);
            IFEND;

            pmp$compute_date_time_increment (field_p^.field_summary.first_date_time,
                  field_p^.field_summary.last_date_time, interval, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            interval_ms := interval_to_millisecond (interval) - selection_p^.lost_interval;

            IF interval_ms > 0 THEN

              field_p^.field_summary.count_per_second := ($REAL (field_p^.field_summary.count) /
                    $REAL (interval_ms) * 1000.0);

              field_p^.field_summary.sum_per_second := ($REAL (field_p^.field_summary.sum) *
                    field_p^.multiplier / $REAL (interval_ms) * 1000.0);

              IF field_p^.incremental THEN
                field_p^.field_summary.interval := interval_ms DIV field_p^.field_summary.count;
              ELSE
                field_p^.field_summary.interval := interval_ms DIV (field_p^.field_summary.count - 1);
              IFEND;

            IFEND;

            IF field_p^.field_summary.count > 1 THEN

{  S.D = (sum((x - mean(x))**2) / (count - 1))** 0.5
{  S.D = sqrt((sum(x)**2 + sum(mean(x)**2) - 2*mean(x)*sum(x)) / (count - 1))
{  S.D = sqrt(square_sum + mean(x)**2*count - 2*mean(x)*sum(x)) / (count - 1))

              IF (field_p^.field_type = value_per_second_field) OR
                    (field_p^.field_type = occurrence_per_second_field) THEN

                standard_deviation_v := (field_p^.field_summary.square_sum + field_p^.field_summary.mean *
                      field_p^.field_summary.mean * $REAL (field_p^.field_summary.count) - 2.0 *
                      field_p^.field_summary.mean * field_p^.value_per_second_sum) /
                      $REAL (field_p^.field_summary.count - 1);
                field_p^.field_summary.standard_deviation := mlp$rsqrt (standard_deviation_v);

              ELSE
                standard_deviation_v := (field_p^.field_summary.square_sum + field_p^.field_summary.mean *
                      field_p^.field_summary.mean * $REAL (field_p^.field_summary.count) - 2.0 *
                      field_p^.field_summary.mean * $REAL (field_p^.field_summary.sum)) /
                      $REAL (field_p^.field_summary.count - 1);
                field_p^.field_summary.standard_deviation := mlp$rsqrt (standard_deviation_v);
              IFEND;
            IFEND;

            IF field_p^.field_summary.elapsed_time_since_predecessor <> 0 THEN
              field_p^.field_summary.elapsed_time_since_predecessor :=
                    field_p^.field_summary.elapsed_time_since_predecessor DIV field_p^.field_summary.count;
            IFEND;

          ELSE
            field_p^.field_summary.minimum := 0;
            field_p^.field_summary.maximum := 0;
          IFEND;

        IFEND;

        field_p := field_p^.field_chain_link_p;
      WHILEND;
      selection_p := selection_p^.selection_chain_link_p;
    WHILEND;

  PROCEND compute_summary;

?? OLDTITLE ??
?? NEWTITLE := 'convert_integer_to_hex', EJECT ??

{ PURPOSE:
{   The purpose of this request is to convert an integer to its 64 bit hexadecimal string representation.
{
{ DESIGN
{   The procedure takes the counter integer supplied and determines whether it is positive or negative.  If
{ positive, it converts the integer into a hexadecimal string and inserts blanks after each group of four
{ characters.  If negative, it complements the upper bit of the input integer and proceeds as if it were
{ positive.  The upper character is then converted back to the corrected value after the string has been
{ created.  This value is returned to the caller.  e.g A0C4 2234 7785 F400(16)

  PROCEDURE convert_integer_to_hex
    (    counter: integer;
     VAR counter_string: string ( * );
     VAR status: ost$status);

    VAR
      positive_string: string (16),
      positive_value: integer;

    status.normal := TRUE;

    IF counter < 0 THEN
      positive_value := counter + 4000000000000000(16) + 4000000000000000(16);
      clp$convert_integer_to_rjstring (positive_value, 16, FALSE, '0', positive_string, status);
      CASE positive_string (1) OF
      = '0' =
        positive_string (1) := '8';
      = '1' =
        positive_string (1) := '9';
      = '2' =
        positive_string (1) := 'A';
      = '3' =
        positive_string (1) := 'B';
      = '4' =
        positive_string (1) := 'C';
      = '5' =
        positive_string (1) := 'D';
      = '6' =
        positive_string (1) := 'E';
      = '7' =
        positive_string (1) := 'F';
      ELSE
      CASEND;
    ELSE
      clp$convert_integer_to_rjstring (counter, 16, FALSE, '0', positive_string, status);
    IFEND;

{   '   xxxx xxxx xxxx xxxx(16)'

    counter_string (1, 26) := '';
    counter_string (4, 4) := positive_string (1, 4);
    counter_string (9, 4) := positive_string (5, 4);
    counter_string (14, 4) := positive_string (9, 4);
    counter_string (19, 4) := positive_string (13, 4);
    counter_string (23, 4) := '(16)';

  PROCEND convert_integer_to_hex;

?? OLDTITLE ??
?? NEWTITLE := 'convert_output_line_to_excel', EJECT ??

{ PURPOSE:
{   The purpose of this request is to convert a line of output (put_field, put_field_summary or
{ put_interval_field) from text format to EXCEL format.
{
{ DESIGN
{   The procedure copies the input line to a temporary string in case the same string is used as input and
{ output. The procedure copies fields from the original line to output_line based on the report_entry fields
{ position and adds the character TAB (ascii 09) between every field - EXCEL uses the TAB as seperator between
{ columns.

  PROCEDURE convert_output_line_to_excel
    (    report_entry_p: ^put_entry;
         input_line: string ( * <= ptc$max_page_width);
     VAR output_line: string ( * <= ptc$max_page_width);
     VAR output_line_length: integer);

    VAR
      index: integer,
      in_line: string (ptc$max_output_line_length),
      out_index: integer;

    in_line := input_line;
    output_line := '';
    out_index := 0;

    CASE report_entry_p^.put OF

    = put_field_summary =
      out_index := out_index + 1;
      output_line (out_index, report_entry_p^.row_label_column_width) :=
            in_line (report_entry_p^.row_label_start_column, report_entry_p^.row_label_column_width);
      out_index := out_index + report_entry_p^.row_label_column_width;
      output_line (out_index) := $CHAR (ptc$tab);

      FOR index := LOWERBOUND (summary_vector_type) TO UPPERBOUND (summary_vector_type) DO
        IF (report_entry_p^.summary_vector [index].summary <> null) THEN
          out_index := out_index + 1;
          output_line (out_index, report_entry_p^.summary_vector [index].column_width) :=
                in_line (report_entry_p^.summary_vector [index].
                start_column, report_entry_p^.summary_vector [index].column_width);
          out_index := out_index + report_entry_p^.summary_vector [index].column_width;
          output_line (out_index) := $CHAR (ptc$tab);
        IFEND;
      FOREND;

    = put_interval_field, put_field =
      IF (report_entry_p^.put = put_interval_field) AND (report_entry_p^.row_label_type <> row_label_none)
            THEN
        out_index := out_index + 1;
        output_line (out_index, report_entry_p^.date_time_column_width) :=
              in_line (report_entry_p^.date_time_start_column, report_entry_p^.date_time_column_width);
        out_index := out_index + report_entry_p^.date_time_column_width;
        output_line (out_index) := $CHAR (ptc$tab);
      IFEND;

      FOR index := LOWERBOUND (field_vector_type) TO UPPERBOUND (field_vector_type) DO
        IF (report_entry_p^.field_vector [index].summary <> null) THEN
          out_index := out_index + 1;
          output_line (out_index, report_entry_p^.field_vector [index].column_width) :=
                in_line (report_entry_p^.field_vector [index].start_column, report_entry_p^.
                field_vector [index].column_width);
          out_index := out_index + report_entry_p^.field_vector [index].column_width;
          output_line (out_index) := $CHAR (ptc$tab);
        IFEND;
      FOREND;
    ELSE
    CASEND;
    output_line_length := clp$trimmed_string_size (output_line (1, (out_index - 1)));

  PROCEND convert_output_line_to_excel;

?? OLDTITLE ??
?? NEWTITLE := 'interval_to_millisecond', EJECT ??

{ PURPOSE:
{   The purpose of this request is to convert a time_increment from pmt$time_increment record to millisecond
{ as integer.

  FUNCTION interval_to_millisecond
    (    date_time: pmt$time_increment): integer;

    interval_to_millisecond := date_time.year * 32140800000 + { 12 * 31 * 24 * 60 * 60 * 1000 }
          date_time.month * 2678400000 + {      31 * 24 * 60 * 60 * 1000 }
          date_time.day * 86400000 + {           24 * 60 * 60 * 1000 }
          date_time.hour * 3600000 + {                60 * 60 * 1000 }
          date_time.minute * 60000 + {                     60 * 1000 }
          date_time.second * 1000 + {                          1000 }
          date_time.millisecond;
  FUNCEND interval_to_millisecond;

?? OLDTITLE ??
?? NEWTITLE := 'delete_put', EJECT ??

{ PURPOSE:
{   The purpose of this request is to delete put_entry - free all the memory that was allocated to the
{ put_entry.

  PROCEDURE delete_put
    (VAR put_entry_p: ^put_entry);

    CASE put_entry_p^.put OF

    = put_field_summary =
      free_field_list (put_entry_p);

    = put_field =
      free_field_vector (put_entry_p);

    = put_interval_field =
      FREE put_entry_p^.date_time_format_p;
      free_field_vector (put_entry_p);

    = put_string =

{  No need to free pointers in put_string before freeing the put_string record.

    = put_record =
      free_selection_list (put_entry_p^.selection_p);
      IF put_entry_p^.descriptive_text_p <> NIL THEN
        FREE put_entry_p^.descriptive_text_p;
      IFEND;

    ELSE
    CASEND;
    FREE put_entry_p;

  PROCEND delete_put;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] elapsed_time_calculation', EJECT ??

{ PURPOSE
{   The purpose of this request is to set up for elapsed time or elapsed time calculation data collection.
{

  PROCEDURE [INLINE] elapsed_time_calculation
    (    date_time_2: ost$date_time;
         predecessor_p: ^successor;
         statistic_header_p: ^sft$statistic_header,
         counters_p: sft$counters;
         field_p { input, output } : ^field);

    VAR
      date_time_1: ost$date_time,
      elapsed_time: elapsed_time_type,
      field_value: real,
      predecessor_chain_head_p: ^successor;

{ Select the source for date_time_1

    CASE field_p^.field_type OF

    = previous_occurrence_field =
      elapsed_time := previous_occurrence;

    = predecessor_field =
      elapsed_time := predecessor;

    = predecessor_chain_head_field =
      elapsed_time := predecessor_chain_head;

    = value_per_second_field, occurrence_per_second_field =
      elapsed_time := field_p^.elapsed_time;

    CASEND;

{ If the field count is 0, field type is value_per_second_field and the counter is incremental the procedure
{ saves the base value for the counter.

    IF (field_p^.field_summary.count = 0) AND (field_p^.field_type = value_per_second_field) AND
          field_p^.incremental THEN
      IF field_p^.counter_number <= statistic_header_p^.number_of_counters THEN
        field_p^.last_value := counters_p^ [field_p^.counter_number];
        field_p^.field_summary.count := field_p^.field_summary.count + 1;
      IFEND;
      RETURN; {----->
    IFEND;

{ Set date_time_1 value.

    CASE elapsed_time OF
    = previous_occurrence =
      IF field_p^.field_summary.count = 0 THEN
        field_p^.field_summary.count := field_p^.field_summary.count + 1;
        RETURN; {----->
      ELSE
        date_time_1 := field_p^.field_summary.last_date_time;
      IFEND;

    = predecessor =
      IF predecessor_p <> NIL THEN
        date_time_1 := predecessor_p^.date_time;
      ELSE
        RETURN; {----->
      IFEND;

    = predecessor_chain_head =
      IF predecessor_p <> NIL THEN
        predecessor_chain_head_p := predecessor_p;
        WHILE predecessor_chain_head_p^.predecessor_p <> NIL DO
          predecessor_chain_head_p := predecessor_chain_head_p^.predecessor_p;
        WHILEND;
        date_time_1 := predecessor_chain_head_p^.date_time;
      ELSE
        RETURN; {----->
      IFEND;

    CASEND;

{ Call collect procedure.

    CASE field_p^.field_type OF

    = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =
      collect_elapsed_time (date_time_1, date_time_2, field_p);

    = value_per_second_field, occurrence_per_second_field =
      IF field_p^.field_type = value_per_second_field THEN
        IF field_p^.incremental THEN
          field_value := $REAL (counters_p^ [field_p^.counter_number] - field_p^.last_value);
          field_p^.last_value := counters_p^ [field_p^.counter_number];
        ELSE
          field_value := $REAL (counters_p^ [field_p^.counter_number]);
        IFEND;
      ELSE
        field_value := 1.0;
      IFEND;
      collect_elapsed_time_calc (date_time_1, date_time_2, field_value, field_p);

    CASEND;

  PROCEND elapsed_time_calculation;

?? OLDTITLE ??
?? NEWTITLE := 'free_descriptive_selection', EJECT ??

{ PURPOSE:
{   The purpose of this request is to FREE the list of descriptive values, when the descriptive_data is
{ deleted or the statistic selection is changed.

  PROCEDURE free_descriptive_selection
    (    descriptive_subfield_p: ^descriptive_data_subfield);

    VAR
      string_1_p: ^descriptive_data_string,
      string_2_p: ^descriptive_data_string,
      subfield_1_p: ^descriptive_data_subfield,
      subfield_2_p: ^descriptive_data_subfield;

    subfield_1_p := descriptive_subfield_p;
    WHILE subfield_1_p <> NIL DO
      string_1_p := subfield_1_p^.descriptive_data_string_p;
      WHILE string_1_p <> NIL DO
        string_2_p := string_1_p^.descriptive_string_link_p;
        FREE string_1_p;
        string_1_p := string_2_p;
      WHILEND;
      subfield_2_p := subfield_1_p^.descriptive_subfield_link_p;
      FREE subfield_1_p;
      subfield_1_p := subfield_2_p;
    WHILEND;

  PROCEND free_descriptive_selection;

?? OLDTITLE ??
?? NEWTITLE := 'free_field_list', EJECT ??

{ PURPOSE:
{   The purpose of this request is to FREE the list of pointers to fields in put_field_summary entry when the
{ report_entry is deleted or changed.

  PROCEDURE free_field_list
    (    report_entry_p: ^put_entry);

    VAR
      field_list_1_p: ^field_list,
      field_list_2_p: ^field_list,
      report_list_1_p: ^report_list,
      report_list_2_p: ^report_list;

    field_list_1_p := report_entry_p^.fields_p;
    WHILE field_list_1_p <> NIL DO

      report_list_1_p := field_list_1_p^.field_p^.report_list_p;
      WHILE report_list_1_p^.report_p <> report_entry_p DO
        report_list_2_p := report_list_1_p;
        report_list_1_p := report_list_1_p^.link_p;
      WHILEND;
      IF report_list_1_p = field_list_1_p^.field_p^.report_list_p THEN
        field_list_1_p^.field_p^.report_list_p := report_list_1_p^.link_p;
      ELSE
        report_list_2_p^.link_p := report_list_1_p^.link_p;
      IFEND;
      FREE report_list_1_p;

      field_list_2_p := field_list_1_p^.link_p;
      FREE field_list_1_p;
      field_list_1_p := field_list_2_p;
    WHILEND;

  PROCEND free_field_list;

?? OLDTITLE ??
?? NEWTITLE := 'free_field_value', EJECT ??

  PROCEDURE free_field_value
    (    field_p: ^field);

    CASE field_p^.field_type OF

    = counter_field =
      field_p^.counter_value_head_p := NIL;
      field_p^.counter_value_tail_p := NIL;

    = descriptive_data_field =
      field_p^.descriptive_value_head_p := NIL;
      field_p^.descriptive_value_tail_p := NIL;

    = date_time_field =
      field_p^.date_time_value_head_p := NIL;
      field_p^.date_time_value_tail_p := NIL;

    = statistic_code_field =
      field_p^.statistic_code_value_head_p := NIL;
      field_p^.statistic_code_value_tail_p := NIL;

    = system_job_name_field =
      field_p^.system_job_name_value_head_p := NIL;
      field_p^.system_job_name_value_tail_p := NIL;

    = global_task_id_field =
      field_p^.global_task_id_value_head_p := NIL;
      field_p^.global_task_id_value_tail_p := NIL;

    = number_of_counters_field =
      field_p^.number_of_counters_value_head_p := NIL;
      field_p^.number_of_counters_value_tail_p := NIL;

    = descriptive_data_size_field =
      field_p^.dd_size_value_head_p := NIL;
      field_p^.dd_size_value_tail_p := NIL;

    = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =
      field_p^.elapsed_time_value_head_p := NIL;
      field_p^.elapsed_time_value_tail_p := NIL;

    = value_per_second_field, occurrence_per_second_field =
      field_p^.value_per_second_value_head_p := NIL;
      field_p^.value_per_second_value_tail_p := NIL;

    = text_field =

    CASEND;

  PROCEND free_field_value;

?? OLDTITLE ??
?? NEWTITLE := 'free_field_vector', EJECT ??

{ PURPOSE:
{   The purpose of this request is to FREE the vector of pointers to fields in put_field and
{   put_interval_field entries when the report_entry is deleted or changed.

  PROCEDURE free_field_vector
    (    report_entry_p: ^put_entry);

    VAR
      index: integer,
      report_list_1_p: ^report_list,
      report_list_2_p: ^report_list;


    FOR index := LOWERBOUND (field_vector_type) TO UPPERBOUND (field_vector_type) DO
      IF (report_entry_p^.field_vector [index].summary <> null) THEN
        report_list_1_p := report_entry_p^.field_vector [index].field_p^.report_list_p;
        WHILE report_list_1_p^.report_p <> report_entry_p DO
          report_list_2_p := report_list_1_p;
          report_list_1_p := report_list_1_p^.link_p;
        WHILEND;
        IF report_list_1_p = report_entry_p^.field_vector [index].field_p^.report_list_p THEN
          report_entry_p^.field_vector [index].field_p^.report_list_p := report_list_1_p^.link_p;
        ELSE
          report_list_2_p^.link_p := report_list_1_p^.link_p;
        IFEND;
        FREE report_list_1_p;
      IFEND;
    FOREND;

  PROCEND free_field_vector;

?? OLDTITLE ??
?? NEWTITLE := 'free_selection_list', EJECT ??

{ PURPOSE:
{   The purpose of this request is to FREE the list of pointers to selections in put_record entry when the
{ log_entry is deleted or changed.

  PROCEDURE free_selection_list
    (    selection_list_p: ^selection_list);

    VAR
      selection_list_1_p: ^selection_list,
      selection_list_2_p: ^selection_list;

    selection_list_1_p := selection_list_p;
    WHILE selection_list_1_p <> NIL DO
      selection_list_1_p^.selection_p^.log_entry_p := NIL;
      selection_list_2_p := selection_list_1_p^.link_p;
      FREE selection_list_1_p;
      selection_list_1_p := selection_list_2_p;
    WHILEND;

  PROCEND free_selection_list;

?? OLDTITLE ??
?? NEWTITLE := 'get_date_time_format', EJECT ??

{ PURPOSE:
{   The purpose of this request is to let the user control ANABL's output date_time_format by reading the
{ value of an SCL variable the user can set before calling ANABL.
{   That lets the user of Analyze_Binary_Log set the date_time_format for date_time in generate_log (list
{ and legible_data logs) and display_logged_statistic.
{
{ DESIGN
{   The procedure reads the value of the SCL variable ptv$anabl_date_time_format.
{ It checks if the variable is a string type and copies the string to ptv$date_time_format string.
{ If status is not normal (the SCL variable doesn't exist or doesn't fit the working area) the status
{ recovers to normal and Analyze_Binary_Log continues with its default date_time_format.
{
{ NOTE:
{   Example for SCL variable for date_time format:
{     ptv$anabl_date_time_format: string ='ISOD  H24:MM:SS.S1000'

  PROCEDURE get_date_time_format;

    VAR
      access_mode: clt$data_access_mode,
      class: clt$variable_class,
      evaluation_method: clt$expression_eval_method,
      local_status: ost$status,
      type_specification_p: ^clt$type_specification,
      value_p: ^clt$data_value,
      work_area_p: ^SEQ ( * );

    local_status.normal := TRUE;

    PUSH work_area_p: [[REP 500 OF cell]];
    PUSH type_specification_p: [[REP 500 OF cell]];
    clp$get_variable ('ptv$anabl_date_time_format', work_area_p, class, access_mode, evaluation_method,
          type_specification_p, value_p, local_status);
    IF local_status.normal THEN
      IF value_p^.kind = clc$string THEN
        ptv$date_time_format := value_p^.string_value^;
      IFEND;
    IFEND;

  PROCEND get_date_time_format;

?? OLDTITLE ??
?? NEWTITLE := 'get_descriptive_data_subfield', EJECT ??

{ Return the "absolute location" of the descriptive data subfield
{ in the descriptive data field specified by
{  subfield number:  0 implies keyword ALL
{  subfield position
{  subfield length:  0 implies null substring
{ Indicate if
{  The subfield is a null string (='')
{  The substring was found

{ The caller must insure that descriptive_p <> NIL before calling this procedure

  PROCEDURE [INLINE] get_descriptive_data_subfield
    (    descriptive_p: ^sft$descriptive_data;
         descriptive_data_size: integer;
         subfield_position: 0 .. sfc$max_descriptive_data_size;
         subfield_length: 0 .. sfc$max_descriptive_data_size;
         subfield_number: 0 .. sfc$max_descriptive_data_size;
         subfield_delimiter: char;
     VAR null_subfield: boolean;
     VAR substring_found: boolean;
     VAR start: integer;
     VAR length: integer);

    TYPE
      delimiter = set of char;

    VAR
      select: delimiter,
      subfield_start: 1 .. sfc$max_descriptive_data_size,
      scan_start: 1 .. sfc$max_descriptive_data_size,
      scan_length: 1 .. sfc$max_descriptive_data_size,
      delimiter_found: boolean,
      subfield_count: integer;

    IF descriptive_data_size = 0 THEN
      start := 0;
      length := 0;
{ subfield_number = 0 means subfield_number = ALL
      IF subfield_number <= 1 THEN
        null_subfield := TRUE;
        IF subfield_length = 0 THEN
          substring_found := TRUE;
        ELSE
          substring_found := FALSE;
        IFEND;
      ELSE
        substring_found := FALSE;
        null_subfield := FALSE;
      IFEND;
    ELSE { descriptive_data_size > 0
      select := $delimiter [subfield_delimiter];

{ Initialize for case where subfield_number = ALL ( = 0 )
{ This is unnecessary if subfield_number > 0
      subfield_start := 1;
      scan_length := descriptive_data_size + 1;

{ Initialize for all cases
      subfield_count := 0;
      scan_start := 1;

{ Look for specified subfield until end of descriptive data field is found.
{ This loop is not executed even once if subfield_number = ALL
      WHILE (subfield_count < subfield_number) AND (scan_start <= descriptive_data_size) DO
        #SCAN (select, descriptive_p^ (scan_start, * ), scan_length, delimiter_found);
        subfield_count := subfield_count + 1;
        subfield_start := scan_start;
        scan_start := scan_start + scan_length;
      WHILEND;

{ Found the specified subfield
      IF (subfield_count = subfield_number) THEN
{ First character was delimiter, so null subfield
        IF scan_length = 1 THEN
          null_subfield := TRUE;
          start := subfield_start;
          length := 0;
          IF subfield_length = 0 THEN
            substring_found := TRUE;
          ELSE
            substring_found := FALSE;
          IFEND;
{ Subfield long enough for substring to start in it
        ELSEIF (subfield_position < scan_length) THEN
          null_subfield := FALSE;
          substring_found := TRUE;
          start := subfield_start + subfield_position - 1;
          IF subfield_length < scan_length - subfield_position THEN
            length := subfield_length;
          ELSE
            length := scan_length - subfield_position;
          IFEND;
        ELSE
          null_subfield := FALSE;
          substring_found := FALSE;
          start := 0;
          length := 0;
        IFEND;

{ Last character is the subfield delimiter, so the last subfield is null
      ELSEIF (subfield_count = subfield_number - 1) AND (descriptive_p^ (descriptive_data_size,
            1) = subfield_delimiter) THEN
        IF subfield_length = 0 THEN
          substring_found := TRUE;
        ELSE
          substring_found := FALSE;
        IFEND;
        null_subfield := TRUE;
        start := descriptive_data_size;
        length := 0;
      ELSE
{ Didn't find specified subfield
        null_subfield := FALSE;
        substring_found := FALSE;
        start := 0;
        length := 0;
      IFEND;
    IFEND;

  PROCEND get_descriptive_data_subfield;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] get_statistic_record', EJECT ??

{ PURPOSE:
{  The purpose of this request is to "read" a statistic record from the binary log file.
{
{ DESIGN
{  The procedure returns to the caller 3 pointers:
{    -  pointer to the statistic header.
{    -  pointer to the counters array.
{    -  pointer to the descriptive data string.
{  If the input file access level is segment (non-active binary log) the pointers point directly to the
{  record in the input file.
{   Otherwise if the input file access level is record (active binary log) the statistic record is copied
{  with amp$get_next to a record buffer (ptv$statistic_record_buffer) and the pointers point to to the record
{  buffer.
{  The procedure performs those steps to set the pointers
{    1) Use NEXT to skip the record header (only in segment access).
{    2) Use NEXT to put pointer on statistic header.
{    3) IF ptv$number_of_counters > 0 THEN use NEXT to put pointer on counter array.
{    4) IF descriptive_data_size > 0 THEN use NEXT to put pointer on descriptive_data.
{  The procedure returns:
{    - NIL for the statistic header when file postion at END OF INFORMATION.
{    - NIL for the counters when number of counters is 0.
{    - NIL for the descriptive data when the descriptive data size is 0.

  PROCEDURE [INLINE] get_statistic_record
    (    input_log_p: ^log_file;
     VAR statistic_header_p: ^sft$statistic_header;
     VAR counters_p: sft$counters;
     VAR descriptive_data_p: ^sft$descriptive_data;
     VAR status: ost$status);

    VAR
      file_position: amt$file_position,
      log_header_p: ^bat$record_header,
      record_byte_address: amt$file_byte_address,
      statistic_record_buffer_p: ^sft$statistic_buffer,
      transfer_count: amt$transfer_count;


    status.normal := TRUE;

    statistic_header_p := NIL;
    counters_p := NIL;
    descriptive_data_p := NIL;

    IF input_log_p^.access_level = amc$segment THEN
      NEXT log_header_p IN input_log_p^.segment_pointer.sequence_pointer;
      IF log_header_p <> NIL THEN
        NEXT statistic_header_p IN input_log_p^.segment_pointer.sequence_pointer;
        IF statistic_header_p = NIL THEN
          osp$set_status_condition (pte$unexpected_end_of_file, status);
          osp$append_status_file (osc$status_parameter_delimiter, input_log_p^.log_file_name, status);
          RETURN; {----->
        IFEND;

        IF statistic_header_p^.number_of_counters > 0 THEN
          NEXT counters_p: [1 .. statistic_header_p^.number_of_counters] IN
                input_log_p^.segment_pointer.sequence_pointer;
          IF counters_p = NIL THEN
            osp$set_status_condition (pte$unexpected_end_of_file, status);
            osp$append_status_file (osc$status_parameter_delimiter, input_log_p^.log_file_name, status);
            RETURN; {----->
          IFEND;
        IFEND;

        IF statistic_header_p^.descriptive_data_size > 0 THEN
          NEXT descriptive_data_p: [statistic_header_p^.descriptive_data_size] IN
                input_log_p^.segment_pointer.sequence_pointer;
          IF descriptive_data_p = NIL THEN
            osp$set_status_condition (pte$unexpected_end_of_file, status);
            osp$append_status_file (osc$status_parameter_delimiter, input_log_p^.log_file_name, status);
            RETURN; {----->
          IFEND;
        IFEND;
      IFEND;
    ELSE
      statistic_record_buffer_p := ^ptv$statistic_record_buffer;
      amp$get_next (input_log_p^.file_identifier, statistic_record_buffer_p,
            #SIZE (ptv$statistic_record_buffer), transfer_count, record_byte_address, file_position, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

      IF file_position <> amc$eoi THEN
        RESET statistic_record_buffer_p;
        NEXT statistic_header_p IN statistic_record_buffer_p;
        IF statistic_header_p^.number_of_counters > 0 THEN
          NEXT counters_p: [1 .. statistic_header_p^.number_of_counters] IN statistic_record_buffer_p;
        IFEND;
        IF statistic_header_p^.descriptive_data_size > 0 THEN
          NEXT descriptive_data_p: [statistic_header_p^.descriptive_data_size] IN statistic_record_buffer_p;
        IFEND;
      IFEND;

    IFEND;

  PROCEND get_statistic_record;

?? OLDTITLE ??
?? NEWTITLE := 'get_time_increment_format', EJECT ??

{ PURPOSE:
{   The purpose of this request is to get the time increment format from an SCL variable.  This lets the
{ user of Analyze_Binary_Log set the time increment format for interval and elapsed_time_since_predecessor
{ (put_field, put_field_summary and put_interval_field reports).
{
{ DESIGN
{   The procedure gets the value of the SCL variable ptv$anabl_time_increment_format.  It checks if the
{ variable is a keyword type and copies the string to ptv$time_increment_format string.
{ If the status is not normal (the SCL variable doesn't exist or doesn't fit the working area), the status
{ recovers to normal and Analyze_Binary_Log continues with its default time_increment_format.
{
{ NOTE:
{   Example for SCL variable for time increment format:
{     ptv$anabl_time_increment_format: key (time_increment ti) (seconds second s) keyend = ti

  PROCEDURE get_time_increment_format
    (VAR status: ost$status);

    VAR
      access_mode: clt$data_access_mode,
      class: clt$variable_class,
      evaluation_method: clt$expression_eval_method,
      local_status: ost$status,
      type_specification_p: ^clt$type_specification,
      value_p: ^clt$data_value,
      work_area_p: ^SEQ ( * );

{ ptv$time_increment_format can get the keyword value TIME_INCREMENT or SECONDS

    local_status.normal := TRUE;

    PUSH work_area_p: [[REP 500 OF cell]];
    PUSH type_specification_p: [[REP 500 OF cell]];
    clp$get_variable ('ptv$anabl_time_increment_format', work_area_p, class, access_mode, evaluation_method,
          type_specification_p, value_p, local_status);
    IF local_status.normal THEN
      IF value_p^.kind = clc$keyword THEN
        ptv$time_increment_format := value_p^.keyword_value;
      IFEND;
    IFEND;

  PROCEND get_time_increment_format;

?? OLDTITLE ??
?? NEWTITLE := 'initialize_field_values', EJECT ??

{ PURPOSE:
{   The purpose of this request is to initialize the statistics and the fields for collecting data for
{ Generate_Report before scanning the input log(s).

  PROCEDURE initialize_field_values
    (    field_p: ^field);

    field_p^.field_summary := ptv$initial_field_summary;

    IF (field_p^.field_type = value_per_second_field) OR (field_p^.field_type = occurrence_per_second_field)
          THEN
      field_p^.value_per_second_sum := 0.0;
      field_p^.value_per_second_minimum := ptc$max_real;
      field_p^.value_per_second_maximum := 0.0;
    IFEND;

    IF field_p^.collect_all_occurrences THEN
      CASE field_p^.field_type OF

      = counter_field =
        NEXT field_p^.counter_value_head_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.counter_value_tail_p := field_p^.counter_value_head_p;
        field_p^.counter_value_head_p^.link_p := NIL;
        IF field_p^.incremental THEN
{  Start with the second value in the value array to keep in sync with
{    non-incremental counters
          field_p^.counter_value_head_p^.index := 1;
        ELSE
          field_p^.counter_value_head_p^.index := 0;
        IFEND;

      = descriptive_data_field =
        NEXT field_p^.descriptive_value_head_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.descriptive_value_tail_p := field_p^.descriptive_value_head_p;
        field_p^.descriptive_value_head_p^.link_p := NIL;
        field_p^.descriptive_value_head_p^.index := 0;
        field_p^.first_descriptive_value_p := NIL;
        field_p^.last_descriptive_value_p := NIL;

      = date_time_field =
        NEXT field_p^.date_time_value_head_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.date_time_value_tail_p := field_p^.date_time_value_head_p;
        field_p^.date_time_value_head_p^.link_p := NIL;
        field_p^.date_time_value_head_p^.index := 0;

      = statistic_code_field =
        NEXT field_p^.statistic_code_value_head_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.statistic_code_value_tail_p := field_p^.statistic_code_value_head_p;
        field_p^.statistic_code_value_head_p^.link_p := NIL;
        field_p^.statistic_code_value_head_p^.index := 0;

      = system_job_name_field =
        NEXT field_p^.system_job_name_value_head_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.system_job_name_value_tail_p := field_p^.system_job_name_value_head_p;
        field_p^.system_job_name_value_head_p^.link_p := NIL;
        field_p^.system_job_name_value_head_p^.index := 0;

      = global_task_id_field =
        NEXT field_p^.global_task_id_value_head_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.global_task_id_value_tail_p := field_p^.global_task_id_value_head_p;
        field_p^.global_task_id_value_head_p^.link_p := NIL;
        field_p^.global_task_id_value_head_p^.index := 0;

      = number_of_counters_field =
        NEXT field_p^.number_of_counters_value_head_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.number_of_counters_value_tail_p := field_p^.number_of_counters_value_head_p;
        field_p^.number_of_counters_value_head_p^.link_p := NIL;
        field_p^.number_of_counters_value_head_p^.index := 0;

      = descriptive_data_size_field =
        NEXT field_p^.dd_size_value_head_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.dd_size_value_tail_p := field_p^.dd_size_value_head_p;
        field_p^.dd_size_value_head_p^.link_p := NIL;
        field_p^.dd_size_value_head_p^.index := 0;

      = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =
        NEXT field_p^.elapsed_time_value_head_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.elapsed_time_value_tail_p := field_p^.elapsed_time_value_head_p;
        field_p^.elapsed_time_value_head_p^.link_p := NIL;
        IF field_p^.field_type = previous_occurrence_field THEN
{  Start with the second value in the value array to keep in sync with
{    non-incremental counters
          field_p^.elapsed_time_value_head_p^.index := 1;
        ELSE
          field_p^.elapsed_time_value_head_p^.index := 0;
        IFEND;

      = value_per_second_field, occurrence_per_second_field =
        NEXT field_p^.value_per_second_value_head_p IN ptv$data_segment_p.sequence_pointer;
        field_p^.value_per_second_value_tail_p := field_p^.value_per_second_value_head_p;
        field_p^.value_per_second_value_head_p^.link_p := NIL;
        IF field_p^.incremental OR (field_p^.elapsed_time = previous_occurrence) THEN
{  Start with the second value in the value array to keep in sync with
{    non-incremental counters
          field_p^.value_per_second_value_head_p^.index := 1;
        ELSE
          field_p^.value_per_second_value_head_p^.index := 0;
        IFEND;

      = text_field =

      ELSE
      CASEND;

    IFEND;

  PROCEND initialize_field_values;

?? OLDTITLE ??
?? NEWTITLE := 'initialize_selection_values', EJECT ??

{ PURPOSE:
{   The purpose of this request is to initialize the statistics and the fields for collecting data for
{ Generate_Report before scanning the input log(s).
{
{ DESIGN
{   The procedure allocates and initializes storage space for interval reports (date_time and
{ predecessor_date_time for selection counter_value or descriptive_value for fields) and initializes
{ counter_variable for summary reports.

  PROCEDURE initialize_selection_values;

    VAR
      field_p: ^field,
      selection_p: ^selection;

    selection_p := ptv$selection_chain_head_p;
    WHILE selection_p <> NIL DO

      IF selection_p^.collect_date_time THEN
        NEXT selection_p^.date_time_value_head_p IN ptv$data_segment_p.sequence_pointer;
        selection_p^.date_time_value_tail_p := selection_p^.date_time_value_head_p;
        selection_p^.date_time_value_head_p^.link_p := NIL;
        selection_p^.date_time_value_head_p^.index := 0;
      IFEND;

      IF selection_p^.collect_predecessor_date_time THEN
        NEXT selection_p^.predecessor_dt_value_head_p IN ptv$data_segment_p.sequence_pointer;
        selection_p^.predecessor_dt_value_tail_p := selection_p^.predecessor_dt_value_head_p;
        selection_p^.predecessor_dt_value_head_p^.link_p := NIL;
        selection_p^.predecessor_dt_value_head_p^.index := 0;
      IFEND;

      field_p := selection_p^.field_chain_p;
      WHILE field_p <> NIL DO
        initialize_field_values (field_p);
        field_p := field_p^.field_chain_link_p;
      WHILEND;

      field_p := selection_p^.shadow_field_chain_p;
      WHILE field_p <> NIL DO
        initialize_field_values (field_p);
        field_p := field_p^.field_chain_link_p;
      WHILEND;

      selection_p := selection_p^.selection_chain_link_p;
    WHILEND;

  PROCEND initialize_selection_values;

?? OLDTITLE ??
?? NEWTITLE := 'initialize_write_field_ao', EJECT ??

{ PURPOSE:
{   The purpose of this request is to initialize the fields for an all_occurrences field report.
{
{
{ DESIGN:
{   For every non null summary in the field_vector the procedure initializes the report field.
{   The procedure checks that there are values collected for that field. If the check fails, the procedure
{ returns.  Otherwise the procedure adds 1 to number_of_active_fields and adds the field index to the
{ active_fields set.
{
{ The procedures sets:
{   - Value_index to 0.
{   - Pointer to the first counter value.
{
{ If the counter is incremental, then incremental flag is set to true.

  PROCEDURE initialize_write_field_ao
    (    report_entry_p: ^put_entry;
     VAR active_fields: active_fields_set;
     VAR field_value_p: field_value_type;
     VAR last_non_null_field: integer;
     VAR number_of_active_fields: integer;
     VAR status: ost$status);

    VAR
      field_p: ^field,
      index: integer;

    status.normal := TRUE;

{ Initialize print all_occurrences process

    number_of_active_fields := 0;
    active_fields := $active_fields_set [];

    index := LOWERBOUND (field_vector_type);
    WHILE (index <= UPPERBOUND (field_vector_type)) AND (report_entry_p^.field_vector [index].
          summary <> null) DO
      IF report_entry_p^.field_vector [index].field_p^.field_type <> text_field THEN

{  Can skip text fields because they are printed in the report until no other fields are active.
{  Initialize field

      /initialize_field_ao/
        BEGIN
          IF report_entry_p^.field_vector [index].shadow_field THEN
            field_p := report_entry_p^.field_vector [index].shadow_field_p;
          ELSE
            field_p := report_entry_p^.field_vector [index].field_p;
          IFEND;

          field_value_p [index].value_index := 0;
          field_value_p [index].first := FALSE;

          CASE field_p^.field_type OF

          = counter_field =
            IF field_p^.incremental THEN

{  If incremental, start with second value in value array.  This is where
{    initialize_fields started storing values.

              field_value_p [index].value_index := 1;
              field_value_p [index].first := TRUE;
            IFEND;
            IF field_p^.counter_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].counter_value_p := field_p^.counter_value_head_p;
            ELSE
              EXIT /initialize_field_ao/;
            IFEND;

          = descriptive_data_field =
            IF field_p^.descriptive_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].descriptive_value_p := field_p^.descriptive_value_head_p;
            ELSE
              EXIT /initialize_field_ao/;
            IFEND;

          = date_time_field =
            IF field_p^.date_time_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].date_time_p := field_p^.date_time_value_head_p;
            ELSE
              EXIT /initialize_field_ao/;
            IFEND;

          = statistic_code_field =
            IF field_p^.statistic_code_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].statistic_code_value_p := field_p^.statistic_code_value_head_p;
            ELSE
              EXIT /initialize_field_ao/;
            IFEND;

          = system_job_name_field =
            IF field_p^.system_job_name_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].system_job_name_value_p := field_p^.system_job_name_value_head_p;
            ELSE
              EXIT /initialize_field_ao/;
            IFEND;

          = global_task_id_field =
            IF field_p^.global_task_id_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].global_task_id_value_p := field_p^.global_task_id_value_head_p;
            ELSE
              EXIT /initialize_field_ao/;
            IFEND;

          = number_of_counters_field =
            IF field_p^.number_of_counters_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].number_of_counters_value_p := field_p^.number_of_counters_value_head_p;
            ELSE
              EXIT /initialize_field_ao/;
            IFEND;

          = descriptive_data_size_field =
            IF field_p^.dd_size_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].dd_size_value_p := field_p^.dd_size_value_head_p;
            ELSE
              EXIT /initialize_field_ao/;
            IFEND;

          = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =
            IF field_p^.field_type = previous_occurrence_field THEN

{  If incremental, start with second value in value array.  This is where
{    initialize_fields started storing values.

              field_value_p [index].value_index := 1;
              field_value_p [index].first := TRUE;
            IFEND;
            IF field_p^.elapsed_time_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].elapsed_time_value_p := field_p^.elapsed_time_value_head_p;
            ELSE
              EXIT /initialize_field_ao/;
            IFEND;

          = value_per_second_field, occurrence_per_second_field =
            IF field_p^.incremental OR (field_p^.elapsed_time = previous_occurrence) THEN

{  If incremental, start with second value in value array.  This is where
{    initialize_fields started storing values.

              field_value_p [index].value_index := 1;
              field_value_p [index].first := TRUE;
            IFEND;
            IF field_p^.value_per_second_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].value_per_second_value_p := field_p^.value_per_second_value_head_p;
            ELSE
              EXIT /initialize_field_ao/;
            IFEND;

          = text_field =
{  Should not get here since outer IF excludes text_field

          CASEND;

          active_fields := active_fields + $active_fields_set [index];
          number_of_active_fields := number_of_active_fields + 1;

        END /initialize_field_ao/;
      IFEND;

      index := index + 1;
    WHILEND;

    last_non_null_field := index - 1;

  PROCEND initialize_write_field_ao;

?? OLDTITLE ??
?? NEWTITLE := 'initialize_write_interval', EJECT ??

{ PURPOSE:
{   The purpose of this request is to initialize an interval field report.
{
{ DESIGN:
{   The procedure sets begin date_time to ptv$min_date_time (1900-01-01 00:00:00.000).  For every non null
{ summary in the field_vector the procedure initializes the report field.
{ If the report row_label_type is start_time, end_time or time_range then the procedure converts
{ begin_date_time to string.
{   The procedure checks that there are values collected for that counter.  If the report field summary is
{ elapsed_time_since_predecessor then the procedure checks to see that predecessor date_time was collected.
{ If one of the checks fails the procedure returns.  Otherwise the procedure adds 1 to number_of_active_fields
{ and the field index to the active_fields set.
{ The procedures sets:
{   - Value_index to 0.
{   - Pointer to the first counter value.
{   - Pointer to date_time.
{   - Pointer to skip_date_time.
{   - Lost_interval to 0,
{   - First_date_time value.
{   - First flag to true.
{
{ NOTE:
{ - Begin_date_time for fields is the minimum date_time from the first value of all the fields in
{   the report.

  PROCEDURE initialize_write_interval
    (    report_entry_p: ^put_entry;
     VAR active_fields: active_fields_set;
     VAR begin_date_time: ost$date_time;
     VAR field_value_p: field_value_type;
     VAR last_non_null_field: integer;
     VAR number_of_active_fields: integer;
     VAR status: ost$status);

    VAR
      field_p: ^field,
      index: integer;

    status.normal := TRUE;

{ Initialize print interval process

    begin_date_time := ptv$max_date_time;
    number_of_active_fields := 0;
    active_fields := $active_fields_set [];

    index := LOWERBOUND (field_vector_type);
    WHILE (index <= UPPERBOUND (field_vector_type)) AND (report_entry_p^.field_vector [index].
          summary <> null) DO
      IF report_entry_p^.field_vector [index].field_p^.field_type <> text_field THEN

      /initialize_interval_field/
        BEGIN
          IF report_entry_p^.field_vector [index].shadow_field THEN
            field_p := report_entry_p^.field_vector [index].shadow_field_p;
          ELSE
            field_p := report_entry_p^.field_vector [index].field_p;
          IFEND;

          field_value_p [index].value_index := 0;

          CASE field_p^.field_type OF

          = counter_field =
            IF field_p^.incremental THEN

{  If incremental, start with second value in value array.  This is where
{    initialize_fields started storing values.

              field_value_p [index].value_index := 1;
              field_value_p [index].first := TRUE;
            IFEND;
            IF field_p^.counter_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].counter_value_p := field_p^.counter_value_head_p;
            ELSE
              EXIT /initialize_interval_field/;
            IFEND;

          = descriptive_data_field =
            IF field_p^.descriptive_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].descriptive_value_p := field_p^.descriptive_value_head_p;
            ELSE
              EXIT /initialize_interval_field/;
            IFEND;

          = date_time_field =
            IF field_p^.date_time_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].date_time_p := field_p^.date_time_value_head_p;
            ELSE
              EXIT /initialize_interval_field/;
            IFEND;

          = statistic_code_field =
            IF field_p^.statistic_code_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].statistic_code_value_p := field_p^.statistic_code_value_head_p;
            ELSE
              EXIT /initialize_interval_field/;
            IFEND;

          = system_job_name_field =
            IF field_p^.system_job_name_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].system_job_name_value_p := field_p^.system_job_name_value_head_p;
            ELSE
              EXIT /initialize_interval_field/;
            IFEND;

          = global_task_id_field =
            IF field_p^.global_task_id_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].global_task_id_value_p := field_p^.global_task_id_value_head_p;
            ELSE
              EXIT /initialize_interval_field/;
            IFEND;

          = number_of_counters_field =
            IF field_p^.number_of_counters_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].number_of_counters_value_p := field_p^.number_of_counters_value_head_p;
            ELSE
              EXIT /initialize_interval_field/;
            IFEND;

          = descriptive_data_size_field =
            IF field_p^.dd_size_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].dd_size_value_p := field_p^.dd_size_value_head_p;
            ELSE
              EXIT /initialize_interval_field/;
            IFEND;

          = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =
            IF field_p^.field_type = previous_occurrence_field THEN

{  If incremental, start with second value in value array.  This is where
{    initialize_fields started storing values.

              field_value_p [index].value_index := 1;
              field_value_p [index].first := TRUE;
            IFEND;
            IF field_p^.elapsed_time_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].elapsed_time_value_p := field_p^.elapsed_time_value_head_p;
            ELSE
              EXIT /initialize_interval_field/;
            IFEND;

          = value_per_second_field, occurrence_per_second_field =
            IF field_p^.incremental OR (field_p^.elapsed_time = previous_occurrence) THEN

{  If incremental, start with second value in value array.  This is where
{    initialize_fields started storing values.

              field_value_p [index].value_index := 1;
              field_value_p [index].first := TRUE;
            IFEND;
            IF field_p^.value_per_second_value_head_p^.index > field_value_p [index].value_index THEN
              field_value_p [index].value_per_second_value_p := field_p^.value_per_second_value_head_p;
            ELSE
              EXIT /initialize_interval_field/;
            IFEND;

          = text_field =
{  Should not get here since outer IF excludes text_field

          CASEND;

          field_value_p [index].date_time_p := field_p^.selection_p^.date_time_value_head_p;
          field_value_p [index].skip_date_time_p := field_p^.selection_p^.skip_date_time_head_p;
          field_value_p [index].lost_interval := 0;

          IF report_entry_p^.field_vector [index].summary = elapsed_time_since_predecessor THEN
            IF field_p^.selection_p^.collect_predecessor_date_time THEN
              field_value_p [index].predecessor_date_time_p :=
                    field_p^.selection_p^.predecessor_dt_value_head_p;
            ELSE
              EXIT /initialize_interval_field/;
            IFEND;
          IFEND;

          field_value_p [index].first_date_time := field_value_p [index].
                date_time_p^.value_array [field_value_p [index].value_index + 1];
          field_value_p [index].first := TRUE;

          IF date_time_1_gt_date_time_2 (begin_date_time, field_value_p [index].
                 date_time_p^.value_array[field_value_p [index].value_index + 1]) THEN
            begin_date_time := field_value_p[index].date_time_p^.
                    value_array[field_value_p [index].value_index + 1];
          IFEND;

          active_fields := active_fields + $active_fields_set [index];
          number_of_active_fields := number_of_active_fields + 1;

        END /initialize_interval_field/;

      IFEND;
      index := index + 1;
    WHILEND;

    last_non_null_field := index - 1;

  PROCEND initialize_write_interval;

?? OLDTITLE ??
?? NEWTITLE := 'open_log_file', EJECT ??

{ PURPOSE:
{   The purpose of this request is to open input or output log files for the generate_log, generate_report and
{ display_logged_statistics commands.
{
{ DESIGN
{   If read mode is selected, the logging interfaces will be used to read the log.

  PROCEDURE open_log_file
    (VAR log_p: ^log_file;
         write_mode: boolean;
     VAR status: ost$status);

    VAR

{ The read access mode for output file is temporary until PSR NV0Q772 is answered.  Until then,
{   the open_file needs read access in order to open the file at EOI and get the previous header
{   file byte address.

      write_attachment_option: [STATIC, READ] array [1 .. 7] of fst$attachment_option := [
            {} [fsc$access_and_share_modes, [fsc$specific_access_modes,
            [fsc$read, fsc$shorten, fsc$append, fsc$modify]], [fsc$determine_from_access_modes]],
            {} [fsc$create_file, TRUE],
            {} [fsc$open_share_modes, []],
            {} [fsc$delete_data, TRUE],
            {} [fsc$error_exit_procedure, NIL],
            {} [fsc$free_behind, TRUE],
            {} [fsc$sequential_access, TRUE]];

    status.normal := TRUE;

    IF write_mode THEN
      fsp$open_file (log_p^.log_file_name, amc$segment, {attachment options=} ^write_attachment_option,
            {default creation attributes=} ^ptv$log_file_attributes,
            {mandated creation attributes=} ^ptv$log_file_attributes,
            {attribute validation=} ^ptv$log_file_attributes, {attribute override=} NIL,
            log_p^.file_identifier, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      log_p^.access_level := amc$segment;
      log_p^.active_log := FALSE;
      log_p^.log_file_identifier := osc$null_name;
    ELSE
      lgp$open_log_file (log_p^.log_file_name, log_p^.active_log, log_p^.log_file_identifier, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      log_p^.access_level := amc$record;
    IFEND;

    IF log_p^.access_level = amc$segment THEN
      amp$get_segment_pointer (log_p^.file_identifier, amc$sequence_pointer, log_p^.segment_pointer, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    IFEND;

  PROCEND open_log_file;

?? OLDTITLE ??
?? NEWTITLE := 'open_report_file', EJECT ??

{ PURPOSE:
{   The purpose of this request is to open a text file for output from generate_report or generate_log.

  PROCEDURE open_report_file
    (   file_name: fst$file_reference;
        display_format: display_format_type;
    VAR file_id: cyt$file;
    VAR page_width: 0..ptc$max_page_width;
    VAR status: ost$status);

    VAR
      file_specifications: cyt$file_specifications,
      width_adjustment: 0..1;

    IF display_format = legible_data THEN

      PUSH file_specifications: [1 .. 2];
      file_specifications^ [1].selector := cyc$file_kind;
      file_specifications^ [1].file_kind := cyc$text_file;
      file_specifications^ [2].selector := cyc$page_width;
      file_specifications^ [2].page_width := ptv$legible_data_max_page_width;

      width_adjustment := 0;
    ELSE

      PUSH file_specifications: [1 .. 3];
      file_specifications^ [1].selector := cyc$file_kind;
      file_specifications^ [1].file_kind := cyc$display_file;
      file_specifications^ [2].selector := cyc$new_page_procedure;
      file_specifications^ [2].new_page_procedure.kind := cyc$user_specified_procedure;
      file_specifications^ [2].new_page_procedure.user_procedure := ^anabl_new_page_procedure;
      file_specifications^ [3].selector := cyc$page_width;
      file_specifications^ [3].page_width := ptv$list_max_page_width;

      width_adjustment := 1;
    IFEND;

    cyp$open_file (file_name, file_specifications, file_id, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    page_width := cyp$page_width (file_id) - width_adjustment;

  PROCEND open_report_file;

?? OLDTITLE ??
?? NEWTITLE := 'print_report', EJECT ??

{ PURPOSE:
{   The purpose of this request is to print the report for the generate_report subcommand.

  PROCEDURE print_report
    (VAR status: ost$status);

    VAR
      field_list_p: ^field_list,
      pop_count: integer,
      report_entry_p: ^put_entry;

    status.normal := TRUE;

    report_entry_p := ptv$report_entry_chain_head_p;
    WHILE report_entry_p <> NIL DO
      CASE report_entry_p^.put OF

      = put_field_summary =
        IF report_entry_p^.display_headers THEN
          IF report_entry_p^.header_1 <> ' ' THEN
            ptv$output_line_length := clp$trimmed_string_size (report_entry_p^.header_1);
            cyp$put_next_line (ptv$output_file, report_entry_p^.header_1 (1, ptv$output_line_length), status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          IFEND;
          ptv$output_line_length := clp$trimmed_string_size (report_entry_p^.header_2);
          cyp$put_next_line (ptv$output_file, report_entry_p^.header_2 (1, ptv$output_line_length), status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        IFEND;

        field_list_p := report_entry_p^.fields_p;
        WHILE field_list_p <> NIL DO
          IF field_list_p^.row_label = ' ' THEN
            write_counter_summary (field_list_p^.field_p, field_list_p^.field_p^.field_name, report_entry_p,
                  status);
          ELSE
            write_counter_summary (field_list_p^.field_p, field_list_p^.row_label, report_entry_p, status);
          IFEND;
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          field_list_p := field_list_p^.link_p;
        WHILEND;

      = put_interval_field =
        write_interval_report (report_entry_p, status);

      = put_field =
        IF report_entry_p^.all_occurrences THEN
          write_field_ao_report (report_entry_p, status);
        ELSE
          write_field_report (report_entry_p, status);
        IFEND;

      = put_string =
        ptv$output_line_length := clp$trimmed_string_size (report_entry_p^.header_1);
        cyp$put_next_line (ptv$output_file, report_entry_p^.header_1 (1, ptv$output_line_length), status);

      = put_new_page =
        IF report_entry_p^.use_page_headers THEN
          cyp$start_new_display_page (ptv$output_file, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

        ELSE
          cyp$display_page_eject (ptv$output_file, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        IFEND;

      = push_page_header =

        IF ptv$page_header_list_tail_p <> NIL THEN {At least one entry in list

{ Reuse page_header_list entries, if available.
{ If not, then get a new one.

          IF ptv$page_header_list_tail_p^.fwd_p = NIL THEN
            NEXT ptv$page_header_list_tail_p^.fwd_p IN ptv$data_segment_p.sequence_pointer;
            ptv$page_header_list_tail_p^.fwd_p^.fwd_p := NIL;
            ptv$page_header_list_tail_p^.fwd_p^.bkw_p := ptv$page_header_list_tail_p;
          IFEND;
          ptv$page_header_list_tail_p := ptv$page_header_list_tail_p^.fwd_p;
        ELSE {No entries in page header list
       { Know head pointer <> NIL since report initialized with default header in list
          ptv$page_header_list_tail_p := ptv$page_header_list_head_p;
        IFEND;
        IF report_entry_p^.default_header THEN
          ptv$page_header_list_tail_p^.default_header := TRUE;
          ptv$page_header_list_tail_p^.header_string := '';
        ELSE
          ptv$page_header_list_tail_p^.default_header := FALSE;
          ptv$page_header_list_tail_p^.header_string := report_entry_p^.header_1;
        IFEND;

      = pop_page_header =

        IF report_entry_p^.pop_all_headers THEN
          ptv$page_header_list_tail_p := NIL;

        ELSE
          pop_count := 0;
          WHILE (ptv$page_header_list_tail_p <> NIL) AND (pop_count < report_entry_p^.pop_count) DO
            IF ptv$page_header_list_tail_p^.bkw_p = NIL THEN {Only one entry in list
              ptv$page_header_list_tail_p := NIL;
            ELSE {More than one entry in page header list
{ Pop off one page header list entry
              ptv$page_header_list_tail_p := ptv$page_header_list_tail_p^.bkw_p;
            IFEND;
            pop_count := pop_count + 1;
          WHILEND;
        IFEND;

      ELSE
      CASEND;
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      report_entry_p := report_entry_p^.put_chain_link_p;
    WHILEND;

  PROCEND print_report;

?? OLDTITLE ??
?? NEWTITLE := 'process_descriptive_selection', EJECT ??

{ PURPOSE:
{   The purpose of this request is to process the descriptive data parameter for add_selection and
{ change_selection subcommands.
{
{ DESIGN
{   The procedure receives a list of subfield descriptions and builds a list of pointers to descriptive_data
{ subfield records.  The procedure allocates a record for the descriptive subfields and calls process_subfield
{ to fill the subfield record with the subfield description (list of strings to match, position,
{ length, field number and field delimiter).
{
{ NOTE:
{   The procedure initializes the subfield records with the default values:
{     - subfield_position    1
{     - subfield_length      ALL (sfc$max_descriptive_data_size)
{     - subfield_number      ALL (0)
{     - subfield_delimiter   ','

  PROCEDURE process_descriptive_selection
    (    value: ^clt$data_value;
         selection_p: { output } ^selection);

    VAR
      initial_descriptive_subfield: [STATIC, READ] descriptive_data_subfield := [NIL
            { descriptive_data_string_p } , 1 { subfield_position } , sfc$max_descriptive_data_size
            { subfield_length } , 0 { subfield_number } , ',' { subfield_delimiter } , NIL
            { descriptive_subfield_link_p } ],
      subfield_p: ^descriptive_data_subfield,
      subfield_value: ^clt$data_value;


{ Get the list of subfield records.

    subfield_value := value;
    ALLOCATE selection_p^.descriptive_subfield_p;
    subfield_p := selection_p^.descriptive_subfield_p;
    subfield_p^ := initial_descriptive_subfield;
    process_subfield (subfield_value, subfield_p);
    subfield_value := subfield_value^.link;
    WHILE subfield_value <> NIL DO
      ALLOCATE subfield_p^.descriptive_subfield_link_p;
      subfield_p := subfield_p^.descriptive_subfield_link_p;
      subfield_p^ := initial_descriptive_subfield;
      process_subfield (subfield_value, subfield_p);
      subfield_value := subfield_value^.link;
    WHILEND;

  PROCEND process_descriptive_selection;

?? OLDTITLE ??
?? NEWTITLE := 'process_field_parameter_putfs', EJECT ??

{ PURPOSE:
{     The purpose of this request is to build a list of pointers to fields for put_field_summary & change_put
{   commands.
{
{ DESIGN
{   This procedure builds a list of pointers from the summary report entry to counters.  For each field name
{ in the field parameter the procedure allocates a pointer, sets the pointer to the counter with a name from
{ the field parameter, allocates a pointer in the counter report list and sets that pointer to the summary
{ report entry.
{
{ NOTE:
{   This procedure is looking only for fields of counter type.

  PROCEDURE process_field_parameter_putfs
    (    value: ^clt$data_value;
         report_entry_p: ^put_entry);

    VAR
      field_p: ^field,
      field_list_p: ^field_list,
      report_list_p: ^report_list,
      selection_p: ^selection,
      value_p: ^clt$data_value;

    value_p := value;
    WHILE value_p <> NIL DO
      IF report_entry_p^.fields_p = NIL THEN
        ALLOCATE report_entry_p^.fields_p;
        field_list_p := report_entry_p^.fields_p;
      ELSE
        ALLOCATE field_list_p^.link_p;
        field_list_p := field_list_p^.link_p;
      IFEND;
      field_p := NIL;
      selection_p := ptv$selection_chain_head_p;
      WHILE (selection_p <> NIL) AND (field_p = NIL) DO
        field_p := selection_p^.field_chain_p;
        WHILE (field_p <> NIL) AND (field_p^.field_name <> value_p^.element_value^.field_values^ [1].value^.
              name_value) DO
          field_p := field_p^.field_chain_link_p;
        WHILEND;
        selection_p := selection_p^.selection_chain_link_p;
      WHILEND;

      IF field_p^.report_list_p = NIL THEN
        ALLOCATE field_p^.report_list_p;
        report_list_p := field_p^.report_list_p;
      ELSE
        report_list_p := field_p^.report_list_p;
        WHILE report_list_p^.link_p <> NIL DO
          report_list_p := report_list_p^.link_p;
        WHILEND;
        ALLOCATE report_list_p^.link_p;
        report_list_p := report_list_p^.link_p;
      IFEND;
      report_list_p^.report_p := report_entry_p;
      report_list_p^.link_p := NIL;

      field_list_p^.field_p := field_p;

      IF value_p^.element_value^.field_values^ [2].value <> NIL THEN
        field_list_p^.row_label := value_p^.element_value^.field_values^ [2].value^.string_value^;
      ELSE
        field_list_p^.row_label := value_p^.element_value^.field_values^ [1].value^.name_value;
      IFEND;

      value_p := value_p^.link;
    WHILEND;
    field_list_p^.link_p := NIL;

  PROCEND process_field_parameter_putfs;

?? OLDTITLE ??
?? NEWTITLE := 'process_field_parameter_putif', EJECT ??

{ PURPOSE:
{   The purpose of this request is to set the pointers from interval field and field report entries to the
{ fields for put_field, put_interval_field and change_put subcommands.
{
{ DESIGN
{   This procedure sets pointers from the report entry field vector to the field.  The field name and type
{ (counter or descriptive_data) are in the report entry field vector.  The procedure allocates a pointer in
{ the field report list and sets that pointer to the report entry.

  PROCEDURE process_field_parameter_putif
    (    report_entry_p: ^put_entry);

    VAR
      index: integer,
      field_p: ^field,
      report_list_p: ^report_list;


    FOR index := LOWERBOUND (field_vector_type) TO UPPERBOUND (field_vector_type) DO
      IF report_entry_p^.field_vector [index].summary <> null THEN
        field_p := report_entry_p^.field_vector [index].field_p;
        IF field_p^.report_list_p = NIL THEN
          ALLOCATE field_p^.report_list_p;
          report_list_p := field_p^.report_list_p;
        ELSE
          report_list_p := field_p^.report_list_p;
          WHILE report_list_p^.link_p <> NIL DO
            report_list_p := report_list_p^.link_p;
          WHILEND;
          ALLOCATE report_list_p^.link_p;
          report_list_p := report_list_p^.link_p;
        IFEND;
        report_list_p^.report_p := report_entry_p;
        report_list_p^.link_p := NIL;
        report_list_p^.shadow := FALSE;
      IFEND;
    FOREND;

  PROCEND process_field_parameter_putif;

?? OLDTITLE ??
?? NEWTITLE := 'process_field_position', EJECT ??

{ PURPOSE:
{   The purpose of this request is to process the field (field_name, summary_calculation and
{ position_description) and row_label parameters for the put_interval_field, put_field & change_put
{ subcommands.
{
{ DESIGN
{   The procedure fills the report entry field vector with:
{     - pointer to fields
{     - summary_calculation (for counters the summary_calculation default is SUM and for descriptive data the
{       summary_calculation is always DESCRIPTIVE)
{     - postion (start_column and column_width) of the field in the report line
{     - fields column headers (only in interval_field report entry).
{
{   For interval_field report entry the procedure processes the row_label parameter in order to figure out
{ where in the report line the row_label position is.
{   If the procedure is called from Change_Put subcommand then the row_label and fields parameters are
{ optional and the procedure gets the missing position (row_label position or fields position from the report
{ entry.
{
{
{ put_field display options
{                                      ao  fo  lo  c  s  m  sd  min  max  sps  cps    i  etsp
{ Numeric
{      counter_field                    D  y    y  y  y  y   y   y    y    y    y     y    y
{      number_of_counters_field         D  y    y  y  y  y   y   y    y    y    y
{      descriptive_data_size_field      D  y    y  y  y  y   y   y    y    y    y
{      previous_occurrence_field        D  y    y  y  y  y   y   y    y         y
{      predecessor_field                D  y    y  y  y  y   y   y    y         y
{      predecessor_chain_head_field     D  y    y  y  y  y   y   y    y         y
{      value_per_second_field           D  y    y  y  y  y   y   y    y         y
{      occurrence_per_second_field      D  y    y  y  y  y   y   y    y         y
{ Textual
{      descriptive_data_field           D  y    y  y                            y
{      date_time_field                  D  y    y  y                            y
{      statistic_code_field             D  y    y  y                            y
{      system_job_name_field            D  y    y  y                            y
{      global_task_id_field             D  y    y  y                            y
{      text_field                       D  y    y
{
{ put_interval_field display options
{                                      ao  fo  lo  c  s  m  sd  min  max  sps  cps    i  elps
{ Numeric
{      counter_field                       y       y  D  y   y   y    y    y    y     y    y
{      number_of_counters_field            y       y  D  y   y   y    y    y    y
{      descriptive_data_size_field         y       y  D  y   y   y    y    y    y
{      previous_occurrence_field           y       y  D  y   y   y    y         y
{      predecessor_field                   y       y  D  y   y   y    y         y
{      predecessor_chain_head_field        y       y  D  y   y   y    y         y
{      value_per_second_field              y       y  D  y   y   y    y         y
{      occurrence_per_second_field         y       y  D  y   y   y    y         y
{ Textual
{      descriptive_data_field              D       y                            y
{      date_time_field                     D       y                            y
{      statistic_code_field                D       y                            y
{      system_job_name_field               D       y                            y
{      global_task_id_field                D       y                            y
{      text_field                          D

  PROCEDURE process_field_position
    (    field_parameter: clt$parameter_value;
         row_label: clt$parameter_value;
         report_entry_p: ^put_entry;
     VAR status: ost$status);

    VAR
      column: integer,
      column_index: report_column,
      errors_detected: boolean,
      failing_status: ost$status,
      field_name: ost$name,
      field_p: ^field,
      index: integer,
      initial_field_vector: [STATIC, READ] field_vector_type :=
            [REP ptc$field_vector_size of [NIL, null, * , * , FALSE, NIL]],
      max_column: 0..clc$max_integer,
      new_used_column: report_column_set,
      summary_index: summary_type,
      selection_p: ^selection,
      value_field_p: ^clt$data_value,
      value_position_p: ^clt$data_value,
      used_column: report_column_set;


    status.normal := TRUE;

    column := 1;
    max_column := 0;
    used_column := $report_column_set [];

    IF report_entry_p^.put = put_interval_field THEN

{ row_label

      IF row_label.value <> NIL THEN

{ row_label.label

        IF row_label.value^.field_values^ [1].value <> NIL THEN
          IF row_label.value^.field_values^ [1].value^.kind = clc$keyword THEN
            IF row_label.value^.field_values^ [1].value^.keyword_value = ptc$key_start_time THEN
              report_entry_p^.row_label_type := start_time;
            ELSEIF row_label.value^.field_values^ [1].value^.keyword_value = ptc$key_end_time THEN
              report_entry_p^.row_label_type := end_time;
            ELSEIF row_label.value^.field_values^ [1].value^.keyword_value = ptc$key_time_range THEN
              report_entry_p^.row_label_type := time_range;
            ELSEIF row_label.value^.field_values^ [1].value^.keyword_value = ptc$key_none THEN
              report_entry_p^.row_label_type := row_label_none;
            IFEND;
          ELSE
            report_entry_p^.row_label_type := string_label;
            report_entry_p^.row_label := row_label.value^.field_values^ [1].value^.string_value^;
          IFEND;
        IFEND;

{ row_label.date_time_start_column & row_label.date_time_column_width

        IF row_label.value^.field_values^ [2].value <> NIL THEN
          report_entry_p^.date_time_start_column := row_label.value^.field_values^ [2].value^.integer_value.
                value;
        IFEND;

        IF row_label.value^.field_values^ [3].value <> NIL THEN
          report_entry_p^.date_time_column_width := row_label.value^.field_values^ [3].value^.integer_value.
                value;
        IFEND;

{ row_label.date_time_format

        IF row_label.value^.field_values^ [4].value <> NIL THEN

{ Do not free old report_entry_p^.date_time_format_p

          ALLOCATE report_entry_p^.date_time_format_p: [#SIZE (row_label.value^.field_values^ [4].value^.
                string_value^)];
          report_entry_p^.date_time_format_p^ := row_label.value^.field_values^ [4].value^.string_value^;
        IFEND;

      IFEND;

      IF report_entry_p^.row_label_type <> row_label_none THEN
        column := report_entry_p^.date_time_start_column + report_entry_p^.date_time_column_width - 1;
        IF column > ptc$max_page_width THEN
          osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$field_out_of_line_limits, 'Row_Label',
                status);
          osp$append_status_integer (osc$status_parameter_delimiter, report_entry_p^.date_time_start_column,
                10, FALSE, status);
          osp$append_status_integer (osc$status_parameter_delimiter, report_entry_p^.date_time_column_width,
                10, FALSE, status);
          RETURN; {----->
        IFEND;
        IF column > max_column THEN
          max_column := column;
        IFEND;
        FOR column_index := report_entry_p^.date_time_start_column TO column DO
          used_column := used_column + $report_column_set [column_index];
        FOREND;
      IFEND;

    IFEND;

    IF field_parameter.value <> NIL THEN

      report_entry_p^.header_1 := '';
      report_entry_p^.header_2 := '';

      report_entry_p^.field_vector := initial_field_vector;
      value_field_p := field_parameter.value;
      index := 1;
      WHILE value_field_p <> NIL DO

{ field_name

        selection_p := ptv$selection_chain_head_p;
        field_name := value_field_p^.element_value^.field_values^ [1].value^.name_value;

      /find_field/
        WHILE selection_p <> NIL DO

          field_p := selection_p^.field_chain_p;
          WHILE (field_p <> NIL) AND (field_p^.field_name <> field_name) DO
            field_p := field_p^.field_chain_link_p;
          WHILEND;

          IF field_p <> NIL THEN
            report_entry_p^.field_vector [index].field_p := field_p;
            EXIT /find_field/; {----->
          IFEND;

          selection_p := selection_p^.selection_chain_link_p;
        WHILEND /find_field/;

{ display_option

        IF report_entry_p^.put = put_field THEN

          IF report_entry_p^.all_occurrences THEN
            report_entry_p^.field_vector [index].summary := all_occurrences;
          ELSE

            process_summary (value_field_p^.element_value^.field_values^ [2].value^.keyword_value,
                  report_entry_p^.field_vector [index].summary);
            check_summary (report_entry_p^.field_vector [index].field_p^.field_type,
                  report_entry_p^.field_vector [index].field_p^.field_name,
                  value_field_p^.element_value^.field_values^ [2].value^.keyword_value,
                  report_entry_p^.field_vector [index].summary,
                  status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

            IF report_entry_p^.field_vector [index].field_p^.field_type = text_field THEN
              report_entry_p^.field_vector [index].summary := text;
            IFEND;

          IFEND;

        ELSE { report_entry_p^.put = put_interval_field

          IF value_field_p^.element_value^.field_values^ [2].value = NIL THEN
            CASE report_entry_p^.field_vector [index].field_p^.field_type OF
            = counter_field, number_of_counters_field, descriptive_data_size_field, previous_occurrence_field,
                  predecessor_field, predecessor_chain_head_field, value_per_second_field,
                  occurrence_per_second_field =
              report_entry_p^.field_vector [index].summary := sum;

            = descriptive_data_field, date_time_field, statistic_code_field, system_job_name_field,
                  global_task_id_field =
              report_entry_p^.field_vector [index].summary := first_occurrence;

            = text_field =
              report_entry_p^.field_vector [index].summary := text;

            ELSE
            CASEND;

          ELSEIF (value_field_p^.element_value^.field_values^ [2].value^.keyword_value <>
                ptc$key_last_occurrence) AND (value_field_p^.element_value^.field_values^ [2].value^.
                keyword_value <> ptc$key_all_occurrences) THEN
            process_summary (value_field_p^.element_value^.field_values^ [2].value^.keyword_value,
                  report_entry_p^.field_vector [index].summary);
            check_summary (report_entry_p^.field_vector [index].field_p^.field_type,
                  report_entry_p^.field_vector [index].field_p^.field_name,
                  value_field_p^.element_value^.field_values^ [2].value^.keyword_value,
                  report_entry_p^.field_vector [index].summary,
                  status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          ELSE
            osp$set_status_condition (pte$non_supported_summary_putif, status);
            RETURN; {----->
          IFEND;

        IFEND;

{ start_column & column_width

        process_position (value_field_p^.element_value^.field_values^ [3],
              value_field_p^.element_value^.field_values^ [4], report_entry_p^.field_vector [index].
              summary, report_entry_p^.field_vector [index].field_p^.field_type,
              report_entry_p^.field_vector [index].field_p^.field_name, column, used_column,
              report_entry_p^.field_vector [index].start_column,
              report_entry_p^.field_vector [index].column_width, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        IF column > max_column THEN
          max_column := column;
        IFEND;

        IF (report_entry_p^.put = put_interval_field) OR ((report_entry_p^.put = put_field) AND
              report_entry_p^.all_occurrences) THEN
{  header 1
          process_header (value_field_p^.element_value^.field_values^ [5], report_entry_p,
                report_entry_p^.field_vector [index].start_column,
                report_entry_p^.field_vector [index].column_width,
                report_entry_p^.field_vector [index].summary, report_entry_p^.field_vector [index].field_p,
                report_entry_p^.header_1, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

{  header 2
          process_header (value_field_p^.element_value^.field_values^ [6], report_entry_p,
                report_entry_p^.field_vector [index].start_column,
                report_entry_p^.field_vector [index].column_width,
                report_entry_p^.field_vector [index].summary, report_entry_p^.field_vector [index].field_p,
                report_entry_p^.header_2, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

        IFEND;

        value_field_p := value_field_p^.link;
        index := index + 1;
      WHILEND;
    ELSE

{ The next 3 lines execute only if the procedure was called from Change_Put command

      index := LOWERBOUND (field_vector_type);
      WHILE (index <= UPPERBOUND (field_vector_type)) AND (report_entry_p^.field_vector [index].summary <>
            null) DO
        FOR column_index := report_entry_p^.date_time_start_column TO column DO
          new_used_column := new_used_column + $report_column_set [column_index];
        FOREND;
        index := index + 1;
      WHILEND;
      IF (new_used_column * used_column) <> $report_column_set [] THEN
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$field_overlap, 'Row_Label', status);
        osp$append_status_integer (osc$status_parameter_delimiter, report_entry_p^.date_time_start_column, 10,
              FALSE, status);
      IFEND;
    IFEND;
    report_entry_p^.max_used_column := max_column;

  PROCEND process_field_position;

?? OLDTITLE ??
?? NEWTITLE := 'process_field_type', EJECT ??

{ PURPOSE:
{   The purpose of this request is to determine the type of the field from the add_field or change_field
{ subcommand.
{
{ DESIGN:
{   The procedure gets the field type set by the caller and checks all the type parameters (counter,
{ descriptive_data, header, elapsed_time, string (text) and elapsed_time_calculation).
{ If only one of the parameters was specified, the procedure returns the type of field.  If more than
{ one of the parameters was specified, the procedure returns a status error.  If none of these parameters
{ were specified, the procedure returns the undefined type.

  PROCEDURE process_field_type
    (    counter: clt$parameter_value;
         descriptive_data: clt$parameter_value;
         header: clt$parameter_value;
         elapsed_time: clt$parameter_value;
         string_parameter: clt$parameter_value;
         elapsed_time_calculation: clt$parameter_value;
         text: clt$parameter_value;
     VAR field_type: type_of_field;
     VAR status: ost$status);

    IF counter.specified THEN
      field_type := counter_field;
    IFEND;

    IF descriptive_data.specified THEN
      IF field_type = undefined_field THEN
        field_type := descriptive_data_field;
      ELSE
        osp$set_status_condition (pte$many_field_type_parameters, status);
        RETURN; {----->
      IFEND;
    IFEND;

    IF header.specified THEN
      IF field_type = undefined_field THEN
        IF header.value^.keyword_value = ptc$key_statistic_code THEN
          field_type := statistic_code_field;
        ELSEIF header.value^.keyword_value = ptc$key_date_time THEN
          field_type := date_time_field;
        ELSEIF header.value^.keyword_value = ptc$key_system_job_name THEN
          field_type := system_job_name_field;
        ELSEIF header.value^.keyword_value = ptc$key_global_task_id THEN
          field_type := global_task_id_field;
        ELSEIF header.value^.keyword_value = ptc$key_number_of_counters THEN
          field_type := number_of_counters_field;
        ELSE {= ptc$key_descriptive_data_length }
          field_type := descriptive_data_size_field;
        IFEND;
      ELSE
        osp$set_status_condition (pte$many_field_type_parameters, status);
        RETURN; {----->
      IFEND;
    IFEND;

    IF elapsed_time.specified THEN
      IF field_type = undefined_field THEN
        IF elapsed_time.value^.keyword_value = ptc$key_previous_occurrence THEN
          field_type := previous_occurrence_field;
        ELSEIF elapsed_time.value^.keyword_value = ptc$key_predecessor THEN
          field_type := predecessor_field;
        ELSE { = ptc$key_predecessor_chain_head }
          field_type := predecessor_chain_head_field;
        IFEND;
      ELSE
        osp$set_status_condition (pte$many_field_type_parameters, status);
        RETURN; {----->
      IFEND;
    IFEND;

    IF elapsed_time_calculation.specified THEN
      IF field_type = undefined_field THEN

{   Calculation field in elapsed_time_calculation parameter is optional in change_field subcommand.  If this
{ field was not specified, the procedure will return undefined field_type.

        IF elapsed_time_calculation.value^.field_values^ [1].value <> NIL THEN
          IF elapsed_time_calculation.value^.field_values^ [1].value^.keyword_value =
                ptc$key_value_per_second THEN
            field_type := value_per_second_field;
          ELSEIF elapsed_time_calculation.value^.field_values^ [1].value^.keyword_value =
                ptc$key_occurrence_per_second THEN
            field_type := occurrence_per_second_field;
          IFEND;
        IFEND;
      ELSE
        osp$set_status_condition (pte$many_field_type_parameters, status);
        RETURN; {----->
      IFEND;
    IFEND;

    IF string_parameter.specified THEN
      IF field_type = undefined_field THEN
        field_type := text_field;
      ELSE
        osp$set_status_condition (pte$many_field_type_parameters, status);
        RETURN; {----->
      IFEND;
    IFEND;

{ Start 1.4.1 compatibility code.

    IF text.specified THEN
      IF field_type = undefined_field THEN
        IF text.value^.kind = clc$record THEN
          field_type := descriptive_data_field;
        ELSE
          field_type := text_field;
        IFEND;
      ELSE
        osp$set_status_condition (pte$many_field_type_parameters, status);
        RETURN; {----->
      IFEND;
    IFEND;

{ End 1.4.1 compatibility code.

  PROCEND process_field_type;

?? OLDTITLE ??
?? NEWTITLE := 'process_global_task_id', EJECT ??

{ PURPOSE:
{   The purpose of this request is to translate a string that represents global_task_id to two integers
{ global_task_id index and global_task_id seqno.
{
{ NOTE:
{   The procedure expects to find a string in the follwing format 'mmmmm-nnn':
{     - mmmmm is the global_task_id index: an integer in the range 0..65535.
{     - nnn is the global_task_id seqno: an integer in the range 0..255.

  PROCEDURE process_global_task_id
    (    global_task_id: clt$data_value;
     VAR index_value: clt$integer;
     VAR seqno_value: clt$integer;
     VAR status: ost$status);

    VAR
      dash: [STATIC, READ] set of char := ['-'],
      dash_found: boolean,
      index: integer;

    #SCAN (dash, global_task_id.string_value^, index, dash_found);
    IF dash_found THEN
      clp$convert_string_to_integer (global_task_id.string_value^ (1, index - 1), index_value, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      IF (index_value.value < 0) OR (index_value.value > ptc$max_tasks) THEN
        osp$set_status_condition (pte$task_id_index_out_of_range, status);
        RETURN; {----->
      IFEND;
      clp$convert_string_to_integer (global_task_id.string_value^ (index + 1, * ), seqno_value, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      IF (seqno_value.value < 0) OR (seqno_value.value > 255) THEN
        osp$set_status_condition (pte$task_id_seqno_out_of_range, status);
        RETURN; {----->
      IFEND;
    ELSE
      osp$set_status_condition (pte$invalid_global_task_id, status);
      RETURN; {----->
    IFEND;

  PROCEND process_global_task_id;

?? OLDTITLE ??
?? NEWTITLE := 'process_header', EJECT ??

{ PURPOSE:
{   The purpose of this request is to construct the header string.
{
{ DESIGN
{   The procedure gets string (header) and the position (start_column and column_width) of the field in the
{ report line.  It checks if the string is longer than column width.  The string is placed in the report
{ entry header; right justified for counters and left justified for descriptive.
{
{ NOTE:
{  right justified
{  ---------------
{  count and count_per_second summary of all field types
{  counter_field
{  number_of_counters_field
{  descriptive_data_size_field
{  previous_occurrence_field
{  predecessor_field
{  predecessor_chain_head_field
{  value_per_second_field
{  occurrence_per_second_field
{
{  left justified
{  --------------
{  text_field
{  descriptive data_field (except count and count_per_second summary)
{  date_time_field (except count and count_per_second summary)
{  statistic_code_field (except count and count_per_second summary)
{  system_job_name_field (except count and count_per_second summary)
{  global_task_id_field (except count and count_per_second summary)

  PROCEDURE process_header
    (    header: clt$field_value;
         report_entry_p: ^put_entry;
         start_column: report_column;
         column_width: report_column;
         summary: summary_type;
         field_p: ^field;
     VAR report_header: string (ptc$max_page_width);
     VAR status: ost$status);

    VAR
      header_length: integer;

    status.normal := TRUE;

    IF header.value <> NIL THEN
      header_length := STRLENGTH (header.value^.string_value^);
      IF header_length <= column_width THEN
        IF (summary = count) OR (summary = count_per_second) THEN

{ The header is right justified in the field column.

          report_header (start_column + column_width - header_length, header_length) :=
                header.value^.string_value^;

        ELSE

          CASE field_p^.field_type OF
          = counter_field, number_of_counters_field, descriptive_data_size_field, previous_occurrence_field,
                predecessor_field, predecessor_chain_head_field, value_per_second_field,
                occurrence_per_second_field =

{ The header is right justified in the field column.

            report_header (start_column + column_width - header_length, header_length) :=
                  header.value^.string_value^;

          = descriptive_data_field, date_time_field, statistic_code_field, system_job_name_field,
                global_task_id_field, text_field =

{ The header is left justified in the field column.

            report_header (start_column, header_length) := header.value^.string_value^;

          CASEND;

        IFEND;
      ELSE
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$header_overflow, header.value^.string_value^,
              status);
        osp$append_status_integer (osc$status_parameter_delimiter, header_length, 10, FALSE, status);
        osp$append_status_integer (osc$status_parameter_delimiter, column_width, 10, FALSE, status);
        RETURN; {----->
      IFEND;
    IFEND;

  PROCEND process_header;

?? OLDTITLE ??
?? NEWTITLE := 'process_headers_putfs', EJECT ??

{ PURPOSE:
{   The purpose of this request is to construct the strings for field_summary report headers.
{
{ DESIGN
{   The procedure scans the report entry summary vector and for each summary the summary name is placed in
{ summary postion (start_column and column_width) right justified.

  PROCEDURE process_headers_putfs
    (    report_entry_p: ^put_entry);

    VAR
      index: integer;

    report_entry_p^.header_1 := '';
    report_entry_p^.header_2 := '';
    FOR index := LOWERBOUND (summary_vector_type) TO UPPERBOUND (summary_vector_type) DO

{ The code puts the column header justified to the right.  That way the code can compute the
{ first character position as start_column + column_width - the header string length.

      CASE report_entry_p^.summary_vector [index].summary OF

      = count =
        report_entry_p^.header_2 (report_entry_p^.summary_vector [index].start_column +
              report_entry_p^.summary_vector [index].column_width - 5, * ) := 'Count';

      = sum =
        report_entry_p^.header_2 (report_entry_p^.summary_vector [index].start_column +
              report_entry_p^.summary_vector [index].column_width - 3, * ) := 'Sum';

      = mean =
        report_entry_p^.header_2 (report_entry_p^.summary_vector [index].start_column +
              report_entry_p^.summary_vector [index].column_width - 4, * ) := 'Mean';

      = standard_deviation =
        report_entry_p^.header_1 (report_entry_p^.summary_vector [index].start_column +
              report_entry_p^.summary_vector [index].column_width - 8, * ) := 'Standard';
        report_entry_p^.header_2 (report_entry_p^.summary_vector [index].start_column +
              report_entry_p^.summary_vector [index].column_width - 9, * ) := 'Deviation';

      = minimum =
        report_entry_p^.header_2 (report_entry_p^.summary_vector [index].start_column +
              report_entry_p^.summary_vector [index].column_width - 7, * ) := 'Minimum';

      = maximum =
        report_entry_p^.header_2 (report_entry_p^.summary_vector [index].start_column +
              report_entry_p^.summary_vector [index].column_width - 7, * ) := 'Maximum';

      = interval =
        report_entry_p^.header_2 (report_entry_p^.summary_vector [index].start_column +
              report_entry_p^.summary_vector [index].column_width - 8, * ) := 'Interval';

      = count_per_second =
        report_entry_p^.header_1 (report_entry_p^.summary_vector [index].start_column +
              report_entry_p^.summary_vector [index].column_width - 5, * ) := 'Count';
        report_entry_p^.header_2 (report_entry_p^.summary_vector [index].start_column +
              report_entry_p^.summary_vector [index].column_width - 5, * ) := '/Sec';

      = sum_per_second =
        report_entry_p^.header_1 (report_entry_p^.summary_vector [index].start_column +
              report_entry_p^.summary_vector [index].column_width - 4, * ) := ' Sum';
        report_entry_p^.header_2 (report_entry_p^.summary_vector [index].start_column +
              report_entry_p^.summary_vector [index].column_width - 4, * ) := '/Sec';

      = elapsed_time_since_predecessor =
        report_entry_p^.header_1 (report_entry_p^.summary_vector [index].start_column +
              report_entry_p^.summary_vector [index].column_width - 7, * ) := 'Elapsed';
        report_entry_p^.header_2 (report_entry_p^.summary_vector [index].start_column +
              report_entry_p^.summary_vector [index].column_width - 7, * ) := ' Time';

      ELSE
      CASEND;
    FOREND;

  PROCEND process_headers_putfs;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] process_incremental_selection', EJECT ??

{ PURPOSE
{   The purpose of this request is to recognize when the day has changed.
{     It is only called when a selection has an incremental counter.
{

  PROCEDURE [INLINE] process_incremental_selection
    (    statistic_header_p: ^sft$statistic_header;
         selection_p { input, output } : ^selection;
         counters_p: sft$counters;
     VAR status: ost$status);

    VAR
      field_p: ^field,
      local_status: ost$status,
      interval: pmt$time_increment;

    status.normal := TRUE;
    local_status.normal := TRUE;

    IF (selection_p^.incremental_counter_p^.counter_number <= statistic_header_p^.number_of_counters) AND
          (selection_p^.incremental_counter_p^.field_summary.count > 0) THEN

{ First statistic in a new day window.  The counters are new base for incremental values,
{ the time interval between the last statistic and the new base are calculated and kept for interval,
{ sum_per_interval and count_per_interval summary.

      IF (selection_p^.date_time_specified AND NOT selection_p^.continuous_date_time AND
            NOT date_time_1_gt_date_time_2 (selection_p^.new_day_date_time, statistic_header_p^.date_time))
            THEN

        pmp$compute_date_time_increment (selection_p^.incremental_counter_p^.field_summary.last_date_time,
              statistic_header_p^.date_time, interval, local_status);
        IF NOT local_status.normal THEN
          RETURN; {----->
        IFEND;
        selection_p^.lost_interval := selection_p^.lost_interval + interval_to_millisecond (interval);

        field_p := selection_p^.field_chain_p;
        WHILE field_p <> NIL DO
          field_p^.field_summary.last_date_time := statistic_header_p^.date_time;
          IF field_p^.field_type = counter_field THEN
            field_p^.last_value := counters_p^ [field_p^.counter_number];
          IFEND;
          field_p := field_p^.field_chain_link_p;
        WHILEND;
        IF selection_p^.collect_date_time THEN
          IF NOT selection_p^.skip_date_time THEN
            IF selection_p^.skip_date_time_tail_p <> NIL THEN
              NEXT selection_p^.skip_date_time_tail_p^.link_p IN ptv$data_segment_p.sequence_pointer;
              selection_p^.skip_date_time_tail_p := selection_p^.skip_date_time_tail_p^.link_p;
            ELSE
              NEXT selection_p^.skip_date_time_head_p^.link_p IN ptv$data_segment_p.sequence_pointer;
              selection_p^.skip_date_time_tail_p := selection_p^.skip_date_time_head_p;
            IFEND;
            selection_p^.skip_date_time_tail_p^.link_p := NIL;
            selection_p^.skip_date_time := TRUE;
          IFEND;
          selection_p^.skip_date_time_tail_p^.skip_date_time := statistic_header_p^.date_time;
        IFEND;

        IF selection_p^.date_time_specified AND NOT selection_p^.continuous_date_time AND
              NOT date_time_1_gt_date_time_2 (selection_p^.new_day_date_time, statistic_header_p^.date_time)
              THEN

{ First statistic in a new day window.  The next new day date time is calculated.

          pmp$compute_date_time (selection_p^.new_day_date_time, ptv$one_day, selection_p^.new_day_date_time,
                local_status);
          IF NOT local_status.normal THEN
            RETURN; {----->
          IFEND;

        IFEND;

{  Return abnormal status so collect_field will terminate
        status.normal := FALSE;
        RETURN; {----->
      IFEND;
    ELSEIF (selection_p^.incremental_counter_p^.field_summary.count = 0) AND
          selection_p^.date_time_specified AND NOT selection_p^.continuous_date_time THEN

{ The first selected statistic (base statistic) set the current day. The time is taken from the selection
{ criteria and the day from the first statistic header.  Then the next new_day_date_time for the next new
{ base statistic incremented by one day.

      selection_p^.new_day_date_time := selection_p^.start_date_time;
      selection_p^.new_day_date_time.year := statistic_header_p^.date_time.year;
      selection_p^.new_day_date_time.month := statistic_header_p^.date_time.month;
      selection_p^.new_day_date_time.day := statistic_header_p^.date_time.day;
      pmp$compute_date_time (selection_p^.new_day_date_time, ptv$one_day, selection_p^.new_day_date_time,
            local_status);
      IF NOT local_status.normal THEN
        RETURN; {----->
      IFEND;
    IFEND;

  PROCEND process_incremental_selection;

?? OLDTITLE ??
?? NEWTITLE := 'process_input_parameter', EJECT ??

{ PURPOSE:
{   The purpose of this request is to open the input log(s) for the display_logged_statistics, generate_log
{ and generate_report (& use_log) commands.
{
{ DESIGN
{   The procedure:
{    1) Gets the new input files list.
{    2) Checks for duplicate file names in the list.
{    3) Compares the old list to the new list.
{    4) Closes files from the old list that are not in the new list and
{       FREEs the records that are allocated for input_log, logged_statistic & statistic_location.
{    5) Opens files from the new list that are not in the old list.
{
{ NOTE:
{   Analyze_Binary_Log tries to keep information about input log(s) (e.g. the logged statistic in each log).
{ The information is kept all the time that the file is open.  That way the files are not closed when the
{ subcommand that opens them is completed.  When a new list of files is given, the procedure tries to save the
{ information about the files that are already opened in the list of new files.

  PROCEDURE process_input_parameter
    (VAR value: ^clt$data_value;
     VAR status: ost$status);

    VAR
      errors_detected: boolean,
      failing_status: ost$status,
      input_log_chain_tail: ^log_file,
      input_log_1_p: ^log_file,
      input_log_2_p: ^log_file,
      input_log_3_p: ^log_file,
      new_files: boolean,
      new_input_log_chain_head: ^log_file;

?? NEWTITLE := 'free_input_file', EJECT ??

{ PURPOSE:
{   The purpose of this request is to FREE the records that are allocated for input_log, logged_statistic and
{ statistic_location, when the file is closed.

    PROCEDURE free_input_file
      (VAR input_log_p: ^log_file);

      PROCEDURE free_statistics_list
        (VAR logged_statistic_p: ^logged_statistic);

        PROCEDURE free_statistic_location
          (VAR statistic_location_p: ^statistic_location);

          IF statistic_location_p^.statistic_location_chain_link_p <> NIL THEN
            free_statistic_location (statistic_location_p^.statistic_location_chain_link_p);
          IFEND;
          FREE statistic_location_p;

        PROCEND free_statistic_location;

        IF logged_statistic_p^.link_p <> NIL THEN
          free_statistics_list (logged_statistic_p^.link_p);
        IFEND;
        IF logged_statistic_p^.statistic_location_p <> NIL THEN
          free_statistic_location (logged_statistic_p^.statistic_location_p);
        IFEND;
        FREE logged_statistic_p;

      PROCEND free_statistics_list;

      IF input_log_p^.statistics_list_p <> NIL THEN
        free_statistics_list (input_log_p^.statistics_list_p);
      IFEND;

    PROCEND free_input_file;

?? OLDTITLE ??
?? NEWTITLE := 'free_logged_statistic', EJECT ??

{ PURPOSE:
{   The purpose of this request is to FREE the records that are allocated for logged_statistic.

    PROCEDURE free_logged_statistic;

      VAR
        logged_statistic_1_p: ^logged_statistic,
        logged_statistic_2_p: ^logged_statistic;

      logged_statistic_1_p := ptv$logged_statistic_chain_head;
      WHILE logged_statistic_1_p <> NIL DO
        logged_statistic_2_p := logged_statistic_1_p^.link_p;
        FREE logged_statistic_1_p;
        logged_statistic_1_p := logged_statistic_2_p;
      WHILEND;

    PROCEND free_logged_statistic;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

{ Get the new input files list.

    ALLOCATE new_input_log_chain_head: [#SIZE (value^.element_value^.file_value^)];
    input_log_chain_tail := new_input_log_chain_head;
    input_log_chain_tail^.log_file_name := value^.element_value^.file_value^;
    input_log_chain_tail^.open := FALSE;
    input_log_chain_tail^.statistics_list_p := NIL;
    value := value^.link;
    WHILE value <> NIL DO
      ALLOCATE input_log_chain_tail^.log_chain_link_p: [#SIZE (value^.element_value^.file_value^)];
      input_log_chain_tail := input_log_chain_tail^.log_chain_link_p;
      input_log_chain_tail^.log_file_name := value^.element_value^.file_value^;
      input_log_chain_tail^.access_level := amc$segment;
      input_log_chain_tail^.open := FALSE;
      input_log_chain_tail^.statistics_list_p := NIL;
      value := value^.link;
    WHILEND;
    input_log_chain_tail^.log_chain_link_p := NIL;

{ Compare old list to new list.

    input_log_1_p := ptv$input_log_chain_head_p;
    WHILE input_log_1_p <> NIL DO
      input_log_1_p^.open := FALSE;
      input_log_2_p := new_input_log_chain_head;
      WHILE input_log_2_p <> NIL DO
        IF input_log_1_p^.log_file_name = input_log_2_p^.log_file_name THEN

{ COPY

          input_log_2_p^.active_log := input_log_1_p^.active_log;
          input_log_2_p^.log_file_identifier := input_log_1_p^.log_file_identifier;
          input_log_2_p^.file_identifier := input_log_1_p^.file_identifier;
          input_log_2_p^.segment_pointer := input_log_1_p^.segment_pointer;
          input_log_2_p^.access_level := input_log_1_p^.access_level;
          input_log_2_p^.start_time := input_log_1_p^.start_time;
          input_log_2_p^.end_time := input_log_1_p^.end_time;
          input_log_2_p^.statistics_list_p := input_log_1_p^.statistics_list_p;
          input_log_2_p^.open := TRUE;
          input_log_1_p^.open := TRUE;
          input_log_1_p^.statistics_list_p := NIL;
          input_log_2_p := NIL;
        ELSE
          input_log_2_p := input_log_2_p^.log_chain_link_p;
        IFEND;
      WHILEND;
      input_log_1_p := input_log_1_p^.log_chain_link_p;
    WHILEND;

{ Close files from the old list that are not in the new list.

    input_log_1_p := ptv$input_log_chain_head_p;
    WHILE input_log_1_p <> NIL DO
      input_log_2_p := input_log_1_p^.log_chain_link_p;
      IF NOT input_log_1_p^.open THEN
        lgp$close_log_file (input_log_1_p^.log_file_identifier, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        IF ptv$logged_statistic_chain_head <> NIL THEN
          free_logged_statistic;
          ptv$logged_statistic_chain_head := NIL;
        IFEND;
      IFEND;
      free_input_file (input_log_1_p);
      FREE input_log_1_p;
      input_log_1_p := input_log_2_p;
    WHILEND;

{ Open files from the new list that are not in the old list.

    new_files := FALSE;
    ptv$input_log_chain_head_p := new_input_log_chain_head;
    input_log_1_p := ptv$input_log_chain_head_p;
    input_log_2_p := NIL;
    WHILE input_log_1_p <> NIL DO
      IF NOT input_log_1_p^.open THEN
        open_log_file (input_log_1_p, FALSE, status);
        IF NOT status.normal THEN
          WHILE input_log_1_p <> NIL DO
            IF NOT input_log_1_p^.open THEN
              input_log_3_p := input_log_1_p^.log_chain_link_p;
              FREE input_log_1_p;
              IF input_log_2_p <> NIL THEN
                input_log_2_p^.log_chain_link_p := input_log_3_p;
              ELSE
                ptv$input_log_chain_head_p := input_log_3_p;
              IFEND;
            ELSE
              input_log_2_p := input_log_1_p;
            IFEND;
            input_log_1_p := input_log_3_p;
          WHILEND;
          RETURN; {----->
        IFEND;
        new_files := TRUE;
      ELSE
        IF input_log_1_p^.access_level = amc$record THEN
          IF ptv$logged_statistic_chain_head <> NIL THEN
            free_logged_statistic;
            ptv$logged_statistic_chain_head := NIL;
          IFEND;
          free_input_file (input_log_1_p);
        IFEND;
      IFEND;
      input_log_2_p := input_log_1_p;
      input_log_1_p := input_log_1_p^.log_chain_link_p;
    WHILEND;

    IF (ptv$logged_statistic_chain_head <> NIL) AND new_files THEN
      free_logged_statistic;
      ptv$logged_statistic_chain_head := NIL;
    IFEND;

    IF new_files THEN
      ptv$active_log := FALSE;
      input_log_1_p := ptv$input_log_chain_head_p;
      WHILE input_log_1_p <> NIL DO
        ptv$active_log := (input_log_1_p^.access_level = amc$record) OR ptv$active_log;
        input_log_1_p := input_log_1_p^.log_chain_link_p;
      WHILEND;
    IFEND;

  PROCEND process_input_parameter;

?? OLDTITLE ??
?? NEWTITLE := 'process_number_parameter', EJECT ??

{ PURPOSE:
{   The purpose of this request is to position the new put entry (or changed put entry) in the list of put
{ entries, based on the number parameter for the put_field_summary, put_field, put_interval_field, put_record
{ and change_put subcommands.

  PROCEDURE process_number_parameter
    (    number: clt$data_value;
         temp_put_entry: ^put_entry;
     VAR put_entry_chain_head: ^put_entry);

    VAR
      position: integer,
      put_entry_p: ^put_entry;


    IF put_entry_chain_head <> NIL THEN
      IF number.kind = clc$integer THEN
        IF number.integer_value.value > 1 THEN
          position := 1;
          put_entry_p := put_entry_chain_head;
          WHILE (put_entry_p^.put_chain_link_p <> NIL) AND (position < number.integer_value.value - 1) DO
            put_entry_p := put_entry_p^.put_chain_link_p;
            position := position + 1;
          WHILEND;
          temp_put_entry^.put_chain_link_p := put_entry_p^.put_chain_link_p;
          put_entry_p^.put_chain_link_p := temp_put_entry;
        ELSE { number = 1 }
          temp_put_entry^.put_chain_link_p := put_entry_chain_head;
          put_entry_chain_head := temp_put_entry;
        IFEND;
      ELSE { last or next }
        put_entry_p := put_entry_chain_head;
        WHILE put_entry_p^.put_chain_link_p <> NIL DO
          put_entry_p := put_entry_p^.put_chain_link_p;
        WHILEND;
        put_entry_p^.put_chain_link_p := temp_put_entry;
      IFEND;
    ELSE
      put_entry_chain_head := temp_put_entry;
    IFEND;

  PROCEND process_number_parameter;

?? OLDTITLE ??
?? NEWTITLE := 'process_position', EJECT ??

{ PURPOSE:
{   The purpose of this request is to set the column position for a field in put_field and put_interval_field
{ or summary_calculation in put_field_summary.
{
{ DESIGN
{   The procedure receives the start_column, column_width, summary of the field and last used column.  If the
{ start_column was omitted from the subcommand parameter then the start_column will be set to create 1 column
{ space between the current field and last field (new start_column <-- last used column + 2).  The calling
{ procedure sets the last used column to -1 for the first field in order to set the default start_column to 1.
{ If the column_width was omitted from the subcommand parameter then the column_width will be set to:
{   -  6 for count summary
{   - 15 for sum, mean, standard_deviation, minimum, maximum, count_per_second and sum_per_second
{   - 12 for interval and elapsed_time_since_predecessor
{   - 31 for descriptive data and text
{ Last used column set and checked for line length overflow.

  PROCEDURE process_position
    (    start_column: clt$field_value;
         column_width: clt$field_value;
         summary: summary_type;
         field_type: type_of_field;
         field_name: string ( * <= osc$max_name_size);
     VAR column { input, output } : integer;
     VAR used_column { input, output } : report_column_set;
     VAR report_start_column: report_column;
     VAR report_column_width: report_column;
     VAR status: ost$status);

    VAR
      column_index: report_column,
      field_name_string: string (6 + osc$max_name_size),
      new_used_column: report_column_set;

    status.normal := TRUE;

    IF start_column.value <> NIL THEN
      report_start_column := start_column.value^.integer_value.value;
    ELSE
      report_start_column := column + 2;
    IFEND;

    IF column_width.value <> NIL THEN
      report_column_width := column_width.value^.integer_value.value;
    ELSE

{ Default column width for summary.

      CASE summary OF

      = count =
        report_column_width := 6; { Count range of 0..99999 }

      = sum, mean, standard_deviation, minimum, maximum, count_per_second, sum_per_second =
        report_column_width := 15;

      = interval, elapsed_time_since_predecessor =
        report_column_width := 12; { Time in the form H24:MM:SS.S1000 }

      = text =
        report_column_width := osc$max_name_size;

      = first_occurrence, last_occurrence, all_occurrences =
        CASE field_type OF
        = counter_field, value_per_second_field, occurrence_per_second_field =
          report_column_width := 15;

        = number_of_counters_field, descriptive_data_size_field =
          report_column_width := 4;

        = date_time_field, previous_occurrence_field, predecessor_field, predecessor_chain_head_field =
          report_column_width := 12;

        = statistic_code_field =
          report_column_width := 7;

        = system_job_name_field =
          report_column_width := 19;

        = global_task_id_field =
          report_column_width := 9;

        = descriptive_data_field, text_field =
          report_column_width := 31;

        ELSE
        CASEND;

      ELSE
      CASEND;
    IFEND;

    column := report_start_column + report_column_width - 1;
    IF column > ptc$max_page_width THEN
      osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$field_out_of_line_limits, 'Field', status);
      osp$append_status_integer (osc$status_parameter_delimiter, report_start_column, 10, FALSE, status);
      osp$append_status_integer (osc$status_parameter_delimiter, report_column_width, 10, FALSE, status);
      RETURN; {----->
    IFEND;

    new_used_column := $report_column_set [];
    FOR column_index := report_start_column TO column DO
      new_used_column := new_used_column + $report_column_set [column_index];
    FOREND;
    IF (new_used_column * used_column) <> $report_column_set [] THEN
      field_name_string (1, * ) := 'Field';
      field_name_string (7, * ) := field_name;
      osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$field_overlap, field_name_string, status);
      osp$append_status_integer (osc$status_parameter_delimiter, report_start_column, 10, FALSE, status);
      RETURN; {----->
    IFEND;
    used_column := used_column + new_used_column;

  PROCEND process_position;

?? OLDTITLE ??
?? NEWTITLE := 'process_put_parameter', EJECT ??

{ PURPOSE:
{   The purpose of this request is to process the put parameter for the put_field_summary, put_field,
{ put_interval_field, put_record and change_put subcommands.  The procedure returns an error message if the
{ put parameter is the name of defined put entry.

  PROCEDURE process_put_parameter
    (    put: clt$data_value;
         put_entry_chain_head_p: ^put_entry;
     VAR name: ost$name;
     VAR status: ost$status);

    VAR
      put_entry_p: ^put_entry;

    name := put.name_value;
    put_entry_p := put_entry_chain_head_p;
    WHILE (put_entry_p <> NIL) AND (put_entry_p^.name <> name) DO
      put_entry_p := put_entry_p^.put_chain_link_p;
    WHILEND;
    IF put_entry_p <> NIL THEN
      osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$redefined_put, name, status);
      RETURN; {----->
    IFEND;

  PROCEND process_put_parameter;

?? OLDTITLE ??
?? NEWTITLE := 'process_selection_parameter', EJECT ??

{ PURPOSE:
{   The purpose of this request is to process the selection parameter for the put_record & change_put
{ commands.  The procedure constructs the selection list for the log entry (list of pointers to selection).

  PROCEDURE process_selection_parameter
    (VAR value_p: ^clt$data_value;
         temp_log_entry: ^put_entry);

    VAR
      selection_list_p: ^selection_list,
      selection_p: ^selection;


    ALLOCATE temp_log_entry^.selection_p;
    selection_list_p := temp_log_entry^.selection_p;
    selection_p := ptv$selection_chain_head_p;
    WHILE (selection_p <> NIL) AND (selection_p^.name <> value_p^.element_value^.name_value) DO
      selection_p := selection_p^.selection_chain_link_p;
    WHILEND;
    selection_p^.log_entry_p := temp_log_entry;
    selection_list_p^.selection_p := selection_p;
    value_p := value_p^.link;
    WHILE value_p <> NIL DO
      ALLOCATE selection_list_p^.link_p;
      selection_list_p := selection_list_p^.link_p;
      selection_p := ptv$selection_chain_head_p;
      WHILE (selection_p <> NIL) AND (selection_p^.name <> value_p^.element_value^.name_value) DO
        selection_p := selection_p^.selection_chain_link_p;
      WHILEND;
      selection_p^.log_entry_p := temp_log_entry;
      selection_list_p^.selection_p := selection_p;
      value_p := value_p^.link;
    WHILEND;
    selection_list_p^.link_p := NIL;

  PROCEND process_selection_parameter;

?? OLDTITLE ??
?? NEWTITLE := 'process_string', EJECT ??

{ PURPOSE:
{   The purpose of this request is to process the string parameter for the put_string, push_page_header,
{ and change_put commands.
{
{ DESIGN
{   The procedure receives a list of strings, start_column and column_width from the string parameter.  If
{ start_column was omitted from the subcommand parameter then the start_column will be set to create 1 column
{ space between the current field and last field (new start_column <-- last used column + 2).  The last used
{ column set to -1 for the first field in order to set the default start_column to 1.  If the column_width was
{ omitted from the on the subcommand parameter then the
{ column_width will be set to string length.

  PROCEDURE process_string
    (    string_parameter: clt$parameter_value;
         report_entry_p: ^put_entry;
     VAR status: ost$status);

    VAR
      column: integer,
      column_index: report_column,
      column_width: report_column,
      max_column: 0..clc$max_integer,
      new_used_column: report_column_set,
      start_column: report_column,
      string_length: integer,
      used_column: report_column_set,
      value_string_p: ^clt$data_value;

    status.normal := TRUE;

    max_column := 0;
    used_column := $report_column_set [];
    column := -1;
    report_entry_p^.header_1 := '';
    value_string_p := string_parameter.value;
    WHILE value_string_p <> NIL DO

      string_length := STRLENGTH (value_string_p^.element_value^.field_values^ [1].value^.string_value^);

      IF value_string_p^.element_value^.field_values^ [2].value <> NIL THEN
        start_column := value_string_p^.element_value^.field_values^ [2].value^.integer_value.value;
      ELSE
        start_column := column + 2;
      IFEND;

      IF value_string_p^.element_value^.field_values^ [3].value <> NIL THEN
        column_width := value_string_p^.element_value^.field_values^ [3].value^.integer_value.value;
      ELSE
        column_width := string_length;
      IFEND;

      IF string_length <= column_width THEN
        report_entry_p^.header_1 (start_column + column_width - string_length,
              string_length) := value_string_p^.element_value^.field_values^ [1].value^.string_value^;
      ELSE
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$string_overflow,
              value_string_p^.element_value^.field_values^ [1].value^.string_value^, status);
        osp$append_status_integer (osc$status_parameter_delimiter, string_length, 10, FALSE, status);
        osp$append_status_integer (osc$status_parameter_delimiter, column_width, 10, FALSE, status);
        RETURN; {----->
      IFEND;

      column := start_column + column_width - 1;
      IF column > ptc$max_page_width THEN
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$field_out_of_line_limits, 'String', status);
        osp$append_status_integer (osc$status_parameter_delimiter, start_column, 10, FALSE, status);
        osp$append_status_integer (osc$status_parameter_delimiter, column_width, 10, FALSE, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
      IFEND;
      IF column > max_column THEN
        max_column := column;
      IFEND;

      new_used_column := $report_column_set [];
      FOR column_index := start_column TO column DO
        new_used_column := new_used_column + $report_column_set [column_index];
      FOREND;
      IF (new_used_column * used_column) <> $report_column_set [] THEN
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$field_overlap, 'String', status);
        osp$append_status_integer (osc$status_parameter_delimiter, start_column, 10, FALSE, status);
        RETURN; {----->
      IFEND;

      value_string_p := value_string_p^.link;
    WHILEND;
    report_entry_p^.max_used_column := max_column;

  PROCEND process_string;

?? OLDTITLE ??
?? NEWTITLE := 'process_subfield', EJECT ??

{ PURPOSE:
{   The purpose of this request is to process a descriptive data subfield from descriptive_data parameter for
{ process_descriptive_selection procedure.
{
{ DESIGN
{   The procedure builds a list of pointers to descriptive_data strings and fills the subfield_position,
{ subfield_length, subfield_number and subfield_delimiter.

  PROCEDURE process_subfield
    (    subfield_value: ^clt$data_value;
     VAR subfield_p: ^descriptive_data_subfield);

    VAR
      string_p: ^descriptive_data_string,
      string_value: ^clt$data_value;

{ Get the list of strings.

    string_value := subfield_value^.element_value^.field_values^ [1].value;
    ALLOCATE subfield_p^.descriptive_data_string_p: [#SIZE (string_value^.element_value^.string_value^)];
    string_p := subfield_p^.descriptive_data_string_p;
    string_p^.descriptive_text := string_value^.element_value^.string_value^;
    string_value := string_value^.link;
    WHILE string_value <> NIL DO
      ALLOCATE string_p^.descriptive_string_link_p: [#SIZE (string_value^.element_value^.string_value^)];
      string_p := string_p^.descriptive_string_link_p;
      string_p^.descriptive_text := string_value^.element_value^.string_value^;
      string_value := string_value^.link;
    WHILEND;
    string_p^.descriptive_string_link_p := NIL;

    IF subfield_value^.element_value^.field_values^ [2].value <> NIL THEN
      subfield_p^.subfield_position := subfield_value^.element_value^.field_values^ [2].value^.integer_value.
            value;
    IFEND;

    IF subfield_value^.element_value^.field_values^ [3].value <> NIL THEN
      IF subfield_value^.element_value^.field_values^ [3].value^.kind <> clc$keyword THEN
        subfield_p^.subfield_length := subfield_value^.element_value^.field_values^ [3].value^.integer_value.
              value;
      IFEND;
    IFEND;

    IF subfield_value^.element_value^.field_values^ [4].value <> NIL THEN
      IF subfield_value^.element_value^.field_values^ [4].value^.kind <> clc$keyword THEN
        subfield_p^.subfield_number := subfield_value^.element_value^.field_values^ [4].value^.integer_value.
              value;
      IFEND;
    IFEND;

    IF subfield_value^.element_value^.field_values^ [5].value <> NIL THEN
      subfield_p^.subfield_delimiter := subfield_value^.element_value^.field_values^ [5].value^.
            string_value^ (1);
    IFEND;

  PROCEND process_subfield;

?? OLDTITLE ??
?? NEWTITLE := 'process_summary', EJECT ??

{ PURPOSE:
{   The purpose of this request is to translate the summary keyword from string to summary_type.

  PROCEDURE process_summary
    (    summary_key: ost$name;
     VAR summary: summary_type);

    IF summary_key = ptc$key_first_occurrence THEN
      summary := first_occurrence;
    ELSEIF summary_key = ptc$key_last_occurrence THEN
      summary := last_occurrence;
    ELSEIF summary_key = ptc$key_count THEN
      summary := count;
    ELSEIF summary_key = ptc$key_sum THEN
      summary := sum;
    ELSEIF summary_key = ptc$key_mean THEN
      summary := mean;
    ELSEIF summary_key = ptc$key_standard_deviation THEN
      summary := standard_deviation;
    ELSEIF summary_key = ptc$key_minimum THEN
      summary := minimum;
    ELSEIF summary_key = ptc$key_maximum THEN
      summary := maximum;
    ELSEIF summary_key = ptc$key_interval THEN
      summary := interval;
    ELSEIF summary_key = ptc$key_count_per_second THEN
      summary := count_per_second;
    ELSEIF summary_key = ptc$key_sum_per_second THEN
      summary := sum_per_second;
    ELSE { summary_key = 'ELAPSED_TIME_SINCE_PREDECESSOR' }
      summary := elapsed_time_since_predecessor;
    IFEND;

  PROCEND process_summary;

?? OLDTITLE ??
?? NEWTITLE := 'process_summary_calculation', EJECT ??

{ PURPOSE:
{   The purpose of this request is to process the summary_calculation (summary and position_description) and
{ row_label parameters for the put_field_summary and change_put subcommands.
{
{ DESIGN
{   The procedure sets the summary_calculation (summary, start_column and column_width) in the report entry
{ summary vector and the row_label position.  The summary_calculation default is SUM.
{   If the procedure is called from the Change_Put subcommand, then the row_label and summary_calculation
{ parameters are optional and the procedure gets the missing position (row_label position or
{ summary_calculation position from the report entry.

  PROCEDURE process_summary_calculation
    (    summary_calculation: clt$parameter_value;
         row_label_format: clt$parameter_value;
         report_entry_p: ^put_entry;
     VAR status: ost$status);

    VAR
      column: integer,
      column_index: report_column,
      errors_detected: boolean,
      failing_status: ost$status,
      index: integer,
      initial_summary_vector: [STATIC, READ] summary_vector_type :=
            [REP ptc$summary_vector_size of [null, * , * ]],
      max_column: 0..clc$max_integer,
      used_column: report_column_set,
      value_position_p: ^clt$data_value,
      value_summary_p: ^clt$data_value;


    status.normal := TRUE;
    max_column := 0;

    IF row_label_format.value <> NIL THEN
      report_entry_p^.row_label_start_column := row_label_format.value^.field_values^ [1].value^.
            integer_value.value;
      report_entry_p^.row_label_column_width := row_label_format.value^.field_values^ [2].value^.
            integer_value.value;
    IFEND;

    column := report_entry_p^.row_label_start_column + report_entry_p^.row_label_column_width - 1;
    IF column > ptc$max_page_width THEN
      osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$field_out_of_line_limits, 'Row_Label', status);
      osp$append_status_integer (osc$status_parameter_delimiter, report_entry_p^.row_label_start_column, 10,
            FALSE, status);
      osp$append_status_integer (osc$status_parameter_delimiter, report_entry_p^.row_label_column_width, 10,
            FALSE, status);
      RETURN; {----->
    IFEND;
    IF column > max_column THEN
      max_column := column;
    IFEND;

    used_column := $report_column_set [];
    FOR column_index := report_entry_p^.row_label_start_column TO column DO
      used_column := used_column + $report_column_set [column_index];
    FOREND;

    IF summary_calculation.value <> NIL THEN
      report_entry_p^.summary_vector := initial_summary_vector;
      value_summary_p := summary_calculation.value;
      index := 1;
      WHILE value_summary_p <> NIL DO
        process_summary (value_summary_p^.element_value^.field_values^ [1].value^.keyword_value,
              report_entry_p^.summary_vector [index].summary);
        process_position (value_summary_p^.element_value^.field_values^ [2],
              value_summary_p^.element_value^.field_values^ [3],
              report_entry_p^.summary_vector [index].summary, counter_field, ' ', column, used_column,
              report_entry_p^.summary_vector [index].start_column,
              report_entry_p^.summary_vector [index].column_width, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        IF column > max_column THEN
          max_column := column;
        IFEND;
        value_summary_p := value_summary_p^.link;
        index := index + 1;
      WHILEND;
    ELSE

{ The next 3 lines execute only if the procedure was called from Change_Put command

      IF column >= report_entry_p^.summary_vector [1].start_column - 1 THEN
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$field_overlap, 'Row_Label', status);
        osp$append_status_integer (osc$status_parameter_delimiter, report_entry_p^.row_label_start_column, 10,
              FALSE, status);
      IFEND;
    IFEND;
    report_entry_p^.max_used_column := max_column;

  PROCEND process_summary_calculation;

?? OLDTITLE ??
?? NEWTITLE := 'process_time_selection', EJECT ??

{ PURPOSE:
{   The purpose of this request is to process the time selection parameters for the add_selection and
{ change_selection subcommands.
{
{ DESIGN
{ This procedure adds the missing date or time to the start_date_time and end_date_time:
{   - start_date_time: 1900-01-01   as date
{                      00:00:00.000 as time
{   - end_date_time:   2155-12-31   as date
{                      23:59:59.999 as time
{
{  If start_date_time >= end_date_time the procedure returns an error mesage.

  PROCEDURE process_time_selection
    (    time: clt$parameter_value;
     VAR start_date_time: clt$date_time;
     VAR end_date_time: clt$date_time;
     VAR status: ost$status);

    status.normal := TRUE;

    start_date_time := time.value^.low_value^.date_time_value;
    end_date_time := time.value^.high_value^.date_time_value;
    IF NOT start_date_time.date_specified THEN
      start_date_time.value.year := 0; { 1900 }
      start_date_time.value.month := 1;
      start_date_time.value.day := 1;
    IFEND;
    IF NOT start_date_time.time_specified THEN
      start_date_time.value.hour := 0;
      start_date_time.value.minute := 0;
      start_date_time.value.second := 0;
      start_date_time.value.millisecond := 0;
    IFEND;
    IF NOT end_date_time.date_specified THEN
      end_date_time.value.year := 255; { 2155 }
      end_date_time.value.month := 12;
      end_date_time.value.day := 31;
    IFEND;
    IF NOT end_date_time.time_specified THEN
      end_date_time.value.hour := 23;
      end_date_time.value.minute := 59;
      end_date_time.value.second := 59;
      end_date_time.value.millisecond := 999;
    IFEND;

    IF NOT date_time_1_gt_date_time_2 (end_date_time.value, start_date_time.value) THEN
      osp$set_status_condition (pte$date_time_range_order, status);
      RETURN; {----->
    IFEND;

  PROCEND process_time_selection;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] put_statistic_record', EJECT ??

{ PURPOSE:
{  The purpose of this request is to "write" a statistic record to a binary log file.
{
{ DESIGN:
{  The procedure gets 3 pointers:
{    -  pointer to the statistic header.
{    -  pointer to the counters array.
{    -  pointer to the descriptive data string.
{  The procedure performs those steps to write the statistic:
{    1) Use NEXT to allocate the record header and fill the record header with header type, record length,
{       previous header file byte address and unique ID.
{    2) Use NEXT to allocate statistic header and copy the statistic header to output file.
{    3) IF number_of_counters > 0 THEN use NEXT to allocate counter array and copy the counters to output
{       file.
{    4) IF descriptive_data_size > 0 THEN use NEXT to allocate descriptive_data and copy the descriptive_data
{       to output file.
{    5) set the ptv$end_of_segment to end of the segment.

  PROCEDURE [INLINE] put_statistic_record
    (    output_log_p: ^log_file;
         statistic_header_p: ^sft$statistic_header;
         counters_p: sft$counters;
         descriptive_data_p: ^sft$descriptive_data;
     VAR status: ost$status);

    VAR
      counters_out_p: sft$counters,
      descriptive_data_out_p: ^sft$descriptive_data,
      log_header_out_p: ^bat$record_header,
      statistic_header_out_p: ^sft$statistic_header;

    status.normal := TRUE;

    NEXT log_header_out_p IN output_log_p^.segment_pointer.sequence_pointer;
    IF log_header_out_p = NIL THEN
      osp$set_status_condition (pte$unexpected_end_of_file, status);
      osp$append_status_file (osc$status_parameter_delimiter, output_log_p^.log_file_name, status);
      RETURN; {----->
    IFEND;
    log_header_out_p^.header_type := bac$full_record;
    log_header_out_p^.length := ptv$statistic_header_size + statistic_header_p^.number_of_counters *
          #SIZE (sft$counter) + statistic_header_p^.descriptive_data_size;
    log_header_out_p^.previous_header_fba := ptv$previous_header_fba;
    log_header_out_p^.unique_id := bac$record_header_unique_id;
    ptv$previous_header_fba := #OFFSET (log_header_out_p);

    NEXT statistic_header_out_p IN output_log_p^.segment_pointer.sequence_pointer;
    IF statistic_header_p = NIL THEN
      osp$set_status_condition (pte$unexpected_end_of_file, status);
      osp$append_status_file (osc$status_parameter_delimiter, output_log_p^.log_file_name, status);
      RETURN; {----->
    IFEND;
    statistic_header_out_p^ := statistic_header_p^;

    IF statistic_header_p^.number_of_counters > 0 THEN
      NEXT counters_out_p: [1 .. statistic_header_p^.number_of_counters] IN
            output_log_p^.segment_pointer.sequence_pointer;
      IF counters_out_p = NIL THEN
        osp$set_status_condition (pte$unexpected_end_of_file, status);
        osp$append_status_file (osc$status_parameter_delimiter, output_log_p^.log_file_name, status);
        RETURN; {----->
      IFEND;
      counters_out_p^ := counters_p^;
    IFEND;

    IF statistic_header_p^.descriptive_data_size > 0 THEN
      NEXT descriptive_data_out_p: [statistic_header_p^.descriptive_data_size] IN
            output_log_p^.segment_pointer.sequence_pointer;
      IF descriptive_data_out_p = NIL THEN
        osp$set_status_condition (pte$unexpected_end_of_file, status);
        osp$append_status_file (osc$status_parameter_delimiter, output_log_p^.log_file_name, status);
        RETURN; {----->
      IFEND;
      descriptive_data_out_p^ := descriptive_data_p^;
    IFEND;
    ptv$end_of_segment := output_log_p^.segment_pointer;

  PROCEND put_statistic_record;

?? OLDTITLE ??
?? NEWTITLE := 'put_statistic_in_scratch_seg', EJECT ??

{ PURPOSE:
{   The purpose of this request is to "write" a shadowed predecessor statistic record from active log to
{ temporary binary log file.
{
{ DESIGN:
{  The procedure gets 3 pointers:
{    -  pointer to the statistic header.
{    -  pointer to the counters array.
{    -  pointer to the descriptive data string.
{  The procedure performs the following steps to write the statistic:
{    1) Use NEXT to allocate record header and fill the record header with header type, record length,
{       previous header file byte address and unique ID.
{    2) Use NEXT to allocate statistic header and copy the statistic header to output file.
{    3) IF number_of_counters > 0 THEN use NEXT to allocate counter array and copy the counters to output
{       file.
{    4) IF descriptive_data_size > 0 THEN use NEXT to allocate descriptive_data and copy the descriptive_data
{       to output file.
{
{  The procedure returns 3 pointers:
{    -  pointer to the statistic header in the temporary log.
{    -  pointer to the counters array in the temporary log.
{    -  pointer to the descriptive data string in the temporary log.

  PROCEDURE put_statistic_in_scratch_seg
    (    statistic_header_p: ^sft$statistic_header;
         counters_p: sft$counters;
         descriptive_data_p: ^sft$descriptive_data;
     VAR statistic_header_out_p: ^sft$statistic_header;
     VAR counters_out_p: sft$counters;
     VAR descriptive_data_out_p: ^sft$descriptive_data;
     VAR status: ost$status);

    VAR
      log_header_out_p: ^bat$record_header;

    status.normal := TRUE;

    NEXT log_header_out_p IN ptv$predecessor_log_p.sequence_pointer;
    IF log_header_out_p = NIL THEN
      osp$set_status_condition (pte$scratch_segment_error, status);
      RETURN; {----->
    IFEND;
    log_header_out_p^.header_type := bac$full_record;
    log_header_out_p^.length := ptv$statistic_header_size + statistic_header_p^.number_of_counters *
          #SIZE (sft$counter) + statistic_header_p^.descriptive_data_size;
    log_header_out_p^.previous_header_fba := ptv$previous_header_fba;
    log_header_out_p^.unique_id := bac$record_header_unique_id;
    ptv$previous_header_fba := #OFFSET (log_header_out_p);

    NEXT statistic_header_out_p IN ptv$predecessor_log_p.sequence_pointer;
    IF statistic_header_p = NIL THEN
      osp$set_status_condition (pte$scratch_segment_error, status);
      RETURN; {----->
    IFEND;
    statistic_header_out_p^ := statistic_header_p^;

    IF statistic_header_p^.number_of_counters > 0 THEN
      NEXT counters_out_p: [1 .. statistic_header_p^.number_of_counters] IN
            ptv$predecessor_log_p.sequence_pointer;
      IF counters_out_p = NIL THEN
        osp$set_status_condition (pte$scratch_segment_error, status);
        RETURN; {----->
      IFEND;
      counters_out_p^ := counters_p^;
    ELSE
      counters_out_p := NIL;
    IFEND;

    IF statistic_header_p^.descriptive_data_size > 0 THEN
      NEXT descriptive_data_out_p: [statistic_header_p^.descriptive_data_size] IN
            ptv$predecessor_log_p.sequence_pointer;
      IF descriptive_data_out_p = NIL THEN
        osp$set_status_condition (pte$scratch_segment_error, status);
        RETURN; {----->
      IFEND;
      descriptive_data_out_p^ := descriptive_data_p^;
    ELSE
      descriptive_data_out_p := NIL;
    IFEND;

  PROCEND put_statistic_in_scratch_seg;

?? OLDTITLE ??
?? NEWTITLE := 'report_duplicate_name', EJECT ??

{ PURPOSE:
{ The purpose of this request is to check for and report duplicate names or file names in the parameter list.

  PROCEDURE report_duplicate_name
    (    value: ^clt$data_value;
         parameter: string ( * <= osc$max_name_size);
     VAR status: ost$status);

    VAR
      errors_detected: boolean,
      failing_status: ost$status,
      value_1_p: ^clt$data_value,
      value_2_p: ^clt$data_value;

    status.normal := TRUE;

{ Check for duplicate name in the list.

    errors_detected := FALSE;
    value_1_p := value;
    WHILE value_1_p <> NIL DO
      value_2_p := value_1_p^.link;
      WHILE value_2_p <> NIL DO
        CASE value_1_p^.element_value^.kind OF

        = clc$name =
          IF value_1_p^.element_value^.name_value = value_2_p^.element_value^.name_value THEN
            osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$duplicate_name,
                  value_1_p^.element_value^.name_value, failing_status);
            report_intermediate_error (failing_status, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            errors_detected := TRUE;
          IFEND;

        = clc$file =
          IF value_1_p^.element_value^.file_value^ = value_2_p^.element_value^.file_value^ THEN
            osp$set_status_condition (pte$duplicate_file_name, failing_status);
            osp$append_status_file (osc$status_parameter_delimiter, value_1_p^.element_value^.file_value^,
                  failing_status);
            report_intermediate_error (failing_status, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            errors_detected := TRUE;
          IFEND;
        ELSE
        CASEND;
        value_2_p := value_2_p^.link;
      WHILEND;
      value_1_p := value_1_p^.link;
    WHILEND;

    IF errors_detected THEN
      osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$error_processing_parameter, parameter, status);
    IFEND;

  PROCEND report_duplicate_name;

?? OLDTITLE ??
?? NEWTITLE := 'report_duplicate_number', EJECT ??

{ PURPOSE:
{   The purpose of this request is to check for and report duplicate numbers in the parameter list.
{
{ DESIGN:
{   The procedure receives a pointer to a list of range of numbers, puts the numbers in a set and checks if
{ any number was given more than once.
{
{ NOTE:
{ - Set of integer is limited to numbers in the range 0..32767.
{ - The set is allocated in the subcommand procedure in order to save an allocation when the the number
{   parameter is checked more than once.

  PROCEDURE report_duplicate_number
    (    value: ^clt$data_value;
         parameter: string ( * <= osc$max_name_size);
     VAR numbers: ^numbers_set;
     VAR status: ost$status);

    VAR
      errors_detected: boolean,
      failing_status: ost$status,
      index: integer,
      index_string: ost$string,
      value_p: ^clt$data_value;

    status.normal := TRUE;

{ Check for duplicate number in the list.

    errors_detected := FALSE;
    numbers^ := $numbers_set [];
    value_p := value;
    WHILE value_p <> NIL DO
      IF value_p^.element_value^.low_value^.integer_value.value <=
            value_p^.element_value^.high_value^.integer_value.value THEN
        FOR index := value_p^.element_value^.low_value^.integer_value.value TO value_p^.element_value^.
              high_value^.integer_value.value DO
          IF NOT (index IN numbers^) THEN
            numbers^ := numbers^ +$numbers_set [index];
          ELSE
            clp$convert_integer_to_string (index, 10, FALSE, index_string, status);
            osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$duplicate_numbers, index_string.
                  value (1, index_string.size), failing_status);
            report_intermediate_error (failing_status, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            errors_detected := TRUE;
          IFEND;
        FOREND;
      ELSE
        STRINGREP (ptv$output_line, ptv$output_line_length,
              value_p^.element_value^.low_value^.integer_value.value, ' ..',
              value_p^.element_value^.high_value^.integer_value.value);
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$low_greater_than_high,
              ptv$output_line (1, ptv$output_line_length), failing_status);
        report_intermediate_error (failing_status, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        errors_detected := TRUE;
      IFEND;

      value_p := value_p^.link;
    WHILEND;

    IF errors_detected THEN
      osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$error_processing_parameter, parameter, status);
    IFEND;

  PROCEND report_duplicate_number;

?? OLDTITLE ??
?? NEWTITLE := 'report_fields_and_put', EJECT ??

{ PURPOSE:
{   The purpose of this request is to check and report selection(s) with field(s) and/or put(s) for
{ delete_selection subcommand.
{
{ DESIGN:
{   The value parameter is a pointer to the selection names list or the keyword ALL.  The procedure checks the
{ selection(s) in the list (or all the selections).  If a selection has field(s) and/or put entries the
{ procedure reports an intermediate error job_command_response file and continues to check the next selection.
{ The procedure returns a status error if an intermediate error was reported.
{
{ NOTE:
{   Analyze_Binary_Log can't delete a selection with field(s) and/or put entries.  The user must delete or
{ change the field(s) and/or put entries before deleting the selection.

  PROCEDURE report_fields_and_put
    (    value: ^clt$data_value;
     VAR status: ost$status);

    VAR
      errors_detected: boolean,
      selection_p: ^selection,
      value_p: ^clt$data_value;

    status.normal := TRUE;

    errors_detected := FALSE;
    value_p := value;
    IF value_p^.kind = clc$keyword THEN

{ Only keyword is 'ALL'
      selection_p := ptv$selection_chain_head_p;
      WHILE selection_p <> NIL DO
        check_fields_and_put_pointers (selection_p, errors_detected, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        selection_p := selection_p^.selection_chain_link_p;
      WHILEND;
    ELSE

{ LIST

      WHILE value_p <> NIL DO
        selection_p := ptv$selection_chain_head_p;
        WHILE (selection_p <> NIL) AND (selection_p^.name <> value_p^.element_value^.name_value) DO
          selection_p := selection_p^.selection_chain_link_p;
        WHILEND;
        IF selection_p <> NIL THEN
          check_fields_and_put_pointers (selection_p, errors_detected, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        IFEND;
        value_p := value_p^.link;
      WHILEND;
    IFEND;

    IF errors_detected THEN
      osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$error_processing_parameter, 'SELECTION',
            status);
    IFEND;

  PROCEND report_fields_and_put;

?? OLDTITLE ??
?? NEWTITLE := 'report_intermediate_error', EJECT ??

{ PURPOSE:
{   The purpose of this request is to report an intermediate error which has occurred during some process.
{
{ DESIGN:
{   The procedure gets a status record describing some intermediate error as a parameter and writes the error
{ text to the job_command_response file.

  PROCEDURE report_intermediate_error
    (    failing_status: ost$status;
     VAR status: ost$status);

    VAR
      access_selections: [STATIC, READ] array [1 .. 2] of fst$attachment_option :=
            [[fsc$access_and_share_modes, [fsc$specific_access_modes, [fsc$shorten, fsc$append]],
            [fsc$required_share_modes]], [fsc$access_and_share_modes,
            [fsc$specific_access_modes, [fsc$append]], [fsc$required_share_modes]]],
      byte_address: amt$file_byte_address,
      errors_file_id: amt$file_identifier,
      length_pointer: ^ost$status_message_line_size,
      line_count_pointer: ^ost$status_message_line_count,
      line_index: ost$status_message_line_count,
      message: ost$status_message,
      message_sequence: ^ost$status_message,
      text_pointer: ^ost$status_message_line;

    status.normal := TRUE;

    fsp$open_file (clc$job_command_response, amc$record, {attachment options=} ^access_selections,
          {Default_creation=} NIL, {Mandated_creation=} NIL, {Attirbute_validation=} NIL,
          {Attribute_override=} NIL, errors_file_id, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    osp$format_message (failing_status, osc$full_message_level, osc$max_status_message_line, message, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    message_sequence := ^message;
    RESET message_sequence;
    NEXT line_count_pointer IN message_sequence;

    FOR line_index := 1 TO line_count_pointer^ DO
      NEXT length_pointer IN message_sequence;
      NEXT text_pointer: [length_pointer^] IN message_sequence;
      amp$put_next (errors_file_id, text_pointer, length_pointer^, byte_address, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    FOREND;

    fsp$close_file (errors_file_id, status);

    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

  PROCEND report_intermediate_error;

?? OLDTITLE ??
?? NEWTITLE := 'report_put', EJECT ??

{ PURPOSE:
{   The purpose of this request is to check and report field(s) with put entries for delete_field subcommand.
{
{ DESIGN:
{   The value parameter is a pointer to the field names list or the keyword ALL.  The procedure checks the
{ field(s) in the list (or all the fields), if a field has a put entry the procedure reports an intermediate
{ error to job_command_response file and continues to check the next field.  The procedure returns a status
{ error if an intermediate error was reported.
{
{ NOTE:
{    Analyze_Binary_Log can't delete a field with a put entry.  The user must delete or change the put entries
{  before deleting the field.

  PROCEDURE report_put
    (    value: ^clt$data_value;
     VAR status: ost$status);

    VAR
      errors_detected: boolean,
      failing_status: ost$status,
      field_p: ^field,
      selection_p: ^selection,
      value_p: ^clt$data_value;


    status.normal := TRUE;

    errors_detected := FALSE;
    value_p := value;
    IF value_p^.kind = clc$keyword THEN

{ Only keyword is 'ALL'

      selection_p := ptv$selection_chain_head_p;
      WHILE selection_p <> NIL DO

        field_p := selection_p^.field_chain_p;
        WHILE field_p <> NIL DO
          IF field_p^.report_list_p <> NIL THEN
            osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$field_has_put, field_p^.field_name,
                  failing_status);
            report_intermediate_error (failing_status, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            errors_detected := TRUE;
          IFEND;
          field_p := field_p^.field_chain_link_p;
        WHILEND;

        selection_p := selection_p^.selection_chain_link_p;
      WHILEND;
    ELSE

{ LIST

      WHILE value_p <> NIL DO
        selection_p := ptv$selection_chain_head_p;

      /find_field/
        WHILE selection_p <> NIL DO

          field_p := selection_p^.field_chain_p;
          WHILE (field_p <> NIL) AND (field_p^.field_name <> value_p^.element_value^.name_value) DO
            field_p := field_p^.field_chain_link_p;
          WHILEND;

          IF field_p <> NIL THEN
            IF field_p^.report_list_p <> NIL THEN
              osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$field_has_put, field_p^.field_name,
                    failing_status);
              report_intermediate_error (failing_status, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;
              errors_detected := TRUE;
            IFEND;
            EXIT /find_field/; {----->
          IFEND;

          selection_p := selection_p^.selection_chain_link_p;
        WHILEND /find_field/;

        value_p := value_p^.link;
      WHILEND;
    IFEND;

    IF errors_detected THEN
      osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$error_processing_parameter, 'FIELD', status);
    IFEND;

  PROCEND report_put;

?? OLDTITLE ??
?? NEWTITLE := 'report_undefined_counters', EJECT ??

{ PURPOSE:
{    The purpose of this request is to check and report undefined counter names in the parameter list for
{  put_field_summary and change_put (field_summary entry type) subcommands.
{
{ DESIGN:
{   The value parameter is a pointer to the field names list.  The procedure checks for each name in the list
{ for a defined counter with that name.  If the counter is undefined the procedure reports an intermediate
{ error to job_command_response file and continues to check the next field name.  The procedure returns a
{ status error if an intermediate error was reported.

  PROCEDURE report_undefined_counters
    (    value: ^clt$data_value;
     VAR status: ost$status);

    VAR
      errors_detected: boolean,
      failing_status: ost$status,
      field_name: ost$name,
      field_p: ^field,
      selection_p: ^selection,
      value_p: ^clt$data_value;

    status.normal := TRUE;

    errors_detected := FALSE;
    value_p := value;
    WHILE value_p <> NIL DO

      field_p := NIL;
      selection_p := ptv$selection_chain_head_p;
      WHILE (selection_p <> NIL) AND (field_p = NIL) DO
        field_p := selection_p^.field_chain_p;
        WHILE (field_p <> NIL) AND (field_p^.field_name <> value_p^.element_value^.field_values^ [1].value^.
              name_value) DO
          field_p := field_p^.field_chain_link_p;
        WHILEND;
        selection_p := selection_p^.selection_chain_link_p;
      WHILEND;

      IF (field_p = NIL) OR (field_p^.field_type <> counter_field) THEN
        IF field_p = NIL THEN
          osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$undefined_field_for_put,
                value_p^.element_value^.field_values^ [1].value^.name_value, failing_status);
        ELSE { field_^.field_type <> counter_field }
          osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$field_is_not_a_counter,
                value_p^.element_value^.field_values^ [1].value^.name_value, failing_status);
        IFEND;
        report_intermediate_error (failing_status, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        errors_detected := TRUE;
      IFEND;

      value_p := value_p^.link;
    WHILEND;

    IF errors_detected THEN
      osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$error_processing_parameter, 'FIELD', status);
    IFEND;

  PROCEND report_undefined_counters;

?? OLDTITLE ??
?? NEWTITLE := 'report_undefined_fields', EJECT ??

{ PURPOSE:
{    The purpose of this request is to check for and report undefined field names in the parameter list for
{  put_field,put_interval_field and change_put (field and interval_field entries type) subcommands.
{
{ DESIGN:
{   The value parameter is a pointer to the field names list.  The procedure checks each name in the list
{ to find a defined field (counter, descriptive_data or statistic_header) with that name.  If the field is
{ undefined the procedure reports an intermediate error to job_command_response file and continues to check
{ the next field name.  The procedure returns a status error if an intermediate error is reported.

  PROCEDURE report_undefined_fields
    (    value: ^clt$data_value;
     VAR status: ost$status);

    VAR
      errors_detected: boolean,
      failing_status: ost$status,
      field_name: ost$name,
      field_p: ^field,
      selection_p: ^selection,
      value_p: ^clt$data_value;

    status.normal := TRUE;

    errors_detected := FALSE;
    field_p := NIL;
    value_p := value;
    WHILE value_p <> NIL DO

      selection_p := ptv$selection_chain_head_p;

    /find_field/
      WHILE selection_p <> NIL DO

        field_p := selection_p^.field_chain_p;
        WHILE (field_p <> NIL) AND (field_p^.field_name <> value_p^.element_value^.field_values^ [1].value^.
              name_value) DO
          field_p := field_p^.field_chain_link_p;
        WHILEND;

        IF field_p <> NIL THEN
          EXIT /find_field/; {----->
        IFEND;

        selection_p := selection_p^.selection_chain_link_p;
      WHILEND /find_field/;

      IF field_p = NIL THEN
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$undefined_field_for_put,
              value_p^.element_value^.field_values^ [1].value^.name_value, failing_status);
        report_intermediate_error (failing_status, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        errors_detected := TRUE;
      IFEND;

      value_p := value_p^.link;
    WHILEND;

    IF errors_detected THEN
      osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$error_processing_parameter, 'FIELD', status);
    IFEND;

  PROCEND report_undefined_fields;

?? OLDTITLE ??
?? NEWTITLE := 'report_undefined_selections', EJECT ??

{ PURPOSE:
{    The purpose of this request is to check and report undefined selection names in the parameter list for
{  put_record and change_put (record entry type) subcommands.
{
{ DESIGN:
{   The value parameter is a pointer to the selection names list.  The procedure checks each name in the
{ list for a defined selection with that name.  If the selection is undefined the procedure reports an
{ intermediate error to job_command_response file and continues to check the next selection name.  The
{ procedure returns a status error if an intermediate error is reported.

  PROCEDURE report_undefined_selections
    (    value: ^clt$data_value;
         log_entry_p: ^put_entry;
     VAR status: ost$status);

    VAR
      errors_detected: boolean,
      failing_status: ost$status,
      selection_p: ^selection,
      value_p: ^clt$data_value;

    status.normal := TRUE;

    errors_detected := FALSE;
    value_p := value;
    WHILE value_p <> NIL DO
      selection_p := ptv$selection_chain_head_p;
      WHILE (selection_p <> NIL) AND (selection_p^.name <> value_p^.element_value^.name_value) DO
        selection_p := selection_p^.selection_chain_link_p;
      WHILEND;
      IF selection_p = NIL THEN
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$undefined_selec_for_put,
              value_p^.element_value^.name_value, failing_status);
        report_intermediate_error (failing_status, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        errors_detected := TRUE;
      ELSEIF (selection_p^.log_entry_p <> NIL) AND (selection_p^.log_entry_p <> log_entry_p) THEN
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$selec_ref_by_another_put,
              value_p^.element_value^.name_value, failing_status);
        report_intermediate_error (failing_status, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        errors_detected := TRUE;
      IFEND;
      value_p := value_p^.link;
    WHILEND;

    IF errors_detected THEN
      osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$error_processing_parameter, 'SELECTION',
            status);
    IFEND;

  PROCEND report_undefined_selections;

?? OLDTITLE ??
?? NEWTITLE := 'reset_data_collection', EJECT ??

{ PURPOSE:
{   The purpose of this request is to reset the data collection before scanning the log(s) and collecting new
{ data.
{
{ DESIGN:
{   The procedure:
{     Frees:
{       - Successor lists.
{       - Date_time values.
{       - Predecessor date_time values.
{       - Field values.
{     Resets:
{       - Date_time collection.
{       - Predecessor date_time collection.
{       - Marking selections for shadow_fields.
{     Deletes:
{       - Shadow fields.

  PROCEDURE reset_data_collection;

    VAR
      field_p: ^field,
      index: integer,
      report_entry_p: ^put_entry,
      report_list_p: ^report_list,
      selection_p: ^selection;

    RESET ptv$data_segment_p.sequence_pointer;

    selection_p := ptv$selection_chain_head_p;
    WHILE selection_p <> NIL DO

      selection_p^.successor_list_head_p := NIL;
      selection_p^.date_time_value_head_p := NIL;
      selection_p^.date_time_value_tail_p := NIL;
      selection_p^.predecessor_dt_value_head_p := NIL;
      selection_p^.predecessor_dt_value_tail_p := NIL;
      selection_p^.shadow_field_chain_p := NIL;
      selection_p^.collect_date_time := FALSE;
      selection_p^.collect_predecessor_date_time := FALSE;
      selection_p^.shadow_fields := FALSE;

      field_p := selection_p^.field_chain_p;
      WHILE field_p <> NIL DO

        free_field_value (field_p);

        report_list_p := field_p^.report_list_p;
        WHILE report_list_p <> NIL DO
          report_list_p^.shadow := FALSE;
          report_list_p := report_list_p^.link_p;
        WHILEND;

        field_p := field_p^.field_chain_link_p;
      WHILEND;

      selection_p := selection_p^.selection_chain_link_p;
    WHILEND;

    report_entry_p := ptv$report_entry_chain_head_p;
    WHILE report_entry_p <> NIL DO
      IF report_entry_p^.put = put_field THEN
        FOR index := LOWERBOUND (field_vector_type) TO UPPERBOUND (field_vector_type) DO
          report_entry_p^.field_vector [index].shadow_field := FALSE;
          report_entry_p^.field_vector [index].shadow_field_p := NIL;
        FOREND;
      IFEND;
      report_entry_p := report_entry_p^.put_chain_link_p;
    WHILEND;

  PROCEND reset_data_collection;

?? OLDTITLE ??
?? NEWTITLE := 'scan_log_disls', EJECT ??

{ PURPOSE:
{  The purpose of this request is to scan the log for the display_logged_statistics subcommand.
{
{ DESIGN:
{   The procedure resets the segment log (rewinds the file for active log). It receives statistic records from
{ the log and generates a list of unique statistic codes in the log.  The procedure keeps the number of
{ occurrences of each statistic code, the time of first and last occurrences of each statistic code.
{
{ NOTE:
{   Display_logged_statistics scans an active log at every DISLS, but only needs to actually scan non_active
{   logs on the first DISLS.

  PROCEDURE scan_log_disls
    (    input_log_p: ^log_file;
     VAR status: ost$status);

    VAR
      counters_p: sft$counters,
      descriptive_data_p: ^sft$descriptive_data,
      logged_statistic_p: ^logged_statistic,
      p_logged_statistic_tail: ^logged_statistic,
      statistic_header_p: ^sft$statistic_header,
      statistic_location_p: ^statistic_location;

    status.normal := TRUE;

    lgp$rewind_log_file (input_log_p^.log_file_identifier, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    lgp$get_next_statistic (input_log_p^.log_file_identifier, ^ptv$statistic_record_buffer,
          statistic_header_p, counters_p, descriptive_data_p, status);
    IF NOT status.normal THEN
      status.normal := status.condition = lge$end_of_log;
      RETURN; {----->
    IFEND;

    WHILE statistic_header_p <> NIL DO
      logged_statistic_p := input_log_p^.statistics_list_p;
      WHILE (logged_statistic_p <> NIL) AND (statistic_header_p^.statistic_code <>
            logged_statistic_p^.statistic_code) DO
        p_logged_statistic_tail := logged_statistic_p;
        logged_statistic_p := logged_statistic_p^.link_p;
      WHILEND;
      IF logged_statistic_p = NIL THEN { New statistic code. }
        IF input_log_p^.statistics_list_p = NIL THEN { First statistic code. }
          ALLOCATE input_log_p^.statistics_list_p;
          logged_statistic_p := input_log_p^.statistics_list_p;
        ELSE
          logged_statistic_p := p_logged_statistic_tail;
          ALLOCATE logged_statistic_p^.link_p;
          logged_statistic_p := logged_statistic_p^.link_p;
        IFEND;
        logged_statistic_p^.statistic_code := statistic_header_p^.statistic_code;
        logged_statistic_p^.link_p := NIL;
        logged_statistic_p^.number_of_occurrences := 0;
        logged_statistic_p^.time_of_first_occurrences := statistic_header_p^.date_time;
        logged_statistic_p^.statistic_location_p := NIL;

      IFEND;
      logged_statistic_p^.number_of_occurrences := logged_statistic_p^.number_of_occurrences + 1;
      logged_statistic_p^.time_of_last_occurrences := statistic_header_p^.date_time;

      lgp$get_next_statistic (input_log_p^.log_file_identifier, ^ptv$statistic_record_buffer,
            statistic_header_p, counters_p, descriptive_data_p, status);
      IF NOT status.normal THEN
        status.normal := status.condition = lge$end_of_log;
        RETURN; {----->
      IFEND;
    WHILEND;

  PROCEND scan_log_disls;

?? OLDTITLE ??
?? NEWTITLE := 'scan_log_genl', EJECT ??

{ PURPOSE:
{  The purpose of this request is to scan the log for the generate_log subcommand.
{
{ DESIGN:
{   The procedure resets the segment log (rewinds the file for active log).  It receives statistic records
{ from the log and for every selection the procedure checks if the statistic record is selected.  If the
{ statistic is selected, the procedure calls add_statistic_to_successor_list.  If the selection has a log
{ entry and the statistic was not written to the output log by previous selection the procedure calls
{ write_statistic.
{
{ NOTE:
{   - The procedure write_statistic is write_statistic_to_Binary_log, write_statistic_to_list_log or
{     write_statistic_to_legible_log  depending on the type of output log (Binary/List/Legible).
{   - A selection can be selected by more than one selection but only the first selection that matches the
{     statistic and has a log entry will write the statistic into the output log.  The rest of the selections
{     may be for successor list.

  PROCEDURE scan_log_genl
    (    input_log_p: ^log_file;
         write_statistic: write_statistic_p;
     VAR status: ost$status);

    VAR
      print: boolean,
      counters_p: sft$counters,
      descriptive_data_p: ^sft$descriptive_data,
      predecessor_p: ^successor,
      statistic_header_p: ^sft$statistic_header,
      selection_p: ^selection;

    status.normal := TRUE;

    lgp$rewind_log_file (input_log_p^.log_file_identifier, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    lgp$get_next_statistic (input_log_p^.log_file_identifier, ^ptv$statistic_record_buffer,
          statistic_header_p, counters_p, descriptive_data_p, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    WHILE statistic_header_p <> NIL DO
      print := TRUE;
      selection_p := ptv$selection_chain_head_p;
      WHILE selection_p <> NIL DO
        IF select_statistic (selection_p, statistic_header_p, counters_p, descriptive_data_p, predecessor_p)
              THEN
          add_statistic_to_successor_list (selection_p, statistic_header_p, counters_p, descriptive_data_p,
                predecessor_p);
          IF print AND (selection_p^.log_entry_p <> NIL) THEN
            write_statistic^ (selection_p^.log_entry_p, statistic_header_p, counters_p, descriptive_data_p,
                  status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            print := FALSE;
          IFEND;
        IFEND;
        selection_p := selection_p^.selection_chain_link_p;
      WHILEND;
      lgp$get_next_statistic (input_log_p^.log_file_identifier, ^ptv$statistic_record_buffer,
            statistic_header_p, counters_p, descriptive_data_p, status);
      IF NOT status.normal THEN
        IF status.condition = lge$end_of_log THEN
          status.normal := TRUE;
        IFEND;
        RETURN; {----->
      IFEND;
    WHILEND;

  PROCEND scan_log_genl;

?? OLDTITLE ??
?? NEWTITLE := 'scan_log_genr', EJECT ??

{ PURPOSE:
{  The purpose of this request is to scan the log for the generate_report subcommand.
{
{ DESIGN:
{   The procedure resets the segment log (rewinds the file for active log). It receives statistic records from
{ the log and for each SELECTION the procedure checks if the statistic record matches the selection criteria.
{ If the statistic is selected the procedure calls add_statistic_to_successor_list and collect_field.
{
{ NOTE:
{   - A selection can be selected by more than one selection.

  PROCEDURE scan_log_genr
    (    input_log_p: ^log_file;
     VAR status: ost$status);

    VAR
      counters_p: sft$counters,
      descriptive_data_p: ^sft$descriptive_data,
      new_counters_p: sft$counters,
      new_descriptive_data_p: ^sft$descriptive_data,
      new_statistic_header_p: ^sft$statistic_header,
      predecessor_p: ^successor,
      selection_p: ^selection,
      statistic_header_p: ^sft$statistic_header,
      statistic_saved: boolean;

    status.normal := TRUE;

    lgp$rewind_log_file (input_log_p^.log_file_identifier, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    lgp$get_next_statistic (input_log_p^.log_file_identifier, ^ptv$statistic_record_buffer,
          statistic_header_p, counters_p, descriptive_data_p, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    WHILE statistic_header_p <> NIL DO
      statistic_saved := FALSE;
      selection_p := ptv$selection_chain_head_p;
      WHILE selection_p <> NIL DO
        IF select_statistic (selection_p, statistic_header_p, counters_p, descriptive_data_p, predecessor_p)
              THEN

          IF selection_p^.shadow_fields AND (input_log_p^.access_level = amc$record) AND
                NOT statistic_saved THEN
            put_statistic_in_scratch_seg (statistic_header_p, counters_p,
                  descriptive_data_p, new_statistic_header_p, new_counters_p, new_descriptive_data_p, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            statistic_saved := TRUE;
          IFEND;

          IF selection_p^.shadow_fields AND statistic_saved THEN
            add_statistic_to_successor_list (selection_p, new_statistic_header_p, new_counters_p,
                  new_descriptive_data_p, predecessor_p);
          ELSE
            add_statistic_to_successor_list (selection_p, statistic_header_p, counters_p, descriptive_data_p,
                  predecessor_p);
          IFEND;

          collect_field (selection_p, statistic_header_p, counters_p, descriptive_data_p, predecessor_p,
                status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

        IFEND;
        selection_p := selection_p^.selection_chain_link_p;
      WHILEND;
      lgp$get_next_statistic (input_log_p^.log_file_identifier, ^ptv$statistic_record_buffer,
            statistic_header_p, counters_p, descriptive_data_p, status);
      IF NOT status.normal THEN
        IF status.condition = lge$end_of_log THEN
          status.normal := TRUE;
        IFEND;
        RETURN; {----->
      IFEND;
    WHILEND;

  PROCEND scan_log_genr;

?? OLDTITLE ??
?? NEWTITLE := '[UNSAFE, INLINE] select_statistic', EJECT ??

{ PURPOSE:
{   The purpose of this request is to attempt to select a statistic by matching selection criteria in a
{ selection record with the statistic's attributes.
{
{ DESIGN:
{   The function checks if a selection criteria is specified and if it matches the corresponding statistic
{ attribute.  The function checks the statistic code, data_time , system job name, global task ID, job
{ predecessor, task predecessor and descriptive data.  The function checks the criteria until all the
{ specified criteria are satisfied or until one criterion is not satisfied.  If all criteria are satisfied,
{ the statistic is selected.  If one of the specified selection criteria is not satisfied, the statistic is
{ not selected.

  FUNCTION [UNSAFE, INLINE] select_statistic
    (    selection_p: ^selection;
         statistic_header_p: ^sft$statistic_header;
         counters_p: sft$counters;
         descriptive_data_p: ^sft$descriptive_data;
     VAR predecessor_p: ^successor): boolean;

    VAR
      date_time_c: ^cell,
      date_time_s_1: ^string (ptc$date_time_record_size),
      date_time_s_2: ^string (ptc$date_time_record_size),
      date_time_s_3: ^string (ptc$date_time_record_size),
      descriptive_data_length: integer,
      descriptive_data_start: integer,
      dt: integer,
      null_subfield: boolean,
      string_p: ^descriptive_data_string,
      subfield_p: ^descriptive_data_subfield,
      substring_found: boolean,
      successor_p: ^successor;

    select_statistic := selection_p^.inverted_selection;
    predecessor_p := NIL;

{ check statistic_code

    IF selection_p^.statistic_specified AND (statistic_header_p^.statistic_code <>
          selection_p^.statistic_code) THEN
      RETURN; {----->
    IFEND;

{ check date_time

    IF selection_p^.date_time_specified THEN

{ Compare Date_Time mapped to string, because the comparison operators (>, <, >= & <=) cannot compare
{ date_time records. The alternative is to compare the fields individually.

      date_time_c := ^statistic_header_p^.date_time;
      date_time_s_1 := date_time_c;
      date_time_c := ^selection_p^.start_date_time;
      date_time_s_2 := date_time_c;
      date_time_c := ^selection_p^.end_date_time;
      date_time_s_3 := date_time_c;
      IF (date_time_s_1^ <= date_time_s_2^) OR (date_time_s_1^ >= date_time_s_3^) THEN
        RETURN; {----->
      IFEND;
      IF NOT selection_p^.continuous_date_time THEN
        dt := statistic_header_p^.date_time.hour * 3600000 + statistic_header_p^.date_time.minute *
              60000 + statistic_header_p^.date_time.second * 1000 + statistic_header_p^.date_time.millisecond;
        IF (dt <= (selection_p^.start_date_time.hour * 3600000 + selection_p^.start_date_time.minute *
              60000 + selection_p^.start_date_time.second * 1000 +
              selection_p^.start_date_time.millisecond)) OR (dt >=
              (selection_p^.end_date_time.hour * 3600000 + selection_p^.end_date_time.minute *
              60000 + selection_p^.end_date_time.second * 1000 + selection_p^.end_date_time.millisecond)) THEN

          RETURN; {----->
        IFEND;
      IFEND;
    IFEND;

{ check Descriptive data

    IF selection_p^.descriptive_specified THEN

      subfield_p := selection_p^.descriptive_subfield_p;
      WHILE subfield_p <> NIL DO
        IF descriptive_data_p <> NIL THEN
          get_descriptive_data_subfield (descriptive_data_p, statistic_header_p^.descriptive_data_size,
                subfield_p^.subfield_position, subfield_p^.subfield_length, subfield_p^.subfield_number,
                subfield_p^.subfield_delimiter, null_subfield, substring_found, descriptive_data_start,
                descriptive_data_length);
        ELSE
          null_subfield := TRUE;
        IFEND;

        IF null_subfield THEN
          string_p := subfield_p^.descriptive_data_string_p;
          WHILE (string_p <> NIL) AND (string_p^.descriptive_text <> '') DO
            string_p := string_p^.descriptive_string_link_p;
          WHILEND;
          IF string_p = NIL THEN
            RETURN; {----->
          IFEND;
        ELSEIF substring_found THEN
          string_p := subfield_p^.descriptive_data_string_p;
          WHILE (string_p <> NIL) AND (descriptive_data_p^ (descriptive_data_start,
                descriptive_data_length) <> string_p^.descriptive_text) DO
            string_p := string_p^.descriptive_string_link_p;
          WHILEND;
          IF string_p = NIL THEN
            RETURN; {----->
          IFEND;
        ELSE
          RETURN; {----->
        IFEND;
        subfield_p := subfield_p^.descriptive_subfield_link_p;
      WHILEND;

    IFEND;

    predecessor_p := NIL;

{ check Job membership

    IF selection_p^.predecessor_job_statistic_p <> NIL THEN
      successor_p := selection_p^.predecessor_job_statistic_p^.successor_list_head_p;
      WHILE (successor_p <> NIL) AND (statistic_header_p^.job_name <> successor_p^.job_seq_number) DO
        successor_p := successor_p^.successor_link_p;
      WHILEND;
      IF successor_p = NIL THEN
        RETURN; {----->
      IFEND;
      predecessor_p := successor_p;
      ptv$predecessor_job_date_time := successor_p^.date_time;
    IFEND;

{ check Task membership

    IF selection_p^.predecessor_task_statistic_p <> NIL THEN
      successor_p := selection_p^.predecessor_task_statistic_p^.successor_list_head_p;
      WHILE (successor_p <> NIL) AND ((statistic_header_p^.task_id <> successor_p^.global_task_id) OR
            (statistic_header_p^.job_name <> successor_p^.job_seq_number)) DO
        successor_p := successor_p^.successor_link_p;
      WHILEND;
      IF successor_p = NIL THEN
        RETURN; {----->
      IFEND;
      predecessor_p := successor_p;
      ptv$predecessor_task_date_time := successor_p^.date_time;
    IFEND;

{ check Job name

    IF (selection_p^.job_name <> ' ') AND (statistic_header_p^.job_name <> selection_p^.job_name) THEN
      RETURN; {----->
    IFEND;

{ check Task name

    IF selection_p^.task_id_specified AND (statistic_header_p^.task_id <> selection_p^.task_id) THEN
      RETURN; {----->
    IFEND;

    select_statistic := NOT selection_p^.inverted_selection;

  FUNCEND select_statistic;

?? OLDTITLE ??
?? NEWTITLE := 'set_counter_length', EJECT ??

{ PURPOSE:
{   The purpose of this request is to set the length of a fixed counter in the list file.
{
{ DESIGN:
{  The procedure checks all log entries for the longest counter base by comparing the ordinal number of the
{ base.
{
{ NOTE:
{   - In a list log when the counter_format is fixed all counters are written in the same length.
{   - The order in radix is the order of the fixed counter length (see ptc$base_xx_length).
{
{        radix          length
{        -----          ------
{        base_0
{        base_10          21
{        base_16          22
{        base_16_group    26
{        base_8           27
{        base_2           69

  PROCEDURE set_counter_length;

    VAR
      base: radix,
      index: integer,
      log_entry_p: ^put_entry;

    base := base_10;
    log_entry_p := ptv$log_entry_chain_head_p;
    WHILE log_entry_p <> NIL DO
      FOR index := 1 TO sfc$max_number_of_counters DO
        IF base < log_entry_p^.counter_base [index] THEN
          base := log_entry_p^.counter_base [index];
        IFEND;
      FOREND;
      log_entry_p := log_entry_p^.put_chain_link_p;
    WHILEND;

    CASE base OF
    = base_2 =
      ptv$fixed_counter_length := ptc$base_2_length;
    = base_8 =
      ptv$fixed_counter_length := ptc$base_8_length;
    = base_10 =
      ptv$fixed_counter_length := ptc$base_10_length;
    = base_16 =
      ptv$fixed_counter_length := ptc$base_16_length;
    = base_16_group =
      ptv$fixed_counter_length := ptc$base_16_group_length;
    ELSE
    CASEND;

  PROCEND set_counter_length;

?? OLDTITLE ??
?? NEWTITLE := 'set_elapsed_time_field', EJECT ??

{ PURPOSE:
{   The purpose of this request is to process the elapsed_time field in elapsed_time_calculation parameter for
{ add_field and change_field subcommands.

  PROCEDURE set_elapsed_time_field
    (    elapsed_time: clt$field_value;
         field_p { input, output } : ^field);

    IF elapsed_time.value <> NIL THEN
      IF elapsed_time.value^.keyword_value = ptc$key_previous_occurrence THEN
        field_p^.elapsed_time := previous_occurrence;
      ELSEIF elapsed_time.value^.keyword_value = ptc$key_predecessor THEN
        field_p^.elapsed_time := predecessor;
      ELSE { elapsed_time.value^.keyword_value = ptc$key_predecessor_chain_head
        field_p^.elapsed_time := predecessor_chain_head;
      IFEND;
    IFEND;

  PROCEND set_elapsed_time_field;

?? OLDTITLE ??
?? NEWTITLE := 'set_field_counter', EJECT ??

{ PURPOSE:
{   The purpose of this request is to process the counter parameter and the counter attributes in the
{ elapsed_time_calculation parameter for add_field and change_field subcommands.
{
{ DESIGN:
{   The field's number is:                           counter    elapsed_time_calculation
{                          counter_number              1                 3
{                          multiplier                  2                 4
{                          incremental                 3                 5
{                          allow_negative_increment    4                 6
{ NOTE:
{   Counter_number field is optional in change_field subcommand.

  PROCEDURE set_field_counter
    (    counter_value: ^clt$data_value;
         field_p { input, output } : ^field);

    VAR
      field_number: integer,
      long_real_value: record
        high: real,
        low: real,
      recend;

    IF field_p^.field_type = counter_field THEN
      field_number := 1;
    ELSE { field_p^field_type = value_per_second_field }
      field_number := 3;
    IFEND;

{ counter_number

    IF counter_value^.field_values^ [field_number].value <> NIL THEN
      field_p^.counter_number := counter_value^.field_values^ [field_number].value^.integer_value.value;
    IFEND;

{ multiplier

    IF counter_value^.field_values^ [field_number + 1].value <> NIL THEN
      #UNCHECKED_CONVERSION (counter_value^.field_values^ [field_number + 1].value^.real_value.value,
            long_real_value);
      field_p^.multiplier := long_real_value.high;
    IFEND;

{ incremental

    IF counter_value^.field_values^ [field_number + 2].value <> NIL THEN
      field_p^.incremental := counter_value^.field_values^ [field_number + 2].value^.boolean_value.value;
    IFEND;

{ allow_negative_increment

    IF counter_value^.field_values^ [field_number + 3].value <> NIL THEN
      field_p^.allow_negative_increment := counter_value^.field_values^ [field_number +
            3].value^.boolean_value.value;
    IFEND;

  PROCEND set_field_counter;

?? OLDTITLE ??
?? NEWTITLE := 'set_field_descriptive_data', EJECT ??

{ PURPOSE:
{   The purpose of this request is to set the length of the descriptive data field in the list file.
{

  PROCEDURE set_field_descriptive_data
    (    descriptive_data_value: ^clt$data_value;
         field_p: { output } ^field);

    IF descriptive_data_value^.field_values^ [1].value <> NIL THEN
      field_p^.subfield_position := descriptive_data_value^.field_values^ [1].value^.integer_value.value;
    IFEND;

    IF descriptive_data_value^.field_values^ [2].value <> NIL THEN
      IF descriptive_data_value^.field_values^ [2].value^.kind <> clc$keyword THEN
        field_p^.subfield_length := descriptive_data_value^.field_values^ [2].value^.integer_value.value;
      ELSE
        field_p^.subfield_length := sfc$max_descriptive_data_size;
      IFEND;
    IFEND;

    IF descriptive_data_value^.field_values^ [3].value <> NIL THEN
      IF descriptive_data_value^.field_values^ [3].value^.kind <> clc$keyword THEN
        field_p^.subfield_number := descriptive_data_value^.field_values^ [3].value^.integer_value.value;
      ELSE
        field_p^.subfield_number := 0;
      IFEND;
    IFEND;

    IF descriptive_data_value^.field_values^ [4].value <> NIL THEN
      field_p^.subfield_delimiter := descriptive_data_value^.field_values^ [4].value^.string_value^ (1);
    IFEND;

  PROCEND set_field_descriptive_data;

?? OLDTITLE ??
?? NEWTITLE := 'set_field_type', EJECT ??

{ PURPOSE:
{   The purpose of this procedure is to initialize elements of a field record that are unique to the type of
{   field.
{

  PROCEDURE set_field_type
    (    field_type: type_of_field;
         field_p: { output } ^field;
     VAR status: ost$status);

    status.normal := TRUE;

    CASE field_type OF

    = counter_field =
      field_p^.first_counter_value := 0;
      field_p^.last_counter_value := 0;
      field_p^.counter_value_head_p := NIL;
      field_p^.counter_value_tail_p := NIL;

      field_p^.counter_number := 1;
      field_p^.multiplier := 1.0;
      field_p^.incremental := FALSE;
      field_p^.allow_negative_increment := FALSE;
      field_p^.last_value := 0;

    = descriptive_data_field =
      field_p^.first_descriptive_value_p := NIL;
      field_p^.last_descriptive_value_p := NIL;
      field_p^.descriptive_value_head_p := NIL;
      field_p^.descriptive_value_tail_p := NIL;
      field_p^.subfield_position := 1;
      field_p^.subfield_length := sfc$max_descriptive_data_size;
      field_p^.subfield_number := 0; { ALL }
      field_p^.subfield_delimiter := ',';

    = date_time_field =
      field_p^.date_time_value_head_p := NIL;
      field_p^.date_time_value_tail_p := NIL;

    = statistic_code_field =
      field_p^.statistic_code_value_head_p := NIL;
      field_p^.statistic_code_value_tail_p := NIL;

    = system_job_name_field =
      field_p^.system_job_name_value_head_p := NIL;
      field_p^.system_job_name_value_tail_p := NIL;

    = global_task_id_field =
      field_p^.global_task_id_value_head_p := NIL;
      field_p^.global_task_id_value_tail_p := NIL;

    = number_of_counters_field =
      field_p^.number_of_counters_value_head_p := NIL;
      field_p^.number_of_counters_value_tail_p := NIL;

    = descriptive_data_size_field =
      field_p^.dd_size_value_head_p := NIL;
      field_p^.dd_size_value_tail_p := NIL;

    = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =
      field_p^.elapsed_time_value_head_p := NIL;
      field_p^.elapsed_time_value_tail_p := NIL;

{ If elapsed time based on a predecessor, but no predecessors are defined, signal an error
      IF ((field_p^.field_type = predecessor_field) OR (field_p^.field_type =
            predecessor_chain_head_field)) AND (field_p^.selection_p^.predecessor_job_statistic_p = NIL) AND
            (field_p^.selection_p^.predecessor_task_statistic_p = NIL) THEN
              osp$set_status_condition (pte$no_predecessor_for_et, status);
      IFEND;

    = value_per_second_field =
      field_p^.value_per_second_value_head_p := NIL;
      field_p^.value_per_second_value_tail_p := NIL;

      field_p^.counter_number := 1;
      field_p^.multiplier := 1.0;
      field_p^.incremental := FALSE;
      field_p^.allow_negative_increment := FALSE;
      field_p^.last_value := 0;

    = occurrence_per_second_field =
      field_p^.value_per_second_value_head_p := NIL;
      field_p^.value_per_second_value_tail_p := NIL;

    = text_field =

    ELSE
    CASEND;

  PROCEND set_field_type;

?? OLDTITLE ??
?? NEWTITLE := 'set_report_information', EJECT ??

{ PURPOSE:
{   The purpose of this request is to check and set report information (summary and/or interval).
{
{ DESIGN:
{   The procedure checks all selections and fields (counters and descriptive data) for the type of information
{ it needs to collect during the log scan.  Based on the type of report that the fields are going to appear
{ in, this procedure sets flags (in a set).  If an interval_field flag is set for one of the fields in a
{ selection, a collect date_time flag is set for that selection.  If an interval_field flag is set for one of
{ the fields in a selection and the selection has a predecessor, then a collect predecessor date_time flag is
{ set for that selection.

{ 1. Reset collects
{ 2. PUTIF                : collect_all_occurrences
{    PUTF all_occurrences : collect_all_occurrences
{    PUTF                 : collect_summary
{    PUTFs                : collect_summary

  PROCEDURE set_report_information;

    VAR
      field_p: ^field,
      report_list_p: ^report_list,
      selection_p: ^selection;


    selection_p := ptv$selection_chain_head_p;
    WHILE selection_p <> NIL DO

      selection_p^.incremental := FALSE;
      selection_p^.incremental_counter_p := NIL;
      selection_p^.skip_date_time := FALSE;
      selection_p^.lost_interval := 0;
      selection_p^.skip_date_time_head_p := NIL;
      selection_p^.skip_date_time_tail_p := NIL;

      field_p := selection_p^.field_chain_p;
      WHILE field_p <> NIL DO

        IF field_p^.field_type <> text_field THEN

          field_p^.first_value := TRUE;
          field_p^.collect_summary := FALSE;
          field_p^.collect_all_occurrences := FALSE;

          report_list_p := field_p^.report_list_p;
          WHILE report_list_p <> NIL DO

            CASE report_list_p^.report_p^.put OF

            = put_field =
              IF report_list_p^.report_p^.all_occurrences THEN
                IF NOT report_list_p^.shadow THEN
                  field_p^.collect_all_occurrences := TRUE;
                IFEND;
              ELSE
                field_p^.collect_summary := TRUE;
              IFEND;

            = put_field_summary =
              field_p^.collect_summary := TRUE;

            = put_interval_field =
              IF NOT report_list_p^.shadow THEN
                field_p^.collect_all_occurrences := TRUE;
                selection_p^.collect_date_time := TRUE;
                IF (report_list_p^.report_p^.row_label_type = start_time) OR
                      (report_list_p^.report_p^.row_label_type = end_time) OR
                      (report_list_p^.report_p^.row_label_type = time_range) THEN
                IFEND;
                IF ((selection_p^.predecessor_job_statistic_p <> NIL) OR
                      (selection_p^.predecessor_task_statistic_p <> NIL)) THEN
                  selection_p^.collect_predecessor_date_time := TRUE;
                IFEND;
              IFEND;

            ELSE
            CASEND;

            report_list_p := report_list_p^.link_p;
          WHILEND;

          IF NOT selection_p^.incremental AND ((field_p^.field_type = counter_field) OR
                (field_p^.field_type = value_per_second_field)) AND field_p^.incremental AND
                field_p^.allow_negative_increment THEN
            selection_p^.incremental := TRUE;
            selection_p^.incremental_counter_p := field_p;
          IFEND;

        IFEND;

        field_p := field_p^.field_chain_link_p;
      WHILEND;

      selection_p := selection_p^.selection_chain_link_p;
    WHILEND;

  PROCEND set_report_information;

?? OLDTITLE ??
?? NEWTITLE := 'set_shadow_fields', EJECT ??

{ PURPOSE:
{   The purpose of this check is to determine if there is a need to do predecessor joins for a
{ put_field report with all_occurrences display_option. If so, it sets shadow fields to collect the joined
{ data.
{
{ DESIGN:
{   The procedure scans the list of report entries for every field report entry with display_option
{ all_occurrences. The procedure checks if the data for the report is coming from more than one selection and
{ if all the selections that the data is coming from are linked together in one path of predecessors (task
{ and/or job).  Then the procedure finds the tail of the chain - a selection in the predecessor chain that is
{ not predecessor to any of the other selections in the list.  For every field in the report entry that does
{ not belong to the tail selection the procedure creates shadow fields in the tail selection in order to
{ collect the field occurences joined (in synchronization) with the field that belongs to the tail selection.
{
{ Example:
{
{   add_selection selection=job_begin statistic_code=jm0
{   add_selection selection=job_name  statistic_code=jm1  job_predecessor=job_begin
{   add_selection selection=job_mode  statistic_code=jm2  job_predecessor=job_name
{   add_selection selection=job_end   statistic_code=jm3  job_predecessor=job_mode
{   add_field field=user_name  selection=job_begin text=(1, 31)
{   add_field field=job_mode   selection=job_mode  text=(1, 11)
{   add_field field=job_jm_cpu selection=job_end   counter=1 m=0.000001
{   add_field field=job_mm_cpu selection=job_end   counter=2 m=0.000001
{   put_field field=((user_name,  all_occurrences,, 31, 'User Name') ..
{                    (job_mode,   all_occurrences,, 11, 'Job Mode') ..
{                    (job_jm_cpu, all_occurrences,, 15, 'JM CPU') ..
{                    (job_mm_cpu, all_occurrences,, 15, 'MM CPU'))
{   generate_report input=log output=out
{
{ For this example the procedure will find that the display_option for the put_field report entry is
{ all_occurrences and the data for the report is coming from 3 selections (job_begin job_mode and
{ job_end).  The 3 selections create a chain of predecessors and the job_end selection will be the tail
{ selection.  The procedure will create shadow fields for user_name and job_mode fields in job_end selection.
{ The data for the shadow field will be collected when a statistic is selected for job_end selection with
{ the data collection for job_end regular fields.
{
{   If the procedure sets the shadow flag and the active log flag is set too, the procedure opens a temporary
{ binary log file for saving the shadowed predecessor statistic records from active log.

{ NOTE:
{   - Not all the selections in the predecessors chain must be in the report - in the example job_name
{     selection does not have field(s) in the report but it's the link between job_mode selection and
{     job_begin selection.
{   - The tail selection can be a predecessor to a selection that does not have fields in the report.

  PROCEDURE set_shadow_fields
    (VAR status: ost$status);

    VAR
      field_p: ^field,
      index: integer,
      join_predecessor_status: join_predecessor_status_type,
      report_entry_number: integer,
      report_entry_p: ^put_entry,
      report_list_p: ^report_list,
      selection_p: ^selection,
      shadow_fields: boolean,
      unique_name: ost$name,
      warning_status: ost$status;

    status.normal := TRUE;

    shadow_fields := FALSE;
    report_entry_number := 0;
    report_entry_p := ptv$report_entry_chain_head_p;
    WHILE report_entry_p <> NIL DO
      report_entry_number := report_entry_number + 1;
      IF (report_entry_p^.put = put_field) AND report_entry_p^.all_occurrences THEN

        check_predecessor_path (report_entry_p, join_predecessor_status, selection_p);

        CASE join_predecessor_status OF
        = one_selection =

        = no_predecessor_path = { The fields are from more than one selection.
          IF report_entry_p^.name <> ' ' THEN
            osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$mixed_selections, report_entry_p^.name,
                  warning_status);
          ELSE
            osp$set_status_condition (pte$mixed_selections, warning_status);
            osp$append_status_integer (osc$status_parameter_delimiter, report_entry_number, 10, FALSE,
                  warning_status);
          IFEND;
          report_intermediate_error (warning_status, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

        = predecessor_path =
          index := LOWERBOUND (field_vector_type);
          WHILE (index <= UPPERBOUND (field_vector_type)) AND
                (report_entry_p^.field_vector [index].summary <> null) DO
            IF report_entry_p^.field_vector [index].field_p^.field_type <> text_field THEN
              IF selection_p <> report_entry_p^.field_vector [index].field_p^.selection_p THEN

{   Allocate a shadow counter field in the tail's selection. Initialize the counter by
{ copying the original counter, setting the put_set to put_interval_field, setting the original selection
{ pointer, setting the selection pointer to the tail selection, setting the field in the report entry as
{ shadow (setting the shadow flag and setting pointer to the shadow counter) and marking the original counter
{ report_list entry as shadowed.

                IF selection_p^.shadow_field_chain_p <> NIL THEN
                  NEXT field_p^.field_chain_link_p IN ptv$data_segment_p.sequence_pointer;
                  field_p := field_p^.field_chain_link_p;
                ELSE
                  NEXT selection_p^.shadow_field_chain_p IN ptv$data_segment_p.sequence_pointer;
                  field_p := selection_p^.shadow_field_chain_p;
                IFEND;
                field_p^ := report_entry_p^.field_vector [index].field_p^;
                field_p^.field_chain_link_p := NIL;
                field_p^.report_list_p := NIL;
                field_p^.collect_all_occurrences := TRUE;
                field_p^.original_selection_p := field_p^.selection_p;
                field_p^.selection_p := selection_p;
                field_p^.original_selection_p^.shadow_fields := TRUE;
                report_entry_p^.field_vector [index].shadow_field := TRUE;
                report_entry_p^.field_vector [index].shadow_field_p := field_p;

                report_list_p := report_entry_p^.field_vector [index].field_p^.report_list_p;
                WHILE report_list_p <> NIL DO
                  IF report_list_p^.report_p = report_entry_p THEN
                    report_list_p^.shadow := TRUE;
                  IFEND;
                  report_list_p := report_list_p^.link_p;
                WHILEND;
              IFEND;
            IFEND;
            index := index + 1;
          WHILEND;

          shadow_fields := TRUE;

        ELSE
        CASEND;

      IFEND;
      report_entry_p := report_entry_p^.put_chain_link_p;
    WHILEND;

    IF shadow_fields AND ptv$active_log THEN
      RESET ptv$predecessor_log_p.sequence_pointer;
    IFEND;

  PROCEND set_shadow_fields;

?? OLDTITLE ??
?? NEWTITLE := 'sort_list_by_statistic_code', EJECT ??

{   The purpose of this procedure is to sort the logged_statistic linked list in order
{ of increasing statistic code.
{ The procedure uses recursion to sort sublists of the whole list.  This is basically a
{ bubble sort for linked lists, rather than for an array.
{ The procedure is only called by itself and display_logged_statistics_cmd.

  PROCEDURE sort_list_by_statistic_code
    (VAR head_logged_stat_p: ^logged_statistic);

    VAR
      prev_logged_stat_p: ^logged_statistic,
      curr_logged_stat_p: ^logged_statistic,
      next_logged_stat_p: ^logged_statistic;

{ Only sort if list has more than one element.

    IF head_logged_stat_p^.link_p <> NIL THEN

{ Sort sub-list before sorting current list

      sort_list_by_statistic_code (head_logged_stat_p^.link_p);

{ Check order of first two elements in list.  If they need re-ordering, the
{ head of list pointer needs to be reassigned.

      next_logged_stat_p := head_logged_stat_p^.link_p;
      IF head_logged_stat_p^.statistic_code > next_logged_stat_p^.statistic_code THEN
        head_logged_stat_p^.link_p := next_logged_stat_p^.link_p;
        next_logged_stat_p^.link_p := head_logged_stat_p;
        head_logged_stat_p := next_logged_stat_p;
      IFEND;

{ Main sort loop

      prev_logged_stat_p := head_logged_stat_p;
      curr_logged_stat_p := prev_logged_stat_p^.link_p;
      next_logged_stat_p := curr_logged_stat_p^.link_p;
      WHILE next_logged_stat_p <> NIL DO
        IF curr_logged_stat_p^.statistic_code > next_logged_stat_p^.statistic_code THEN
           curr_logged_stat_p^.link_p := next_logged_stat_p^.link_p;
           next_logged_stat_p^.link_p := curr_logged_stat_p;
           prev_logged_stat_p^.link_p := next_logged_stat_p;
        IFEND;

        prev_logged_stat_p := prev_logged_stat_p^.link_p;
        curr_logged_stat_p := prev_logged_stat_p^.link_p;
        next_logged_stat_p := curr_logged_stat_p^.link_p;
      WHILEND;
    IFEND;

  PROCEND sort_list_by_statistic_code;

?? OLDTITLE ??
?? NEWTITLE := 'write_counter_summary', EJECT ??

{ PURPOSE:
{   The purpose of this request is to write one line of a field summary report.
{
{ DESIGN:
{   The procedure gets the counter with the summary values, the row_label string and the report entry.  The
{ procedure places the row label string and the string representation of the summary in the output line in the
{ specified report fields.
{
{ NOTE:
{  - In case of sum overflow during data collection the procedure writes '*' string in the report fields of
{    sum, mean, standard_deviation and sum_per_second.
{  - If the report field length is not enough to hold the summary string the procedure writes '*' string in
{    the report fields.

  PROCEDURE write_counter_summary
    (    field_p: ^field;
         row_label: string ( * <= ptc$max_row_label_size);
         report_entry_p: ^put_entry;
     VAR status: ost$status);

    VAR
      clt_date_time: [STATIC] clt$date_time := [ * , FALSE, TRUE],
      date_time_format: [STATIC] string (clc$max_date_time_form_string) := 'H24:MM:SS.S1000',
      date_time_string: ost$string,
      index: integer,
      output_line_length: integer;

    status.normal := TRUE;

    ptv$output_line := '';
    output_line_length := 0;
    ptv$output_line (report_entry_p^.row_label_start_column,
          report_entry_p^.row_label_column_width) := row_label;
    ptv$output_line_length := report_entry_p^.row_label_start_column +
          report_entry_p^.row_label_column_width - 1;

    index := LOWERBOUND (summary_vector_type);
    WHILE (index <= UPPERBOUND (summary_vector_type)) AND
          (report_entry_p^.summary_vector [index].summary <> null) DO
      CASE report_entry_p^.summary_vector [index].summary OF

      = count =
        clp$convert_integer_to_rjstring (field_p^.field_summary.count, 10, FALSE, ' ',
              ptv$output_line (report_entry_p^.summary_vector [index].start_column,
              report_entry_p^.summary_vector [index].column_width), status);
        IF NOT status.normal THEN
          IF status.condition = cle$string_too_short THEN
            ptv$output_line (report_entry_p^.summary_vector [index].start_column,
                  report_entry_p^.summary_vector [index].column_width) := ptc$stars;
            status.normal := TRUE;
          ELSE
            RETURN; {----->
          IFEND;
        IFEND;

      = sum =
        IF NOT field_p^.field_summary.sum_overflow THEN
          IF field_p^.multiplier = 1.0 THEN
            clp$convert_integer_to_rjstring (field_p^.field_summary.sum, 10, FALSE, ' ',
                  ptv$output_line (report_entry_p^.summary_vector [index].start_column,
                  report_entry_p^.summary_vector [index].column_width), status);
            IF NOT status.normal THEN
              IF status.condition = cle$string_too_short THEN
                ptv$output_line (report_entry_p^.summary_vector [index].start_column,
                      report_entry_p^.summary_vector [index].column_width) := ptc$stars;
                status.normal := TRUE;
              ELSE
                RETURN; {----->
              IFEND;
            IFEND;
          ELSE
            STRINGREP (ptv$output_line (report_entry_p^.summary_vector [index].start_column,
                  report_entry_p^.summary_vector [index].column_width), ptv$output_line_length,
                  ($REAL (field_p^.field_summary.sum) * field_p^.multiplier):
                  report_entry_p^.summary_vector [index].column_width: ptv$counter_fraction);
          IFEND;
        ELSE
          ptv$output_line (report_entry_p^.summary_vector [index].start_column,
                report_entry_p^.summary_vector [index].column_width) := ptc$stars;
        IFEND;

      = mean =
        IF NOT field_p^.field_summary.sum_overflow THEN
          STRINGREP (ptv$output_line (report_entry_p^.summary_vector [index].start_column,
                report_entry_p^.summary_vector [index].column_width), ptv$output_line_length,
                field_p^.field_summary.mean * field_p^.multiplier: report_entry_p^.summary_vector [index].
                column_width: ptv$counter_fraction);
        ELSE
          ptv$output_line (report_entry_p^.summary_vector [index].start_column,
                report_entry_p^.summary_vector [index].column_width) := ptc$stars;
        IFEND;

      = standard_deviation =
        IF NOT field_p^.field_summary.sum_overflow THEN
          STRINGREP (ptv$output_line (report_entry_p^.summary_vector [index].start_column,
                report_entry_p^.summary_vector [index].column_width), ptv$output_line_length,
                field_p^.field_summary.standard_deviation * field_p^.multiplier: report_entry_p^.
                summary_vector [index].column_width: ptv$counter_fraction);
        ELSE
          ptv$output_line (report_entry_p^.summary_vector [index].start_column,
                report_entry_p^.summary_vector [index].column_width) := ptc$stars;
        IFEND;

      = minimum =
        IF field_p^.multiplier = 1.0 THEN
          clp$convert_integer_to_rjstring (field_p^.field_summary.minimum, 10, FALSE, ' ',
                ptv$output_line (report_entry_p^.summary_vector [index].start_column,
                report_entry_p^.summary_vector [index].column_width), status);
        ELSE
          STRINGREP (ptv$output_line (report_entry_p^.summary_vector [index].start_column,
                report_entry_p^.summary_vector [index].column_width), ptv$output_line_length,
                ($REAL (field_p^.field_summary.minimum) * field_p^.multiplier): report_entry_p^.
                summary_vector [index].column_width: ptv$counter_fraction);
        IFEND;

      = maximum =
        IF field_p^.multiplier = 1.0 THEN
          clp$convert_integer_to_rjstring (field_p^.field_summary.maximum, 10, FALSE, ' ',
                ptv$output_line (report_entry_p^.summary_vector [index].start_column,
                report_entry_p^.summary_vector [index].column_width), status);
          IF NOT status.normal THEN
            IF status.condition = cle$string_too_short THEN
              ptv$output_line (report_entry_p^.summary_vector [index].start_column,
                    report_entry_p^.summary_vector [index].column_width) := ptc$stars;
              status.normal := TRUE;
            ELSE
              RETURN; {----->
            IFEND;
          IFEND;
        ELSE
          STRINGREP (ptv$output_line (report_entry_p^.summary_vector [index].start_column,
                report_entry_p^.summary_vector [index].column_width), ptv$output_line_length,
                ($REAL (field_p^.field_summary.maximum) * field_p^.multiplier): report_entry_p^.
                summary_vector [index].column_width: ptv$counter_fraction);
        IFEND;

      = interval =
        ptv$interval.millisecond := field_p^.field_summary.interval;
        IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
          pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          clp$convert_date_time_to_string (clt_date_time, date_time_format, date_time_string, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          ptv$output_line (report_entry_p^.summary_vector [index].start_column +
                report_entry_p^.summary_vector [index].column_width - ptc$time_length,
                report_entry_p^.summary_vector [index].column_width) := date_time_string.value (1, * );
        ELSE { ptv$time_increment_format = 'SECONDS'
          STRINGREP (ptv$output_line (report_entry_p^.summary_vector [index].start_column,
                report_entry_p^.summary_vector [index].column_width), ptv$output_line_length,
                ($REAL (ptv$interval.millisecond) * 0.001): report_entry_p^.summary_vector [index].
                column_width: 3);
        IFEND;

      = count_per_second =
        STRINGREP (ptv$output_line (report_entry_p^.summary_vector [index].start_column,
              report_entry_p^.summary_vector [index].column_width), ptv$output_line_length,
              field_p^.field_summary.count_per_second: report_entry_p^.summary_vector [index].
              column_width: ptv$counter_fraction);

      = sum_per_second =
        IF NOT field_p^.field_summary.sum_overflow THEN
          STRINGREP (ptv$output_line (report_entry_p^.summary_vector [index].start_column,
                report_entry_p^.summary_vector [index].column_width), ptv$output_line_length,
                field_p^.field_summary.sum_per_second: report_entry_p^.summary_vector [index].
                column_width: ptv$counter_fraction);
        ELSE
          ptv$output_line (report_entry_p^.summary_vector [index].start_column,
                report_entry_p^.summary_vector [index].column_width) := ptc$stars;
        IFEND;

      = elapsed_time_since_predecessor =
        ptv$interval.millisecond := field_p^.field_summary.elapsed_time_since_predecessor;
        IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
          pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          clp$convert_date_time_to_string (clt_date_time, date_time_format, date_time_string, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          ptv$output_line (report_entry_p^.summary_vector [index].start_column +
                report_entry_p^.summary_vector [index].column_width - ptc$time_length,
                report_entry_p^.summary_vector [index].column_width) := date_time_string.value (1, * );
        ELSE { ptv$time_increment_format = 'SECONDS'
          STRINGREP (ptv$output_line (report_entry_p^.summary_vector [index].start_column,
                report_entry_p^.summary_vector [index].column_width), ptv$output_line_length,
                ($REAL (ptv$interval.millisecond) * 0.001): report_entry_p^.summary_vector [index].
                column_width: 3);
        IFEND;

      ELSE
      CASEND;
      IF report_entry_p^.summary_vector [index].summary <> null THEN
        ptv$output_line_length := report_entry_p^.summary_vector [index].start_column +
              report_entry_p^.summary_vector [index].column_width - 1;
      IFEND;
      IF output_line_length < (report_entry_p^.summary_vector [index].start_column +
            report_entry_p^.summary_vector [index].column_width - 1) THEN
        output_line_length := report_entry_p^.summary_vector [index].start_column +
              report_entry_p^.summary_vector [index].column_width - 1;
      IFEND;

      index := index + 1;
    WHILEND;

    IF ptv$excel THEN
      convert_output_line_to_excel (report_entry_p, ptv$output_line, ptv$output_line, ptv$output_line_length);
    ELSE
      ptv$output_line_length := output_line_length;
    IFEND;
    cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

  PROCEND write_counter_summary;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] write_descriptive_data_to_list', EJECT ??

{ PURPOSE:
{   The purpose of this request is to write a descriptive_data string to the list file, for display_selection
{ subcommand and write_statistic_to_list_log procedure.
{
{ DESIGN:
{   The procedure adds an apostrophe in the beginning and the end of the descriptive_data string.  The
{ procedure writes the descriptive_data string into the output file while folding the descriptive_data
{ string in order not to go over the file page_width.

  PROCEDURE [INLINE] write_descriptive_data_to_list
    (    descriptive_data: sft$descriptive_data;
         indent: integer;
     VAR status: ost$status);

    VAR
      index: integer,
      line_length: integer;

    status.normal := TRUE;

    ptv$output_line_log (1, indent) := '';
    ptv$output_line_log (indent + 1) := '''';
    ptv$output_line_log (indent + 2, #SIZE (descriptive_data)) := descriptive_data;
    ptv$output_line_log (indent + #SIZE (descriptive_data) + 2) := '''';
    line_length := indent + #SIZE (descriptive_data) + 2;
    index := 1;
    WHILE line_length > ptv$maximum_line_length DO
      cyp$put_next_line (ptv$output_file, ptv$output_line_log (index, ptv$maximum_line_length), status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      line_length := line_length - ptv$maximum_line_length;
      index := index + ptv$maximum_line_length;
    WHILEND;
    cyp$put_next_line (ptv$output_file, ptv$output_line_log (index, line_length), status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

  PROCEND write_descriptive_data_to_list;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] write_field_all_occurrences', EJECT ??

{ PURPOSE:
{   The purpose of this request is to write a field in an all_occurrences field report line.
{
{ DESIGN:
{   This procedure converts the field's value to a string and places it in the report field postion.  If
{ the field runs out of values the procedure deletes the field from the active_fields set and decrements the
{ number of active fields.

  PROCEDURE [INLINE] write_field_all_occurrences
    (    report_entry_field: field_record_type;
         index: integer;
     VAR active_fields: active_fields_set;
     VAR number_of_active_fields: integer;
     VAR field_value_entry: field_value_pointers;
     VAR status: ost$status);

    VAR
      clt_date_time: clt$date_time,
      date_time_string: ost$string,
      statistic_name: ost$name,
      task_id_index: string (ptc$task_id_index_string_size),
      task_id_seqno: string (ptc$task_id_seqno_string_size);

    status.normal := TRUE;

    IF field_value_entry.first AND ((report_entry_field.field_p^.incremental) OR
          (report_entry_field.field_p^.field_type = previous_occurrence_field) OR
          (((report_entry_field.field_p^.field_type = value_per_second_field) OR
          (report_entry_field.field_p^.field_type = occurrence_per_second_field)) AND
          (report_entry_field.field_p^.elapsed_time = previous_occurrence))) THEN

{  If this is the first value of an incremental type field, then skip this pass.
{    This is to keep in sync with non-incremental fields.  Do not let the
{    value_index be incremented.
{  Only incremental type fields have field_value_p^ [index].first set to TRUE by
{    initialize_write_occurrence.

      field_value_entry.first := FALSE;
      ptv$output_line (report_entry_field.start_column, report_entry_field.column_width) := ptc$blanks;
      RETURN; {----->
    IFEND;

    field_value_entry.value_index := field_value_entry.value_index + 1;
    CASE report_entry_field.field_p^.field_type OF

    = counter_field =

      IF (field_value_entry.counter_value_p^.value_array [field_value_entry.value_index] >= 0) OR
            (report_entry_field.field_p^.allow_negative_increment) THEN
        IF report_entry_field.field_p^.multiplier = 1.0 THEN
          clp$convert_integer_to_rjstring (field_value_entry.counter_value_p^.
                value_array [field_value_entry.value_index], 10, FALSE, ' ',
                ptv$output_line (report_entry_field.start_column, report_entry_field.column_width), status);
          IF NOT status.normal THEN
            IF status.condition = cle$string_too_short THEN
              ptv$output_line (report_entry_field.start_column, report_entry_field.column_width) := ptc$stars;
              status.normal := TRUE;
            ELSE
              RETURN; {----->
            IFEND;
          IFEND;
        ELSE
          STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                ptv$output_line_length, ($REAL (field_value_entry.counter_value_p^.
                value_array [field_value_entry.value_index]) * report_entry_field.field_p^.
                multiplier): report_entry_field.column_width: ptv$counter_fraction);
        IFEND;
      ELSE
        ptv$output_line (report_entry_field.start_column, report_entry_field.column_width) := ptc$blanks;

      IFEND;

      IF field_value_entry.value_index = field_value_entry.counter_value_p^.index THEN
        IF field_value_entry.counter_value_p^.link_p <> NIL THEN
          field_value_entry.counter_value_p := field_value_entry.counter_value_p^.link_p;
          field_value_entry.value_index := 0;
        ELSE
          active_fields := active_fields - $active_fields_set [index];
          number_of_active_fields := number_of_active_fields - 1;
        IFEND;
      IFEND;

    = descriptive_data_field =
      IF field_value_entry.descriptive_value_p^.value_array [field_value_entry.value_index] <> NIL THEN
        ptv$output_line (report_entry_field.start_column, report_entry_field.column_width) :=
              field_value_entry.descriptive_value_p^.value_array [field_value_entry.value_index]^ (1, * );
      IFEND;

      IF field_value_entry.value_index = field_value_entry.descriptive_value_p^.index THEN
        IF field_value_entry.descriptive_value_p^.link_p <> NIL THEN
          field_value_entry.descriptive_value_p := field_value_entry.descriptive_value_p^.link_p;
          field_value_entry.value_index := 0;
        ELSE
          active_fields := active_fields - $active_fields_set [index];
          number_of_active_fields := number_of_active_fields - 1;
        IFEND;
      IFEND;

    = date_time_field =
      ptv$clt_date_time.value := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];

      clp$convert_date_time_to_string (ptv$clt_date_time, ptv$date_time_format, date_time_string, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

      ptv$output_line (report_entry_field.start_column, report_entry_field.column_width) :=
            date_time_string.value;

      IF field_value_entry.value_index = field_value_entry.date_time_p^.index THEN
        IF field_value_entry.date_time_p^.link_p <> NIL THEN
          field_value_entry.date_time_p := field_value_entry.date_time_p^.link_p;
          field_value_entry.value_index := 0;
        ELSE
          active_fields := active_fields - $active_fields_set [index];
          number_of_active_fields := number_of_active_fields - 1;
        IFEND;
      IFEND;

    = statistic_code_field =
      sfp$convert_stat_code_to_name (field_value_entry.statistic_code_value_p^.
            value_array [field_value_entry.value_index], statistic_name, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

      ptv$output_line (report_entry_field.start_column, report_entry_field.column_width) := statistic_name;

      IF field_value_entry.value_index = field_value_entry.statistic_code_value_p^.index THEN
        IF field_value_entry.statistic_code_value_p^.link_p <> NIL THEN
          field_value_entry.statistic_code_value_p := field_value_entry.statistic_code_value_p^.link_p;
          field_value_entry.value_index := 0;
        ELSE
          active_fields := active_fields - $active_fields_set [index];
          number_of_active_fields := number_of_active_fields - 1;
        IFEND;
      IFEND;

    = system_job_name_field =

      ptv$output_line (report_entry_field.start_column, report_entry_field.column_width) :=
            field_value_entry.system_job_name_value_p^.value_array [field_value_entry.value_index];

      IF field_value_entry.value_index = field_value_entry.system_job_name_value_p^.index THEN
        IF field_value_entry.system_job_name_value_p^.link_p <> NIL THEN
          field_value_entry.system_job_name_value_p := field_value_entry.system_job_name_value_p^.link_p;
          field_value_entry.value_index := 0;
        ELSE
          active_fields := active_fields - $active_fields_set [index];
          number_of_active_fields := number_of_active_fields - 1;
        IFEND;
      IFEND;

    = global_task_id_field =

      clp$convert_integer_to_rjstring (field_value_entry.global_task_id_value_p^.
            value_array [field_value_entry.value_index].index, 10, FALSE, '0', task_id_index, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

      clp$convert_integer_to_rjstring (field_value_entry.global_task_id_value_p^.
            value_array [field_value_entry.value_index].seqno, 10, FALSE, '0', task_id_seqno, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

      STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
            ptv$output_line_length, task_id_index, '-', task_id_seqno);

      IF field_value_entry.value_index = field_value_entry.global_task_id_value_p^.index THEN
        IF field_value_entry.global_task_id_value_p^.link_p <> NIL THEN
          field_value_entry.global_task_id_value_p := field_value_entry.global_task_id_value_p^.link_p;
          field_value_entry.value_index := 0;
        ELSE
          active_fields := active_fields - $active_fields_set [index];
          number_of_active_fields := number_of_active_fields - 1;
        IFEND;
      IFEND;

    = number_of_counters_field =

      clp$convert_integer_to_rjstring (field_value_entry.number_of_counters_value_p^.
            value_array [field_value_entry.value_index], 10, FALSE, ' ',
            ptv$output_line (report_entry_field.start_column, report_entry_field.column_width), status);

      IF field_value_entry.value_index = field_value_entry.number_of_counters_value_p^.index THEN
        IF field_value_entry.number_of_counters_value_p^.link_p <> NIL THEN
          field_value_entry.number_of_counters_value_p := field_value_entry.number_of_counters_value_p^.
                link_p;
          field_value_entry.value_index := 0;
        ELSE
          active_fields := active_fields - $active_fields_set [index];
          number_of_active_fields := number_of_active_fields - 1;
        IFEND;
      IFEND;

    = descriptive_data_size_field =

      clp$convert_integer_to_rjstring (field_value_entry.dd_size_value_p^.
            value_array [field_value_entry.value_index], 10, FALSE, ' ',
            ptv$output_line (report_entry_field.start_column, report_entry_field.column_width), status);

      IF field_value_entry.value_index = field_value_entry.dd_size_value_p^.index THEN
        IF field_value_entry.dd_size_value_p^.link_p <> NIL THEN
          field_value_entry.dd_size_value_p := field_value_entry.dd_size_value_p^.link_p;
          field_value_entry.value_index := 0;
        ELSE
          active_fields := active_fields - $active_fields_set [index];
          number_of_active_fields := number_of_active_fields - 1;
        IFEND;
      IFEND;

    = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =

      IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
        ptv$interval.millisecond := field_value_entry.elapsed_time_value_p^.
              value_array [field_value_entry.value_index];

        pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;

        clp$convert_date_time_to_string (clt_date_time, ptv$dt_format_for_increment, date_time_string,
              status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;

        ptv$output_line (report_entry_field.start_column + report_entry_field.column_width - ptc$time_length,
              report_entry_field.column_width) := date_time_string.value;

      ELSE {ptv$time_increment_format = 'SECONDS'

        STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
              ptv$output_line_length, $REAL (field_value_entry.elapsed_time_value_p^.
              value_array [field_value_entry.value_index]) * 0.001: report_entry_field.
              column_width: ptv$counter_fraction);

      IFEND;

      IF field_value_entry.value_index = field_value_entry.elapsed_time_value_p^.index THEN
        IF field_value_entry.elapsed_time_value_p^.link_p <> NIL THEN
          field_value_entry.elapsed_time_value_p := field_value_entry.elapsed_time_value_p^.link_p;
          field_value_entry.value_index := 0;
        ELSE
          active_fields := active_fields - $active_fields_set [index];
          number_of_active_fields := number_of_active_fields - 1;
        IFEND;
      IFEND;

    = value_per_second_field, occurrence_per_second_field =

      IF (field_value_entry.value_per_second_value_p^.value_array [field_value_entry.value_index] >= 0.0) OR
            (report_entry_field.field_p^.allow_negative_increment) THEN

        STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
              ptv$output_line_length, field_value_entry.value_per_second_value_p^.
              value_array [field_value_entry.value_index] * report_entry_field.field_p^.multiplier *
              1000.0: report_entry_field.column_width: ptv$counter_fraction);

      ELSE
        ptv$output_line (report_entry_field.start_column, report_entry_field.column_width) := ptc$blanks;

      IFEND;

      IF field_value_entry.value_index = field_value_entry.value_per_second_value_p^.index THEN
        IF field_value_entry.value_per_second_value_p^.link_p <> NIL THEN
          field_value_entry.value_per_second_value_p := field_value_entry.value_per_second_value_p^.link_p;
          field_value_entry.value_index := 0;
        ELSE
          active_fields := active_fields - $active_fields_set [index];
          number_of_active_fields := number_of_active_fields - 1;
        IFEND;
      IFEND;

    = text_field =

    CASEND;

  PROCEND write_field_all_occurrences;

?? OLDTITLE ??
?? NEWTITLE := 'write_field_ao_report', EJECT ??

{ PURPOSE:
{   The purpose of this request is to write a field report when the display_option is all_occurrences.
{
{ DESIGN:
{   The procedure receives a pointer to a field entry.  The procedure writes the report headers, initializes
{ the report and while there is at least one active field (field with value that was not written) the
{ procedure writes report lines.

  PROCEDURE write_field_ao_report
    (    report_entry_p: ^put_entry;
     VAR status: ost$status);

    VAR
      active_fields: active_fields_set,
      index: integer,
      last_non_null_field: integer,
      number_of_active_fields: integer,
      output_line_length: integer,
      field_value_p: field_value_type;

    status.normal := TRUE;

    write_interval_header (report_entry_p, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    initialize_write_field_ao (report_entry_p, active_fields, field_value_p, last_non_null_field,
          number_of_active_fields, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

  /report/
    WHILE number_of_active_fields > 0 DO

{   Write one line of an all_occurrences field report.
{
{   Scan all the fields with the index range 1..last_non_null_field.  If the field is active,
{ call write_field_all_occurrences.  If the field is not active but it is a string field then
{ the string is placed in the report line.  Write the line into the output file.

      ptv$output_line := '';
      output_line_length := 0;

    /line/
      FOR index := LOWERBOUND (field_vector_type) TO last_non_null_field DO
        IF index IN active_fields THEN
          write_field_all_occurrences (report_entry_p^.field_vector [index], index, active_fields,
                number_of_active_fields, field_value_p [index], status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        ELSEIF report_entry_p^.field_vector [index].field_p^.field_type = text_field THEN

{   Field is a STRING. }

          ptv$output_line (report_entry_p^.field_vector [index].
                start_column, report_entry_p^.field_vector [index].column_width) :=
                report_entry_p^.field_vector [index].field_p^.descriptive_text_p^;

        IFEND;

{  Assumes fields printed in order of increasing start_column

        IF output_line_length < (report_entry_p^.field_vector [index].start_column +
              report_entry_p^.field_vector [index].column_width - 1) THEN
          output_line_length := report_entry_p^.field_vector [index].start_column +
                report_entry_p^.field_vector [index].column_width - 1;
        IFEND;
      FOREND /line/;

{   Once line is constructed, put it in its final form before output

      IF ptv$excel THEN
        convert_output_line_to_excel (report_entry_p, ptv$output_line, ptv$output_line,
              ptv$output_line_length);
      ELSE
        ptv$output_line_length := clp$trimmed_string_size (ptv$output_line (1, output_line_length));
      IFEND;

{   Put line to output file

      cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

    WHILEND /report/;

  PROCEND write_field_ao_report;

?? OLDTITLE ??
?? NEWTITLE := 'write_field_number', EJECT ??

{ PURPOSE:
{   The purpose of this request is to convert numeric values to strings for interval_field reports
{ and all_occurrences field reports.

  PROCEDURE write_field_number
    (    number: integer;
         field_vector_element: field_record_type;
     VAR status: ost$status);

    status.normal := TRUE;

    IF field_vector_element.field_p^.multiplier = 1.0 THEN
      clp$convert_integer_to_rjstring (number, 10, FALSE, ' ',
            ptv$output_line (field_vector_element.start_column, field_vector_element.column_width), status);
      IF NOT status.normal THEN
        IF status.condition = cle$string_too_short THEN
          ptv$output_line (field_vector_element.start_column, field_vector_element.column_width) := ptc$stars;
          status.normal := TRUE;
        ELSE
          RETURN; {----->
        IFEND;
      IFEND;
    ELSE
      STRINGREP (ptv$output_line (field_vector_element.start_column, field_vector_element.column_width),
            ptv$output_line_length, ($REAL (number) * field_vector_element.field_p^.
            multiplier): field_vector_element.column_width: ptv$counter_fraction);
    IFEND;

  PROCEND write_field_number;

?? OLDTITLE ??
?? NEWTITLE := 'write_field_report', EJECT ??

{ PURPOSE:
{   The purpose of this request is to write a field report.
{
{ DESIGN:
{   The procedure receives a pointer to a field entry.  For every non null summary in the field_vector the
{ procedures gets the required summary from the field.  The procedure places the string representation of
{ the summary in the output line in the specified report fields.
{
{ NOTE:
{  - In case of sum overflow during data collection the procedure writes '*' string in the report fields of
{    sum, mean, standard_deviation and sum_per_second.
{  - If the report field length is not enough to hold the summary string the procedure writes '*' string in
{    the report fields.

  PROCEDURE write_field_report
    (    report_entry_p: ^put_entry;
     VAR status: ost$status);

    VAR
      clt_date_time: [STATIC] clt$date_time := [ * , FALSE, TRUE],
      date_time_format_i: [STATIC] string (clc$max_date_time_form_string) := 'H24:MM:SS.S1000',
      date_time_string: ost$string,
      descriptive_data_length: integer,
      descriptive_data_start: integer,
      descriptive_p: ^sft$descriptive_data,
      index: integer,
      null_subfield: boolean,
      output_line_length: integer,
      statistic_name: ost$name,
      substring_found: boolean,
      task_id_index: string (ptc$task_id_index_string_size),
      task_id_seqno: string (ptc$task_id_seqno_string_size);

    status.normal := TRUE;

    ptv$output_line := '';
    output_line_length := 0;

    index := LOWERBOUND (field_vector_type);
    WHILE (index <= UPPERBOUND (field_vector_type)) AND (report_entry_p^.field_vector [index].
          summary <> null) DO

      CASE report_entry_p^.field_vector [index].summary OF

      = count =
        clp$convert_integer_to_rjstring (report_entry_p^.field_vector [index].field_p^.field_summary.count,
              10, FALSE, ' ', ptv$output_line (report_entry_p^.field_vector [index].start_column,
              report_entry_p^.field_vector [index].column_width), status);
        IF NOT status.normal THEN
          IF status.condition = cle$string_too_short THEN
            ptv$output_line (report_entry_p^.field_vector [index].
                  start_column, report_entry_p^.field_vector [index].column_width) := ptc$stars;
            status.normal := TRUE;
          ELSE
            RETURN; {----->
          IFEND;
        IFEND;

      = first_occurrence =
        CASE report_entry_p^.field_vector [index].field_p^.field_type OF

        = counter_field =
          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            write_field_number (report_entry_p^.field_vector [index].field_p^.first_counter_value,
                  report_entry_p^.field_vector [index], status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          IFEND;

        = descriptive_data_field =
          IF report_entry_p^.field_vector [index].field_p^.first_descriptive_value_p <> NIL THEN
            get_descriptive_data_subfield (report_entry_p^.field_vector [index].field_p^.
                  first_descriptive_value_p, #SIZE (report_entry_p^.field_vector [index].field_p^.
                  first_descriptive_value_p^), report_entry_p^.field_vector [index].field_p^.
                  subfield_position, report_entry_p^.field_vector [index].field_p^.subfield_length,
                  report_entry_p^.field_vector [index].field_p^.subfield_number,
                  report_entry_p^.field_vector [index].field_p^.subfield_delimiter, null_subfield,
                  substring_found, descriptive_data_start, descriptive_data_length);
            ptv$output_line (report_entry_p^.field_vector [index].
                  start_column, report_entry_p^.field_vector [index].column_width) :=
                  report_entry_p^.field_vector [index].field_p^.first_descriptive_value_p^ (
                  descriptive_data_start, descriptive_data_length);
          IFEND;


        = date_time_field =
          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            ptv$clt_date_time.value := report_entry_p^.field_vector [index].field_p^.first_date_time_value;

            clp$convert_date_time_to_string (ptv$clt_date_time, ptv$date_time_format, date_time_string,
                  status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

            ptv$output_line (report_entry_p^.field_vector [index].
                  start_column, report_entry_p^.field_vector [index].column_width) := date_time_string.value;
          IFEND;

        = statistic_code_field =
          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            sfp$convert_stat_code_to_name (report_entry_p^.field_vector [index].field_p^.
                  first_statistic_code_value, statistic_name, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

            ptv$output_line (report_entry_p^.field_vector [index].
                  start_column, report_entry_p^.field_vector [index].column_width) := statistic_name;
          IFEND;

        = system_job_name_field =

          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            ptv$output_line (report_entry_p^.field_vector [index].
                  start_column, report_entry_p^.field_vector [index].column_width) :=
                  report_entry_p^.field_vector [index].field_p^.first_system_job_name_value;
          IFEND;

        = global_task_id_field =

          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            clp$convert_integer_to_rjstring (report_entry_p^.field_vector [index].field_p^.
                  first_global_task_id_value.index, 10, FALSE, '0', task_id_index, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

            clp$convert_integer_to_rjstring (report_entry_p^.field_vector [index].field_p^.
                  first_global_task_id_value.seqno, 10, FALSE, '0', task_id_seqno, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

            STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                  report_entry_p^.field_vector [index].column_width), ptv$output_line_length, task_id_index,
                  '-', task_id_seqno);
          IFEND;

        = number_of_counters_field =

          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            clp$convert_integer_to_rjstring (report_entry_p^.field_vector [index].field_p^.
                  first_num_of_counters_value, 10, FALSE, ' ', ptv$output_line
                  (report_entry_p^.field_vector [index].start_column,
                  report_entry_p^.field_vector [index].column_width), status);

          IFEND;

        = descriptive_data_size_field =

          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            clp$convert_integer_to_rjstring (report_entry_p^.field_vector [index].field_p^.
                  first_dd_size_value, 10, FALSE, ' ', ptv$output_line
                  (report_entry_p^.field_vector [index].start_column,
                  report_entry_p^.field_vector [index].column_width), status);
          IFEND;

        = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =

          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
              ptv$interval.millisecond := report_entry_p^.field_vector [index].field_p^.
                    first_elapsed_time_value;

              pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              clp$convert_date_time_to_string (clt_date_time, ptv$dt_format_for_increment, date_time_string,
                    status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              ptv$output_line (report_entry_p^.field_vector [index].start_column +
                    report_entry_p^.field_vector [index].column_width - ptc$time_length,
                    report_entry_p^.field_vector [index].column_width) := date_time_string.value;
            ELSE {ptv$time_increment_format = 'SECONDS'

              STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                    report_entry_p^.field_vector [index].column_width),
                    ptv$output_line_length, $REAL (report_entry_p^.field_vector [index].field_p^.
                    first_elapsed_time_value) * 0.001: report_entry_p^.field_vector [index].column_width: 3);

            IFEND;
          IFEND;

        = value_per_second_field, occurrence_per_second_field =

          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                  report_entry_p^.field_vector [index].column_width), ptv$output_line_length,
                  report_entry_p^.field_vector [index].field_p^.first_value_per_second_value *
                  report_entry_p^.field_vector [index].field_p^.multiplier *
                  1000.0: report_entry_p^.field_vector [index].column_width: ptv$counter_fraction);
          IFEND;

        = text_field =

        CASEND;

      = last_occurrence =
        CASE report_entry_p^.field_vector [index].field_p^.field_type OF

        = counter_field =
          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            write_field_number (report_entry_p^.field_vector [index].field_p^.last_counter_value,
                  report_entry_p^.field_vector [index], status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          IFEND;

        = descriptive_data_field =
          IF report_entry_p^.field_vector [index].field_p^.last_descriptive_value_p <> NIL THEN
            get_descriptive_data_subfield (report_entry_p^.field_vector [index].field_p^.
                  last_descriptive_value_p, #SIZE (report_entry_p^.field_vector [index].field_p^.
                  last_descriptive_value_p^), report_entry_p^.field_vector [index].field_p^.subfield_position,
                  report_entry_p^.field_vector [index].field_p^.subfield_length,
                  report_entry_p^.field_vector [index].field_p^.subfield_number,
                  report_entry_p^.field_vector [index].field_p^.subfield_delimiter, null_subfield,
                  substring_found, descriptive_data_start, descriptive_data_length);
            ptv$output_line (report_entry_p^.field_vector [index].
                  start_column, report_entry_p^.field_vector [index].column_width) :=
                  report_entry_p^.field_vector [index].field_p^.last_descriptive_value_p^ (
                  descriptive_data_start, descriptive_data_length);
          IFEND;


        = date_time_field =
          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            ptv$clt_date_time.value := report_entry_p^.field_vector [index].field_p^.last_date_time_value;

            clp$convert_date_time_to_string (ptv$clt_date_time, ptv$date_time_format, date_time_string,
                  status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

            ptv$output_line (report_entry_p^.field_vector [index].
                  start_column, report_entry_p^.field_vector [index].column_width) := date_time_string.value;
          IFEND;

        = statistic_code_field =
          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            sfp$convert_stat_code_to_name (report_entry_p^.field_vector [index].field_p^.
                  last_statistic_code_value, statistic_name, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

            ptv$output_line (report_entry_p^.field_vector [index].
                  start_column, report_entry_p^.field_vector [index].column_width) := statistic_name;
          IFEND;


        = system_job_name_field =

          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            ptv$output_line (report_entry_p^.field_vector [index].
                  start_column, report_entry_p^.field_vector [index].column_width) :=
                  report_entry_p^.field_vector [index].field_p^.last_system_job_name_value;
          IFEND;

        = global_task_id_field =

          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            clp$convert_integer_to_rjstring (report_entry_p^.field_vector [index].field_p^.
                  last_global_task_id_value.index, 10, FALSE, '0', task_id_index, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

            clp$convert_integer_to_rjstring (report_entry_p^.field_vector [index].field_p^.
                  last_global_task_id_value.seqno, 10, FALSE, '0', task_id_seqno, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

            STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                  report_entry_p^.field_vector [index].column_width), ptv$output_line_length, task_id_index,
                  '-', task_id_seqno);
          IFEND;

        = number_of_counters_field =

          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            clp$convert_integer_to_rjstring (report_entry_p^.field_vector [index].field_p^.
                  last_num_of_counters_value, 10, FALSE, ' ', ptv$output_line
                  (report_entry_p^.field_vector [index].start_column,
                  report_entry_p^.field_vector [index].column_width), status);

          IFEND;

        = descriptive_data_size_field =

          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            clp$convert_integer_to_rjstring (report_entry_p^.field_vector [index].field_p^.last_dd_size_value,
                  10, FALSE, ' ', ptv$output_line (report_entry_p^.field_vector [index].start_column,
                  report_entry_p^.field_vector [index].column_width), status);
          IFEND;

        = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =

          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
              ptv$interval.millisecond := report_entry_p^.field_vector [index].field_p^.
                    last_elapsed_time_value;

              pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              clp$convert_date_time_to_string (clt_date_time, ptv$dt_format_for_increment, date_time_string,
                    status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              ptv$output_line (report_entry_p^.field_vector [index].start_column +
                    report_entry_p^.field_vector [index].column_width - ptc$time_length,
                    report_entry_p^.field_vector [index].column_width) := date_time_string.value;
            ELSE {ptv$time_increment_format = 'SECONDS'

              STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                    report_entry_p^.field_vector [index].column_width),
                    ptv$output_line_length, $REAL (report_entry_p^.field_vector [index].field_p^.
                    last_elapsed_time_value) * 0.001: report_entry_p^.field_vector [index].column_width: 3);

            IFEND;
          IFEND;

        = value_per_second_field, occurrence_per_second_field =

          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                  report_entry_p^.field_vector [index].column_width), ptv$output_line_length,
                  report_entry_p^.field_vector [index].field_p^.last_value_per_second_value *
                  report_entry_p^.field_vector [index].field_p^.multiplier *
                  1000.0: report_entry_p^.field_vector [index].column_width: ptv$counter_fraction);
          IFEND;

        = text_field =

        CASEND;

      = sum =

        IF NOT report_entry_p^.field_vector [index].field_p^.field_summary.sum_overflow THEN
          CASE report_entry_p^.field_vector [index].field_p^.field_type OF

          = value_per_second_field, occurrence_per_second_field =

            STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                  report_entry_p^.field_vector [index].column_width), ptv$output_line_length,
                  report_entry_p^.field_vector [index].field_p^.value_per_second_sum *
                  report_entry_p^.field_vector [index].field_p^.multiplier *
                  1000.0: report_entry_p^.field_vector [index].column_width: ptv$counter_fraction);

          = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =

            IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
              IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
                ptv$interval.millisecond := report_entry_p^.field_vector [index].field_p^.field_summary.sum;

                pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
                IF NOT status.normal THEN
                  RETURN; {----->
                IFEND;

                clp$convert_date_time_to_string (clt_date_time, ptv$dt_format_for_increment, date_time_string,
                      status);
                IF NOT status.normal THEN
                  RETURN; {----->
                IFEND;

                ptv$output_line (report_entry_p^.field_vector [index].start_column +
                      report_entry_p^.field_vector [index].column_width - ptc$time_length,
                      report_entry_p^.field_vector [index].column_width) := date_time_string.value;
              ELSE {ptv$time_increment_format = 'SECONDS'

                STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                      report_entry_p^.field_vector [index].column_width),
                      ptv$output_line_length, $REAL (report_entry_p^.field_vector [index].field_p^.
                      field_summary.sum) * 0.001: report_entry_p^.field_vector [index].
                      column_width: ptv$counter_fraction);

              IFEND;
            IFEND;

          ELSE { Other numeric field types have integer valued data

            write_field_number (report_entry_p^.field_vector [index].field_p^.field_summary.sum,
                  report_entry_p^.field_vector [index], status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          CASEND;
        ELSE
          ptv$output_line (report_entry_p^.field_vector [index].
                start_column, report_entry_p^.field_vector [index].column_width) := ptc$stars;
        IFEND;

      = mean =

        IF NOT report_entry_p^.field_vector [index].field_p^.field_summary.sum_overflow THEN
          CASE report_entry_p^.field_vector [index].field_p^.field_type OF

          = value_per_second_field, occurrence_per_second_field =

            STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                  report_entry_p^.field_vector [index].column_width), ptv$output_line_length,
                  report_entry_p^.field_vector [index].field_p^.field_summary.mean *
                  report_entry_p^.field_vector [index].field_p^.multiplier *
                  1000.0: report_entry_p^.field_vector [index].column_width: ptv$counter_fraction);

          = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =

            IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
              IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
                ptv$interval.millisecond := $INTEGER (report_entry_p^.field_vector [index].field_p^.
                      field_summary.mean);

                pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
                IF NOT status.normal THEN
                  RETURN; {----->
                IFEND;

                clp$convert_date_time_to_string (clt_date_time, ptv$dt_format_for_increment, date_time_string,
                      status);
                IF NOT status.normal THEN
                  RETURN; {----->
                IFEND;

                ptv$output_line (report_entry_p^.field_vector [index].start_column +
                      report_entry_p^.field_vector [index].column_width - ptc$time_length,
                      report_entry_p^.field_vector [index].column_width) := date_time_string.value;
              ELSE {ptv$time_increment_format = 'SECONDS'

                STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                      report_entry_p^.field_vector [index].column_width), ptv$output_line_length,
                      report_entry_p^.field_vector [index].field_p^.field_summary.mean *
                      0.001: report_entry_p^.field_vector [index].column_width: ptv$counter_fraction);

              IFEND;
            IFEND;

          ELSE

            STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                  report_entry_p^.field_vector [index].column_width), ptv$output_line_length,
                  report_entry_p^.field_vector [index].field_p^.field_summary.mean *
                  report_entry_p^.field_vector [index].field_p^.multiplier: report_entry_p^.
                  field_vector [index].column_width: ptv$counter_fraction);

          CASEND;
        ELSE
          ptv$output_line (report_entry_p^.field_vector [index].
                start_column, report_entry_p^.field_vector [index].column_width) := ptc$stars;
        IFEND;

      = standard_deviation =

        IF NOT report_entry_p^.field_vector [index].field_p^.field_summary.sum_overflow THEN
          CASE report_entry_p^.field_vector [index].field_p^.field_type OF

          = value_per_second_field, occurrence_per_second_field =

            STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                  report_entry_p^.field_vector [index].column_width), ptv$output_line_length,
                  report_entry_p^.field_vector [index].field_p^.field_summary.standard_deviation *
                  report_entry_p^.field_vector [index].field_p^.multiplier *
                  1000.0: report_entry_p^.field_vector [index].column_width: ptv$counter_fraction);

          = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =

            IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
              IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
                ptv$interval.millisecond := $INTEGER (report_entry_p^.field_vector [index].field_p^.
                      field_summary.standard_deviation);

                pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
                IF NOT status.normal THEN
                  RETURN; {----->
                IFEND;

                clp$convert_date_time_to_string (clt_date_time, ptv$dt_format_for_increment, date_time_string,
                      status);
                IF NOT status.normal THEN
                  RETURN; {----->
                IFEND;

                ptv$output_line (report_entry_p^.field_vector [index].start_column +
                      report_entry_p^.field_vector [index].column_width - ptc$time_length,
                      report_entry_p^.field_vector [index].column_width) := date_time_string.value;
              ELSE {ptv$time_increment_format = 'SECONDS'

                STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                      report_entry_p^.field_vector [index].column_width), ptv$output_line_length,
                      report_entry_p^.field_vector [index].field_p^.field_summary.standard_deviation *
                      0.001: report_entry_p^.field_vector [index].column_width: ptv$counter_fraction);

              IFEND;
            IFEND;

          ELSE

            STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                  report_entry_p^.field_vector [index].column_width), ptv$output_line_length,
                  report_entry_p^.field_vector [index].field_p^.field_summary.standard_deviation *
                  report_entry_p^.field_vector [index].field_p^.multiplier: report_entry_p^.
                  field_vector [index].column_width: ptv$counter_fraction);

          CASEND;
        ELSE
          ptv$output_line (report_entry_p^.field_vector [index].
                start_column, report_entry_p^.field_vector [index].column_width) := ptc$stars;
        IFEND;

      = minimum =

        CASE report_entry_p^.field_vector [index].field_p^.field_type OF

        = value_per_second_field, occurrence_per_second_field =

          STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                report_entry_p^.field_vector [index].column_width), ptv$output_line_length,
                report_entry_p^.field_vector [index].field_p^.value_per_second_minimum *
                report_entry_p^.field_vector [index].field_p^.multiplier *
                1000.0: report_entry_p^.field_vector [index].column_width: ptv$counter_fraction);

        = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =

          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
              ptv$interval.millisecond := report_entry_p^.field_vector [index].field_p^.field_summary.minimum;

              pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              clp$convert_date_time_to_string (clt_date_time, ptv$dt_format_for_increment, date_time_string,
                    status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              ptv$output_line (report_entry_p^.field_vector [index].start_column +
                    report_entry_p^.field_vector [index].column_width - ptc$time_length,
                    report_entry_p^.field_vector [index].column_width) := date_time_string.value;
            ELSE {ptv$time_increment_format = 'SECONDS'

              STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                    report_entry_p^.field_vector [index].column_width),
                    ptv$output_line_length, $REAL (report_entry_p^.field_vector [index].field_p^.
                    field_summary.minimum) * 0.001: report_entry_p^.field_vector [index].
                    column_width: ptv$counter_fraction);

            IFEND;
          IFEND;

        ELSE { Other numeric field types have integer valued data

          write_field_number (report_entry_p^.field_vector [index].field_p^.field_summary.minimum,
                report_entry_p^.field_vector [index], status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        CASEND;

      = maximum =

        CASE report_entry_p^.field_vector [index].field_p^.field_type OF

        = value_per_second_field, occurrence_per_second_field =

          STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                report_entry_p^.field_vector [index].column_width), ptv$output_line_length,
                report_entry_p^.field_vector [index].field_p^.value_per_second_maximum *
                report_entry_p^.field_vector [index].field_p^.multiplier *
                1000.0: report_entry_p^.field_vector [index].column_width: ptv$counter_fraction);

        = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =

          IF report_entry_p^.field_vector [index].field_p^.field_summary.count > 0 THEN
            IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
              ptv$interval.millisecond := report_entry_p^.field_vector [index].field_p^.field_summary.maximum;

              pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              clp$convert_date_time_to_string (clt_date_time, ptv$dt_format_for_increment, date_time_string,
                    status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              ptv$output_line (report_entry_p^.field_vector [index].start_column +
                    report_entry_p^.field_vector [index].column_width - ptc$time_length,
                    report_entry_p^.field_vector [index].column_width) := date_time_string.value;
            ELSE {ptv$time_increment_format = 'SECONDS'

              STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                    report_entry_p^.field_vector [index].column_width),
                    ptv$output_line_length, $REAL (report_entry_p^.field_vector [index].field_p^.
                    field_summary.maximum) * 0.001: report_entry_p^.field_vector [index].
                    column_width: ptv$counter_fraction);

            IFEND;
          IFEND;

        ELSE { Other numeric field types have integer valued data

          write_field_number (report_entry_p^.field_vector [index].field_p^.field_summary.maximum,
                report_entry_p^.field_vector [index], status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        CASEND;

      = interval =
        ptv$interval.millisecond := report_entry_p^.field_vector [index].field_p^.field_summary.interval;
        IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
          pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          clp$convert_date_time_to_string (clt_date_time, date_time_format_i, date_time_string, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          ptv$output_line (report_entry_p^.field_vector [index].
                start_column + report_entry_p^.field_vector [index].column_width - ptc$time_length,
                report_entry_p^.field_vector [index].column_width) := date_time_string.value (1, * );
        ELSE { ptv$time_increment_format = 'SECONDS'
          STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                report_entry_p^.field_vector [index].column_width), ptv$output_line_length,
                ($REAL (ptv$interval.millisecond) * 0.001): report_entry_p^.field_vector [index].
                column_width: 3);
        IFEND;

      = count_per_second =
        STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
              report_entry_p^.field_vector [index].column_width), ptv$output_line_length,
              report_entry_p^.field_vector [index].field_p^.field_summary.count_per_second: report_entry_p^.
              field_vector [index].column_width: ptv$counter_fraction);

      = sum_per_second =
        IF NOT report_entry_p^.field_vector [index].field_p^.field_summary.sum_overflow THEN
          STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                report_entry_p^.field_vector [index].column_width), ptv$output_line_length,
                report_entry_p^.field_vector [index].field_p^.field_summary.sum_per_second: report_entry_p^.
                field_vector [index].column_width: ptv$counter_fraction);
        ELSE
          ptv$output_line (report_entry_p^.field_vector [index].
                start_column, report_entry_p^.field_vector [index].column_width) := ptc$stars;
        IFEND;

      = elapsed_time_since_predecessor =
        ptv$interval.millisecond := report_entry_p^.field_vector [index].field_p^.field_summary.
              elapsed_time_since_predecessor;
        IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
          pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          clp$convert_date_time_to_string (clt_date_time, date_time_format_i, date_time_string, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          ptv$output_line (report_entry_p^.field_vector [index].
                start_column + report_entry_p^.field_vector [index].column_width - ptc$time_length,
                report_entry_p^.field_vector [index].column_width) := date_time_string.value (1, * );
        ELSE { ptv$time_increment_format = 'SECONDS'
          STRINGREP (ptv$output_line (report_entry_p^.field_vector [index].start_column,
                report_entry_p^.field_vector [index].column_width), ptv$output_line_length,
                ($REAL (ptv$interval.millisecond) * 0.001): report_entry_p^.field_vector [index].
                column_width: 3);
        IFEND;

      = text =
        IF report_entry_p^.field_vector [index].field_p^.descriptive_text_p <> NIL THEN
          ptv$output_line (report_entry_p^.field_vector [index].
                start_column, report_entry_p^.field_vector [index].column_width) :=
                report_entry_p^.field_vector [index].field_p^.descriptive_text_p^;
        IFEND;

      ELSE
      CASEND;

      IF output_line_length < (report_entry_p^.field_vector [index].start_column +
            report_entry_p^.field_vector [index].column_width - 1) THEN
        output_line_length := report_entry_p^.field_vector [index].start_column +
              report_entry_p^.field_vector [index].column_width - 1;
      IFEND;

      index := index + 1;
    WHILEND;

{  Prepare final format of line

    IF ptv$excel THEN
      convert_output_line_to_excel (report_entry_p, ptv$output_line, ptv$output_line, ptv$output_line_length);
    ELSE
      ptv$output_line_length := clp$trimmed_string_size (ptv$output_line (1, output_line_length));
    IFEND;

{  Put line to output file

    cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

  PROCEND write_field_report;

?? OLDTITLE ??
?? NEWTITLE := 'write_interval_header', EJECT ??

{ PURPOSE:
{   The purpose of this request is to write the report headers for an interval field report and
{ all_occurrences field report.

  PROCEDURE write_interval_header
    (    report_entry_p: ^put_entry;
     VAR status: ost$status);

    status.normal := TRUE;

{ Print interval headers

    IF report_entry_p^.header_1 <> ' ' THEN
      IF ptv$excel THEN
        convert_output_line_to_excel (report_entry_p, report_entry_p^.header_1, ptv$output_line,
              ptv$output_line_length);
      ELSE
        ptv$output_line_length := clp$trimmed_string_size (report_entry_p^.header_1);
        ptv$output_line := report_entry_p^.header_1 (1, ptv$output_line_length);
      IFEND;
      cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    IFEND;

    IF report_entry_p^.header_2 <> ' ' THEN
      IF ptv$excel THEN
        convert_output_line_to_excel (report_entry_p, report_entry_p^.header_2, ptv$output_line,
              ptv$output_line_length);
      ELSE
        ptv$output_line_length := clp$trimmed_string_size (report_entry_p^.header_1);
        ptv$output_line := report_entry_p^.header_2 (1, ptv$output_line_length);
      IFEND;
      cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    IFEND;

  PROCEND write_interval_header;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] write_interval_field', EJECT ??

{ PURPOSE:
{   The purpose of this request is to write a field in an interval field report line.
{
{ DESIGN:
{   This procedure has two parts.  The first part computes the summary and the second converts the summary to
{ string and places it in the report field postion.
{   Report_entry_p^.report_interval is the number of values that the procedure compute the summary from.  For
{ descriptive field if report_interval > 1 the procedure uses the first value and skips the rest.  If the
{ field runs out of values the procedure deletes the field from the active_fields set and decrements the
{ number of active fields.

  PROCEDURE [INLINE] write_interval_field
    (    report_entry_field: field_record_type;
         index: integer;
         report_interval: integer;
     VAR active_fields: active_fields_set;
     VAR number_of_active_fields: integer;
     VAR field_value_entry: field_value_pointers;
     VAR end_date_time: ost$date_time;
     VAR status: ost$status);

    VAR
      loop_count: integer,
      clt_date_time: clt$date_time,
      counter_value_real: real,
      date_time_format_i: string (clc$max_date_time_form_string),
      date_time_string: ost$string,
      dd_size_value_real: real,
      elapsed_time_value_real: real,
      mean_v: real,
      number_of_counters_value_real: real,
      descriptive_p: ^sft$descriptive_data,
      standard_deviation_v: real,
      statistic_name: ost$name,
      task_id_index: string (ptc$task_id_index_string_size),
      task_id_seqno: string (ptc$task_id_seqno_string_size),
      temp_interval: pmt$time_increment,
      field_summary: field_summary_type,
      interval_counter: integer,
      interval_date_time: ost$date_time,
      interval_dd_size: integer,
      interval_elapsed_time: integer,
      interval_global_task_id: ost$global_task_id,
      interval_number_of_counters: integer,
      interval_statistic_code: sft$statistic_code,
      interval_system_job_name: jmt$system_supplied_name,
      interval_value_per_second: real,
      value_per_second_value_real: real,
      value_per_second_sum: real,
      value_per_second_minimum: real,
      value_per_second_maximum: real;

    status.normal := TRUE;
    clt_date_time.date_specified := FALSE;
    clt_date_time.time_specified := TRUE;
    date_time_format_i := 'H24:MM:SS.S1000';

    field_summary := ptv$initial_field_summary;
    value_per_second_sum := 0.0;
    value_per_second_minimum := ptc$max_real;
    value_per_second_maximum := 0.0;

    CASE report_entry_field.field_p^.field_type OF

    = counter_field =
      loop_count := 0;

    /report_counter_interval/
      WHILE (index IN active_fields) AND (loop_count < report_interval) DO

        loop_count := loop_count + 1;

        IF field_value_entry.first AND report_entry_field.field_p^.incremental THEN
          field_value_entry.first := FALSE;
          end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
          IF report_interval = 1 THEN
            ptv$output_line (report_entry_field.start_column, report_entry_field.column_width) := ptc$blanks;
            RETURN; {----->
          IFEND;
        ELSEIF (field_value_entry.counter_value_p^.value_array [field_value_entry.value_index + 1] >= 0) OR
              (report_entry_field.field_p^.allow_negative_increment) OR
              (NOT report_entry_field.field_p^.incremental) THEN

          field_value_entry.value_index := field_value_entry.value_index + 1;
          IF index = 1 THEN
            end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
          ELSE
            IF date_time_1_gt_date_time_2 (field_value_entry.date_time_p^.
                  value_array [field_value_entry.value_index], end_date_time ) THEN
              end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
            IFEND;
          IFEND;

          field_summary.count := field_summary.count + 1;
          CASE report_entry_field.summary OF

          = first_occurrence =
            IF field_summary.count = 1 THEN
              interval_counter := field_value_entry.counter_value_p^.
                    value_array [field_value_entry.value_index];
            IFEND;

          = count =

          = sum =
            field_summary.sum := field_summary.sum + field_value_entry.counter_value_p^.
                  value_array [field_value_entry.value_index];

          = mean =
            field_summary.sum := field_summary.sum + field_value_entry.counter_value_p^.
                  value_array [field_value_entry.value_index];

          = standard_deviation =
            field_summary.sum := field_summary.sum + field_value_entry.counter_value_p^.
                  value_array [field_value_entry.value_index];
            counter_value_real := $REAL (field_value_entry.counter_value_p^.
                  value_array [field_value_entry.value_index]);
            field_summary.square_sum := field_summary.square_sum + counter_value_real * counter_value_real;

          = minimum =
            IF field_summary.minimum > field_value_entry.counter_value_p^.
                  value_array [field_value_entry.value_index] THEN
              field_summary.minimum := field_value_entry.counter_value_p^.
                    value_array [field_value_entry.value_index];
            IFEND;

          = maximum =
            IF field_summary.maximum < field_value_entry.counter_value_p^.
                  value_array [field_value_entry.value_index] THEN
              field_summary.maximum := field_value_entry.counter_value_p^.
                    value_array [field_value_entry.value_index];
            IFEND;

          = interval, count_per_second, sum_per_second =
            IF (field_value_entry.skip_date_time_p <> NIL) AND
                  (field_value_entry.skip_date_time_p^.date_time_after_skip =
                  field_value_entry.date_time_p^.value_array [field_value_entry.value_index]) THEN
              pmp$compute_date_time_increment (field_value_entry.last_date_time,
                    field_value_entry.skip_date_time_p^.skip_date_time, temp_interval, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;
              field_value_entry.lost_interval := field_value_entry.lost_interval +
                    interval_to_millisecond (temp_interval);
              field_value_entry.skip_date_time_p := field_value_entry.skip_date_time_p^.link_p;
            IFEND;

            field_value_entry.last_date_time := field_value_entry.date_time_p^.
                  value_array [field_value_entry.value_index];

            IF report_entry_field.summary = sum_per_second THEN
              field_summary.sum := field_summary.sum + field_value_entry.counter_value_p^.
                    value_array [field_value_entry.value_index];
            IFEND;

          = elapsed_time_since_predecessor =
            pmp$compute_date_time_increment (field_value_entry.predecessor_date_time_p^.
                  value_array [field_value_entry.value_index], field_value_entry.date_time_p^.
                  value_array [field_value_entry.value_index], temp_interval, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            field_summary.elapsed_time_since_predecessor := field_summary.elapsed_time_since_predecessor +
                  interval_to_millisecond (temp_interval);
            IF field_value_entry.value_index = field_value_entry.counter_value_p^.index THEN
              field_value_entry.predecessor_date_time_p := field_value_entry.predecessor_date_time_p^.link_p;
            IFEND;

          ELSE
          CASEND;

        ELSE { Incremental counter value is negative with no negative increment allowed
          field_value_entry.value_index := field_value_entry.value_index + 1;

        IFEND;

        IF field_value_entry.value_index = field_value_entry.counter_value_p^.index THEN
          IF field_value_entry.counter_value_p^.link_p <> NIL THEN
            field_value_entry.counter_value_p := field_value_entry.counter_value_p^.link_p;
            field_value_entry.date_time_p := field_value_entry.date_time_p^.link_p;
            field_value_entry.value_index := 0;
          ELSE
            active_fields := active_fields - $active_fields_set [index];
            number_of_active_fields := number_of_active_fields - 1;
          IFEND;
        IFEND;

      WHILEND /report_counter_interval/;

    = descriptive_data_field =

    /report_descriptive_interval/
      WHILE (index IN active_fields) AND (field_summary.count < report_interval) DO

        field_summary.count := field_summary.count + 1;
        field_value_entry.value_index := field_value_entry.value_index + 1;

        IF index = 1 THEN
          end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
        ELSE
          IF date_time_1_gt_date_time_2 (field_value_entry.date_time_p^.
                value_array [field_value_entry.value_index], end_date_time ) THEN
            end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
          IFEND;
        IFEND;

        IF field_summary.count = 1 THEN
          descriptive_p := field_value_entry.descriptive_value_p^.value_array [field_value_entry.value_index];
        IFEND;

        IF report_entry_field.summary = count_per_second THEN
          IF (field_value_entry.skip_date_time_p <> NIL) AND
                (field_value_entry.skip_date_time_p^.date_time_after_skip =
                field_value_entry.date_time_p^.value_array [field_value_entry.value_index]) THEN
            pmp$compute_date_time_increment (field_value_entry.last_date_time,
                  field_value_entry.skip_date_time_p^.skip_date_time, temp_interval, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            field_value_entry.lost_interval := field_value_entry.lost_interval +
                  interval_to_millisecond (temp_interval);
            field_value_entry.skip_date_time_p := field_value_entry.skip_date_time_p^.link_p;
          IFEND;

          field_value_entry.last_date_time := field_value_entry.date_time_p^.
                value_array [field_value_entry.value_index];
        IFEND;

        IF field_value_entry.value_index = field_value_entry.descriptive_value_p^.index THEN
          IF field_value_entry.descriptive_value_p^.link_p <> NIL THEN
            field_value_entry.descriptive_value_p := field_value_entry.descriptive_value_p^.link_p;
            field_value_entry.date_time_p := field_value_entry.date_time_p^.link_p;
            field_value_entry.value_index := 0;
          ELSE
            active_fields := active_fields - $active_fields_set [index];
            number_of_active_fields := number_of_active_fields - 1;
          IFEND;
        IFEND;

      WHILEND /report_descriptive_interval/;

    = date_time_field =

    /report_date_time_interval/
      WHILE (index IN active_fields) AND (field_summary.count < report_interval) DO

        field_summary.count := field_summary.count + 1;
        field_value_entry.value_index := field_value_entry.value_index + 1;

        IF index = 1 THEN
          end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
        ELSE
          IF date_time_1_gt_date_time_2 (field_value_entry.date_time_p^.
                value_array [field_value_entry.value_index], end_date_time ) THEN
            end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
          IFEND;
        IFEND;

        IF field_summary.count = 1 THEN
          interval_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
        IFEND;

        IF report_entry_field.summary = count_per_second THEN
          IF (field_value_entry.skip_date_time_p <> NIL) AND
                (field_value_entry.skip_date_time_p^.date_time_after_skip =
                field_value_entry.date_time_p^.value_array [field_value_entry.value_index]) THEN
            pmp$compute_date_time_increment (field_value_entry.last_date_time,
                  field_value_entry.skip_date_time_p^.skip_date_time, temp_interval, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            field_value_entry.lost_interval := field_value_entry.lost_interval +
                  interval_to_millisecond (temp_interval);
            field_value_entry.skip_date_time_p := field_value_entry.skip_date_time_p^.link_p;
          IFEND;

          field_value_entry.last_date_time := field_value_entry.date_time_p^.
                value_array [field_value_entry.value_index];
        IFEND;

        IF field_value_entry.value_index = field_value_entry.date_time_p^.index THEN
          IF field_value_entry.date_time_p^.link_p <> NIL THEN
            field_value_entry.date_time_p := field_value_entry.date_time_p^.link_p;
            field_value_entry.value_index := 0;
          ELSE
            active_fields := active_fields - $active_fields_set [index];
            number_of_active_fields := number_of_active_fields - 1;
          IFEND;
        IFEND;

      WHILEND /report_date_time_interval/;

    = statistic_code_field =

    /report_statistic_code_interval/
      WHILE (index IN active_fields) AND (field_summary.count < report_interval) DO

        field_summary.count := field_summary.count + 1;
        field_value_entry.value_index := field_value_entry.value_index + 1;

        IF index = 1 THEN
          end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
        ELSE
          IF date_time_1_gt_date_time_2 (field_value_entry.date_time_p^.
                value_array [field_value_entry.value_index], end_date_time ) THEN
            end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
          IFEND;
        IFEND;

        IF field_summary.count = 1 THEN
          interval_statistic_code := field_value_entry.statistic_code_value_p^.
                value_array [field_value_entry.value_index];
        IFEND;

        IF report_entry_field.summary = count_per_second THEN
          IF (field_value_entry.skip_date_time_p <> NIL) AND
                (field_value_entry.skip_date_time_p^.date_time_after_skip =
                field_value_entry.date_time_p^.value_array [field_value_entry.value_index]) THEN
            pmp$compute_date_time_increment (field_value_entry.last_date_time,
                  field_value_entry.skip_date_time_p^.skip_date_time, temp_interval, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            field_value_entry.lost_interval := field_value_entry.lost_interval +
                  interval_to_millisecond (temp_interval);
            field_value_entry.skip_date_time_p := field_value_entry.skip_date_time_p^.link_p;
          IFEND;

          field_value_entry.last_date_time := field_value_entry.date_time_p^.
                value_array [field_value_entry.value_index];
        IFEND;

        IF field_value_entry.value_index = field_value_entry.statistic_code_value_p^.index THEN
          IF field_value_entry.statistic_code_value_p^.link_p <> NIL THEN
            field_value_entry.statistic_code_value_p := field_value_entry.statistic_code_value_p^.link_p;
            field_value_entry.date_time_p := field_value_entry.date_time_p^.link_p;
            field_value_entry.value_index := 0;
          ELSE
            active_fields := active_fields - $active_fields_set [index];
            number_of_active_fields := number_of_active_fields - 1;
          IFEND;
        IFEND;

      WHILEND /report_statistic_code_interval/;

    = system_job_name_field =

    /report_system_job_name_interval/
      WHILE (index IN active_fields) AND (field_summary.count < report_interval) DO

        field_summary.count := field_summary.count + 1;
        field_value_entry.value_index := field_value_entry.value_index + 1;

        IF index = 1 THEN
          end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
        ELSE
          IF date_time_1_gt_date_time_2 (field_value_entry.date_time_p^.
                value_array [field_value_entry.value_index], end_date_time ) THEN
            end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
          IFEND;
        IFEND;

        IF field_summary.count = 1 THEN
          interval_system_job_name := field_value_entry.system_job_name_value_p^.
                value_array [field_value_entry.value_index];
        IFEND;

        IF report_entry_field.summary = count_per_second THEN
          IF (field_value_entry.skip_date_time_p <> NIL) AND
                (field_value_entry.skip_date_time_p^.date_time_after_skip =
                field_value_entry.date_time_p^.value_array [field_value_entry.value_index]) THEN
            pmp$compute_date_time_increment (field_value_entry.last_date_time,
                  field_value_entry.skip_date_time_p^.skip_date_time, temp_interval, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            field_value_entry.lost_interval := field_value_entry.lost_interval +
                  interval_to_millisecond (temp_interval);
            field_value_entry.skip_date_time_p := field_value_entry.skip_date_time_p^.link_p;
          IFEND;

          field_value_entry.last_date_time := field_value_entry.date_time_p^.
                value_array [field_value_entry.value_index];
        IFEND;

        IF field_value_entry.value_index = field_value_entry.system_job_name_value_p^.index THEN
          IF field_value_entry.system_job_name_value_p^.link_p <> NIL THEN
            field_value_entry.system_job_name_value_p := field_value_entry.system_job_name_value_p^.link_p;
            field_value_entry.date_time_p := field_value_entry.date_time_p^.link_p;
            field_value_entry.value_index := 0;
          ELSE
            active_fields := active_fields - $active_fields_set [index];
            number_of_active_fields := number_of_active_fields - 1;
          IFEND;
        IFEND;

      WHILEND /report_system_job_name_interval/;

    = global_task_id_field =

    /report_global_task_id_interval/
      WHILE (index IN active_fields) AND (field_summary.count < report_interval) DO

        field_summary.count := field_summary.count + 1;
        field_value_entry.value_index := field_value_entry.value_index + 1;

        IF index = 1 THEN
          end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
        ELSE
          IF date_time_1_gt_date_time_2 (field_value_entry.date_time_p^.
                value_array [field_value_entry.value_index], end_date_time ) THEN
            end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
          IFEND;
        IFEND;

        IF field_summary.count = 1 THEN
          interval_global_task_id := field_value_entry.global_task_id_value_p^.
                value_array [field_value_entry.value_index];
        IFEND;

        IF report_entry_field.summary = count_per_second THEN
          IF (field_value_entry.skip_date_time_p <> NIL) AND
                (field_value_entry.skip_date_time_p^.date_time_after_skip =
                field_value_entry.date_time_p^.value_array [field_value_entry.value_index]) THEN
            pmp$compute_date_time_increment (field_value_entry.last_date_time,
                  field_value_entry.skip_date_time_p^.skip_date_time, temp_interval, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            field_value_entry.lost_interval := field_value_entry.lost_interval +
                  interval_to_millisecond (temp_interval);
            field_value_entry.skip_date_time_p := field_value_entry.skip_date_time_p^.link_p;
          IFEND;

          field_value_entry.last_date_time := field_value_entry.date_time_p^.
                value_array [field_value_entry.value_index];
        IFEND;

        IF field_value_entry.value_index = field_value_entry.global_task_id_value_p^.index THEN
          IF field_value_entry.global_task_id_value_p^.link_p <> NIL THEN
            field_value_entry.global_task_id_value_p := field_value_entry.global_task_id_value_p^.link_p;
            field_value_entry.date_time_p := field_value_entry.date_time_p^.link_p;
            field_value_entry.value_index := 0;
          ELSE
            active_fields := active_fields - $active_fields_set [index];
            number_of_active_fields := number_of_active_fields - 1;
          IFEND;
        IFEND;

      WHILEND /report_global_task_id_interval/;

    = number_of_counters_field =

    /report_number_of_cnts_interval/
      WHILE (index IN active_fields) AND (field_summary.count < report_interval) DO

        field_summary.count := field_summary.count + 1;
        field_value_entry.value_index := field_value_entry.value_index + 1;

        IF index = 1 THEN
          end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
        ELSE
          IF date_time_1_gt_date_time_2 (field_value_entry.date_time_p^.
                value_array [field_value_entry.value_index], end_date_time ) THEN
            end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
          IFEND;
        IFEND;

        CASE report_entry_field.summary OF

        = first_occurrence =
          IF field_summary.count = 1 THEN
            interval_number_of_counters := field_value_entry.number_of_counters_value_p^.
                  value_array [field_value_entry.value_index];
          IFEND;

        = count =

        = sum =
          field_summary.sum := field_summary.sum + field_value_entry.number_of_counters_value_p^.
                value_array [field_value_entry.value_index];

        = mean =
          field_summary.sum := field_summary.sum + field_value_entry.number_of_counters_value_p^.
                value_array [field_value_entry.value_index];

        = standard_deviation =
          field_summary.sum := field_summary.sum + field_value_entry.number_of_counters_value_p^.
                value_array [field_value_entry.value_index];
          number_of_counters_value_real := $REAL (field_value_entry.number_of_counters_value_p^.
                value_array [field_value_entry.value_index]);
          field_summary.square_sum := field_summary.square_sum + number_of_counters_value_real *
                number_of_counters_value_real;

        = minimum =
          IF field_summary.minimum > field_value_entry.number_of_counters_value_p^.
                value_array [field_value_entry.value_index] THEN
            field_summary.minimum := field_value_entry.number_of_counters_value_p^.
                  value_array [field_value_entry.value_index];
          IFEND;

        = maximum =
          IF field_summary.maximum < field_value_entry.number_of_counters_value_p^.
                value_array [field_value_entry.value_index] THEN
            field_summary.maximum := field_value_entry.number_of_counters_value_p^.
                  value_array [field_value_entry.value_index];
          IFEND;

        = interval, count_per_second, sum_per_second =
          IF (field_value_entry.skip_date_time_p <> NIL) AND
                (field_value_entry.skip_date_time_p^.date_time_after_skip =
                field_value_entry.date_time_p^.value_array [field_value_entry.value_index]) THEN
            pmp$compute_date_time_increment (field_value_entry.last_date_time,
                  field_value_entry.skip_date_time_p^.skip_date_time, temp_interval, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            field_value_entry.lost_interval := field_value_entry.lost_interval +
                  interval_to_millisecond (temp_interval);
            field_value_entry.skip_date_time_p := field_value_entry.skip_date_time_p^.link_p;
          IFEND;

          field_value_entry.last_date_time := field_value_entry.date_time_p^.
                value_array [field_value_entry.value_index];

          IF report_entry_field.summary = sum_per_second THEN
            field_summary.sum := field_summary.sum + field_value_entry.number_of_counters_value_p^.
                  value_array [field_value_entry.value_index];
          IFEND;

        = elapsed_time_since_predecessor =
          pmp$compute_date_time_increment (field_value_entry.predecessor_date_time_p^.
                value_array [field_value_entry.value_index], field_value_entry.date_time_p^.
                value_array [field_value_entry.value_index], temp_interval, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          field_summary.elapsed_time_since_predecessor := field_summary.elapsed_time_since_predecessor +
                interval_to_millisecond (temp_interval);
          IF field_value_entry.value_index = field_value_entry.number_of_counters_value_p^.index THEN
            field_value_entry.predecessor_date_time_p := field_value_entry.predecessor_date_time_p^.link_p;
          IFEND;

        ELSE
        CASEND;

        IF field_value_entry.value_index = field_value_entry.number_of_counters_value_p^.index THEN
          IF field_value_entry.number_of_counters_value_p^.link_p <> NIL THEN
            field_value_entry.number_of_counters_value_p := field_value_entry.number_of_counters_value_p^.
                  link_p;
            field_value_entry.date_time_p := field_value_entry.date_time_p^.link_p;
            field_value_entry.value_index := 0;
          ELSE
            active_fields := active_fields - $active_fields_set [index];
            number_of_active_fields := number_of_active_fields - 1;
          IFEND;
        IFEND;

      WHILEND /report_number_of_cnts_interval/;

    = descriptive_data_size_field =

    /report_dd_size_interval/
      WHILE (index IN active_fields) AND (field_summary.count < report_interval) DO

        field_summary.count := field_summary.count + 1;
        field_value_entry.value_index := field_value_entry.value_index + 1;

        IF index = 1 THEN
          end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
        ELSE
          IF date_time_1_gt_date_time_2 (field_value_entry.date_time_p^.
                value_array [field_value_entry.value_index], end_date_time ) THEN
            end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
          IFEND;
        IFEND;

        CASE report_entry_field.summary OF

        = first_occurrence =
          IF field_summary.count = 1 THEN
            interval_dd_size := field_value_entry.dd_size_value_p^.
                  value_array [field_value_entry.value_index];
          IFEND;

        = count =

        = sum =
          field_summary.sum := field_summary.sum + field_value_entry.dd_size_value_p^.
                value_array [field_value_entry.value_index];

        = mean =
          field_summary.sum := field_summary.sum + field_value_entry.dd_size_value_p^.
                value_array [field_value_entry.value_index];

        = standard_deviation =
          field_summary.sum := field_summary.sum + field_value_entry.dd_size_value_p^.
                value_array [field_value_entry.value_index];
          dd_size_value_real := $REAL (field_value_entry.dd_size_value_p^.
                value_array [field_value_entry.value_index]);
          field_summary.square_sum := field_summary.square_sum + dd_size_value_real * dd_size_value_real;

        = minimum =
          IF field_summary.minimum > field_value_entry.dd_size_value_p^.
                value_array [field_value_entry.value_index] THEN
            field_summary.minimum := field_value_entry.dd_size_value_p^.
                  value_array [field_value_entry.value_index];
          IFEND;

        = maximum =
          IF field_summary.maximum < field_value_entry.dd_size_value_p^.
                value_array [field_value_entry.value_index] THEN
            field_summary.maximum := field_value_entry.dd_size_value_p^.
                  value_array [field_value_entry.value_index];
          IFEND;

        = interval, count_per_second, sum_per_second =
          IF (field_value_entry.skip_date_time_p <> NIL) AND
                (field_value_entry.skip_date_time_p^.date_time_after_skip =
                field_value_entry.date_time_p^.value_array [field_value_entry.value_index]) THEN
            pmp$compute_date_time_increment (field_value_entry.last_date_time,
                  field_value_entry.skip_date_time_p^.skip_date_time, temp_interval, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            field_value_entry.lost_interval := field_value_entry.lost_interval +
                  interval_to_millisecond (temp_interval);
            field_value_entry.skip_date_time_p := field_value_entry.skip_date_time_p^.link_p;
          IFEND;

          field_value_entry.last_date_time := field_value_entry.date_time_p^.
                value_array [field_value_entry.value_index];

          IF report_entry_field.summary = sum_per_second THEN
            field_summary.sum := field_summary.sum + field_value_entry.dd_size_value_p^.
                  value_array [field_value_entry.value_index];
          IFEND;

        = elapsed_time_since_predecessor =
          pmp$compute_date_time_increment (field_value_entry.predecessor_date_time_p^.
                value_array [field_value_entry.value_index], field_value_entry.date_time_p^.
                value_array [field_value_entry.value_index], temp_interval, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          field_summary.elapsed_time_since_predecessor := field_summary.elapsed_time_since_predecessor +
                interval_to_millisecond (temp_interval);
          IF field_value_entry.value_index = field_value_entry.dd_size_value_p^.index THEN
            field_value_entry.predecessor_date_time_p := field_value_entry.predecessor_date_time_p^.link_p;
          IFEND;

        ELSE
        CASEND;

        IF field_value_entry.value_index = field_value_entry.dd_size_value_p^.index THEN
          IF field_value_entry.dd_size_value_p^.link_p <> NIL THEN
            field_value_entry.dd_size_value_p := field_value_entry.dd_size_value_p^.link_p;
            field_value_entry.date_time_p := field_value_entry.date_time_p^.link_p;
            field_value_entry.value_index := 0;
          ELSE
            active_fields := active_fields - $active_fields_set [index];
            number_of_active_fields := number_of_active_fields - 1;
          IFEND;
        IFEND;

      WHILEND /report_dd_size_interval/;

    = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =
      loop_count := 0;

    /report_elapsed_time_interval/
      WHILE (index IN active_fields) AND (loop_count < report_interval) DO

        loop_count := loop_count + 1;

        IF field_value_entry.first AND (report_entry_field.field_p^.field_type = previous_occurrence_field)
              THEN

          field_value_entry.first := FALSE;

          IF report_interval = 1 THEN
            ptv$output_line (report_entry_field.start_column, report_entry_field.column_width) := ptc$blanks;
            RETURN; {----->
          IFEND;
        ELSE

          field_value_entry.value_index := field_value_entry.value_index + 1;
          IF index = 1 THEN
            end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
          ELSE
            IF date_time_1_gt_date_time_2 (field_value_entry.date_time_p^.
                  value_array [field_value_entry.value_index], end_date_time ) THEN
              end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
            IFEND;
          IFEND;

          field_summary.count := field_summary.count + 1;
          CASE report_entry_field.summary OF

          = first_occurrence =
            IF field_summary.count = 1 THEN
              interval_elapsed_time := field_value_entry.elapsed_time_value_p^.
                    value_array [field_value_entry.value_index];
            IFEND;

          = count =

          = sum =
            field_summary.sum := field_summary.sum + field_value_entry.elapsed_time_value_p^.
                  value_array [field_value_entry.value_index];

          = mean =
            field_summary.sum := field_summary.sum + field_value_entry.elapsed_time_value_p^.
                  value_array [field_value_entry.value_index];

          = standard_deviation =
            field_summary.sum := field_summary.sum + field_value_entry.elapsed_time_value_p^.
                  value_array [field_value_entry.value_index];
            elapsed_time_value_real := $REAL (field_value_entry.elapsed_time_value_p^.
                  value_array [field_value_entry.value_index]);
            field_summary.square_sum := field_summary.square_sum + elapsed_time_value_real *
                  elapsed_time_value_real;

          = minimum =
            IF field_summary.minimum > field_value_entry.elapsed_time_value_p^.
                  value_array [field_value_entry.value_index] THEN
              field_summary.minimum := field_value_entry.elapsed_time_value_p^.
                    value_array [field_value_entry.value_index];
            IFEND;

          = maximum =
            IF field_summary.maximum < field_value_entry.elapsed_time_value_p^.
                  value_array [field_value_entry.value_index] THEN
              field_summary.maximum := field_value_entry.elapsed_time_value_p^.
                    value_array [field_value_entry.value_index];
            IFEND;

          = interval, count_per_second, sum_per_second =
            IF (field_value_entry.skip_date_time_p <> NIL) AND
                  (field_value_entry.skip_date_time_p^.date_time_after_skip =
                  field_value_entry.date_time_p^.value_array [field_value_entry.value_index]) THEN
              pmp$compute_date_time_increment (field_value_entry.last_date_time,
                    field_value_entry.skip_date_time_p^.skip_date_time, temp_interval, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;
              field_value_entry.lost_interval := field_value_entry.lost_interval +
                    interval_to_millisecond (temp_interval);
              field_value_entry.skip_date_time_p := field_value_entry.skip_date_time_p^.link_p;
            IFEND;

            field_value_entry.last_date_time := field_value_entry.date_time_p^.
                  value_array [field_value_entry.value_index];

            IF report_entry_field.summary = sum_per_second THEN
              field_summary.sum := field_summary.sum + field_value_entry.elapsed_time_value_p^.
                    value_array [field_value_entry.value_index];
            IFEND;

          = elapsed_time_since_predecessor =
            pmp$compute_date_time_increment (field_value_entry.predecessor_date_time_p^.
                  value_array [field_value_entry.value_index], field_value_entry.date_time_p^.
                  value_array [field_value_entry.value_index], temp_interval, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            field_summary.elapsed_time_since_predecessor := field_summary.elapsed_time_since_predecessor +
                  interval_to_millisecond (temp_interval);
            IF field_value_entry.value_index = field_value_entry.elapsed_time_value_p^.index THEN
              field_value_entry.predecessor_date_time_p := field_value_entry.predecessor_date_time_p^.link_p;
            IFEND;

          ELSE
          CASEND;
        IFEND;

        IF field_value_entry.value_index = field_value_entry.elapsed_time_value_p^.index THEN
          IF field_value_entry.elapsed_time_value_p^.link_p <> NIL THEN
            field_value_entry.elapsed_time_value_p := field_value_entry.elapsed_time_value_p^.link_p;
            field_value_entry.date_time_p := field_value_entry.date_time_p^.link_p;
            field_value_entry.value_index := 0;
          ELSE
            active_fields := active_fields - $active_fields_set [index];
            number_of_active_fields := number_of_active_fields - 1;
          IFEND;
        IFEND;

      WHILEND /report_elapsed_time_interval/;

    = value_per_second_field, occurrence_per_second_field =
      loop_count := 0;

    /report_value_per_sec_interval/
      WHILE (index IN active_fields) AND (loop_count < report_interval) DO

        loop_count := loop_count + 1;

        IF field_value_entry.first AND ((report_entry_field.field_p^.incremental) OR
              (report_entry_field.field_p^.elapsed_time = previous_occurrence)) THEN

          field_value_entry.first := FALSE;
          IF report_interval = 1 THEN
            ptv$output_line (report_entry_field.start_column, report_entry_field.column_width) := ptc$blanks;
            RETURN; {----->
          IFEND;

        ELSEIF (field_value_entry.value_per_second_value_p^.value_array [field_value_entry.value_index + 1] >=
              0.0) OR (report_entry_field.field_p^.allow_negative_increment) OR
              (NOT report_entry_field.field_p^.incremental) THEN

          field_value_entry.value_index := field_value_entry.value_index + 1;
          IF index = 1 THEN
            end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
          ELSE
            IF date_time_1_gt_date_time_2 (field_value_entry.date_time_p^.
                  value_array [field_value_entry.value_index], end_date_time ) THEN
              end_date_time := field_value_entry.date_time_p^.value_array [field_value_entry.value_index];
            IFEND;
          IFEND;

          field_summary.count := field_summary.count + 1;
          CASE report_entry_field.summary OF

          = first_occurrence =
            IF field_summary.count = 1 THEN
              interval_value_per_second := field_value_entry.value_per_second_value_p^.
                    value_array [field_value_entry.value_index];
            IFEND;

          = count =

          = sum =
            value_per_second_sum := value_per_second_sum + field_value_entry.value_per_second_value_p^.
                  value_array [field_value_entry.value_index];

          = mean =
            value_per_second_sum := value_per_second_sum + field_value_entry.value_per_second_value_p^.
                  value_array [field_value_entry.value_index];

          = standard_deviation =
            value_per_second_sum := value_per_second_sum + field_value_entry.value_per_second_value_p^.
                  value_array [field_value_entry.value_index];
            value_per_second_value_real := $REAL (field_value_entry.value_per_second_value_p^.
                  value_array [field_value_entry.value_index]);
            field_summary.square_sum := field_summary.square_sum + value_per_second_value_real *
                  value_per_second_value_real;

          = minimum =
            IF value_per_second_minimum > field_value_entry.value_per_second_value_p^.
                  value_array [field_value_entry.value_index] THEN
              value_per_second_minimum := field_value_entry.value_per_second_value_p^.
                    value_array [field_value_entry.value_index];
            IFEND;

          = maximum =
            IF value_per_second_maximum < field_value_entry.value_per_second_value_p^.
                  value_array [field_value_entry.value_index] THEN
              value_per_second_maximum := field_value_entry.value_per_second_value_p^.
                    value_array [field_value_entry.value_index];
            IFEND;

          = interval, count_per_second, sum_per_second =
            IF (field_value_entry.skip_date_time_p <> NIL) AND
                  (field_value_entry.skip_date_time_p^.date_time_after_skip =
                  field_value_entry.date_time_p^.value_array [field_value_entry.value_index]) THEN
              pmp$compute_date_time_increment (field_value_entry.last_date_time,
                    field_value_entry.skip_date_time_p^.skip_date_time, temp_interval, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;
              field_value_entry.lost_interval := field_value_entry.lost_interval +
                    interval_to_millisecond (temp_interval);
              field_value_entry.skip_date_time_p := field_value_entry.skip_date_time_p^.link_p;
            IFEND;

            field_value_entry.last_date_time := field_value_entry.date_time_p^.
                  value_array [field_value_entry.value_index];

            IF report_entry_field.summary = sum_per_second THEN
              value_per_second_sum := value_per_second_sum + field_value_entry.value_per_second_value_p^.
                    value_array [field_value_entry.value_index];
            IFEND;

          = elapsed_time_since_predecessor =
            pmp$compute_date_time_increment (field_value_entry.predecessor_date_time_p^.
                  value_array [field_value_entry.value_index], field_value_entry.date_time_p^.
                  value_array [field_value_entry.value_index], temp_interval, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            field_summary.elapsed_time_since_predecessor := field_summary.elapsed_time_since_predecessor +
                  interval_to_millisecond (temp_interval);
            IF field_value_entry.value_index = field_value_entry.value_per_second_value_p^.index THEN
              field_value_entry.predecessor_date_time_p := field_value_entry.predecessor_date_time_p^.link_p;
            IFEND;

          ELSE
          CASEND;

        ELSE { Incremental value is negative with no negative increment allowed
          field_value_entry.value_index := field_value_entry.value_index + 1;

        IFEND;

        IF field_value_entry.value_index = field_value_entry.value_per_second_value_p^.index THEN
          IF field_value_entry.value_per_second_value_p^.link_p <> NIL THEN
            field_value_entry.value_per_second_value_p := field_value_entry.value_per_second_value_p^.link_p;
            field_value_entry.date_time_p := field_value_entry.date_time_p^.link_p;
            field_value_entry.value_index := 0;
          ELSE
            active_fields := active_fields - $active_fields_set [index];
            number_of_active_fields := number_of_active_fields - 1;
          IFEND;
        IFEND;

      WHILEND /report_value_per_sec_interval/;

    = text_field =

    CASEND;

    IF field_summary.count > 0 THEN

      CASE report_entry_field.summary OF

      = first_occurrence =

        CASE report_entry_field.field_p^.field_type OF

        = counter_field =
          write_field_number (interval_counter, report_entry_field, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

        = descriptive_data_field =

          IF descriptive_p <> NIL THEN
            ptv$output_line (report_entry_field.start_column, report_entry_field.column_width) :=
                  descriptive_p^ (1, * );
          IFEND;

        = date_time_field =
          ptv$clt_date_time.value := interval_date_time;

          clp$convert_date_time_to_string (ptv$clt_date_time, ptv$date_time_format, date_time_string, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          ptv$output_line (report_entry_field.start_column, report_entry_field.column_width) :=
                date_time_string.value;

        = statistic_code_field =
          sfp$convert_stat_code_to_name (interval_statistic_code, statistic_name, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          ptv$output_line (report_entry_field.start_column, report_entry_field.column_width) :=
                statistic_name;

        = system_job_name_field =

          ptv$output_line (report_entry_field.start_column, report_entry_field.column_width) :=
                interval_system_job_name;

        = global_task_id_field =

          clp$convert_integer_to_rjstring (interval_global_task_id.index, 10, FALSE, '0', task_id_index,
                status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          clp$convert_integer_to_rjstring (interval_global_task_id.seqno, 10, FALSE, '0', task_id_seqno,
                status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                ptv$output_line_length, task_id_index, '-', task_id_seqno);

        = number_of_counters_field =

          clp$convert_integer_to_rjstring (interval_number_of_counters, 10, FALSE, ' ',
                ptv$output_line (report_entry_field.start_column, report_entry_field.column_width), status);

        = descriptive_data_size_field =

          clp$convert_integer_to_rjstring (interval_dd_size, 10, FALSE, ' ',
                ptv$output_line (report_entry_field.start_column, report_entry_field.column_width), status);

        = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =

          IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
            ptv$interval.millisecond := interval_elapsed_time;

            pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

            clp$convert_date_time_to_string (clt_date_time, ptv$dt_format_for_increment, date_time_string,
                  status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

            ptv$output_line (report_entry_field.start_column + report_entry_field.column_width -
                  ptc$time_length, report_entry_field.column_width) := date_time_string.value;
          ELSE {ptv$time_increment_format = 'SECONDS'

            STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                  ptv$output_line_length, $REAL (interval_elapsed_time) *
                  0.001: report_entry_field.column_width: 3);

          IFEND;

        = value_per_second_field, occurrence_per_second_field =

          STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                ptv$output_line_length, interval_value_per_second * report_entry_field.field_p^.multiplier *
                1000.0: report_entry_field.column_width: ptv$counter_fraction);

        = text_field =

        CASEND;

      = count =
        clp$convert_integer_to_rjstring (field_summary.count, 10, FALSE, ' ',
              ptv$output_line (report_entry_field.start_column, report_entry_field.column_width), status);
        IF NOT status.normal THEN
          IF status.condition = cle$string_too_short THEN
            ptv$output_line (report_entry_field.start_column, report_entry_field.column_width) := ptc$stars;
            status.normal := TRUE;
          ELSE
            RETURN; {----->
          IFEND;
        IFEND;

      = sum =

        CASE report_entry_field.field_p^.field_type OF

        = value_per_second_field, occurrence_per_second_field =

          STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                ptv$output_line_length, value_per_second_sum * report_entry_field.field_p^.multiplier *
                1000.0: report_entry_field.column_width: ptv$counter_fraction);

        = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =

          IF field_summary.count > 0 THEN
            IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
              ptv$interval.millisecond := field_summary.sum;

              pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              clp$convert_date_time_to_string (clt_date_time, ptv$dt_format_for_increment, date_time_string,
                    status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              ptv$output_line (report_entry_field.start_column + report_entry_field.column_width -
                    ptc$time_length, report_entry_field.column_width) := date_time_string.value;
            ELSE {ptv$time_increment_format = 'SECONDS'

              STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                    ptv$output_line_length, $REAL (field_summary.sum) *
                    0.001: report_entry_field.column_width: ptv$counter_fraction);

            IFEND;
          IFEND;

        ELSE { Other numeric field types have integer valued data

          write_field_number (field_summary.sum, report_entry_field, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        CASEND;

      = mean =

        CASE report_entry_field.field_p^.field_type OF

        = value_per_second_field, occurrence_per_second_field =

          IF field_summary.count > 0 THEN

            mean_v := value_per_second_sum / $REAL (field_summary.count);

            STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                  ptv$output_line_length, mean_v * report_entry_field.field_p^.multiplier *
                  1000.0: report_entry_field.column_width: ptv$counter_fraction);
          IFEND;

        = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =

          IF field_summary.count > 0 THEN

            mean_v := $REAL (field_summary.sum) / $REAL (field_summary.count);
            IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
              ptv$interval.millisecond := $INTEGER (mean_v);

              pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              clp$convert_date_time_to_string (clt_date_time, ptv$dt_format_for_increment, date_time_string,
                    status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              ptv$output_line (report_entry_field.start_column + report_entry_field.column_width -
                    ptc$time_length, report_entry_field.column_width) := date_time_string.value;
            ELSE {ptv$time_increment_format = 'SECONDS'

              STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                    ptv$output_line_length, mean_v * 0.001: report_entry_field.column_width:
                    ptv$counter_fraction);

            IFEND;
          IFEND;

        ELSE
          IF field_summary.count > 0 THEN

            mean_v := $REAL (field_summary.sum) / $REAL (field_summary.count);

            STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                  ptv$output_line_length, mean_v * report_entry_field.field_p^.multiplier: report_entry_field.
                  column_width: ptv$counter_fraction);

          IFEND;
        CASEND;

      = standard_deviation =

        CASE report_entry_field.field_p^.field_type OF

        = value_per_second_field, occurrence_per_second_field =

          IF field_summary.count > 1 THEN

            mean_v := value_per_second_sum / $REAL (field_summary.count);
            standard_deviation_v := (field_summary.square_sum + mean_v * mean_v *
                  $REAL (field_summary.count) - 2.0 * mean_v * value_per_second_sum) /
                  $REAL (field_summary.count - 1);
            standard_deviation_v := mlp$rsqrt (standard_deviation_v);

            STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                  ptv$output_line_length, standard_deviation_v * report_entry_field.field_p^.multiplier *
                  1000.0: report_entry_field.column_width: ptv$counter_fraction);
          IFEND;

        = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =

          IF field_summary.count > 1 THEN

            mean_v := $REAL (field_summary.sum) / $REAL (field_summary.count);
            standard_deviation_v := (field_summary.square_sum + mean_v * mean_v *
                  $REAL (field_summary.count) - 2.0 * mean_v * $REAL (field_summary.sum)) /
                  $REAL (field_summary.count - 1);
            standard_deviation_v := mlp$rsqrt (standard_deviation_v);

            IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
              ptv$interval.millisecond := $INTEGER (standard_deviation_v);

              pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              clp$convert_date_time_to_string (clt_date_time, ptv$dt_format_for_increment, date_time_string,
                    status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              ptv$output_line (report_entry_field.start_column + report_entry_field.column_width -
                    ptc$time_length, report_entry_field.column_width) := date_time_string.value;
            ELSE {ptv$time_increment_format = 'SECONDS'

              STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                    ptv$output_line_length, standard_deviation_v *
                    0.001: report_entry_field.column_width: ptv$counter_fraction);

            IFEND;
          IFEND;

        ELSE

          IF field_summary.count > 1 THEN

            mean_v := $REAL (field_summary.sum) / $REAL (field_summary.count);
            standard_deviation_v := (field_summary.square_sum + mean_v * mean_v *
                  $REAL (field_summary.count) - 2.0 * mean_v * $REAL (field_summary.sum)) /
                  $REAL (field_summary.count - 1);
            standard_deviation_v := mlp$rsqrt (standard_deviation_v);

            STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                  ptv$output_line_length, standard_deviation_v *
                  report_entry_field.field_p^.multiplier: report_entry_field.column_width:
                  ptv$counter_fraction);

          IFEND;
        CASEND;

      = minimum =

        CASE report_entry_field.field_p^.field_type OF

        = value_per_second_field, occurrence_per_second_field =

          STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                ptv$output_line_length, value_per_second_minimum * report_entry_field.field_p^.multiplier *
                1000.0: report_entry_field.column_width: ptv$counter_fraction);

        = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =

          IF field_summary.count > 0 THEN
            IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
              ptv$interval.millisecond := field_summary.minimum;

              pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              clp$convert_date_time_to_string (clt_date_time, ptv$dt_format_for_increment, date_time_string,
                    status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              ptv$output_line (report_entry_field.start_column + report_entry_field.column_width -
                    ptc$time_length, report_entry_field.column_width) := date_time_string.value;
            ELSE {ptv$time_increment_format = 'SECONDS'

              STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                    ptv$output_line_length, $REAL (field_summary.minimum) *
                    0.001: report_entry_field.column_width: ptv$counter_fraction);

            IFEND;
          IFEND;

        ELSE { Other numeric field types have integer valued data

          write_field_number (field_summary.minimum, report_entry_field, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        CASEND;

      = maximum =

        CASE report_entry_field.field_p^.field_type OF

        = value_per_second_field, occurrence_per_second_field =

          STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                ptv$output_line_length, value_per_second_maximum * report_entry_field.field_p^.multiplier *
                1000.0: report_entry_field.column_width: ptv$counter_fraction);

        = previous_occurrence_field, predecessor_field, predecessor_chain_head_field =

          IF field_summary.count > 0 THEN
            IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
              ptv$interval.millisecond := field_summary.maximum;

              pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              clp$convert_date_time_to_string (clt_date_time, ptv$dt_format_for_increment, date_time_string,
                    status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              ptv$output_line (report_entry_field.start_column + report_entry_field.column_width -
                    ptc$time_length, report_entry_field.column_width) := date_time_string.value;
            ELSE {ptv$time_increment_format = 'SECONDS'

              STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                    ptv$output_line_length, $REAL (field_summary.maximum) *
                    0.001: report_entry_field.column_width: ptv$counter_fraction);

            IFEND;
          IFEND;

        ELSE { Other numeric field types have integer valued data

          write_field_number (field_summary.maximum, report_entry_field, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        CASEND;

      = interval, count_per_second, sum_per_second =

        pmp$compute_date_time_increment (field_value_entry.first_date_time, field_value_entry.last_date_time,
              temp_interval, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;

        field_summary.interval := (interval_to_millisecond (temp_interval) - field_value_entry.lost_interval);

        field_value_entry.first_date_time := field_value_entry.last_date_time;
        field_value_entry.lost_interval := 0;

        CASE report_entry_field.summary OF

        = interval =
          IF field_value_entry.first AND (field_summary.count > 1) THEN
            ptv$interval.millisecond := field_summary.interval DIV (field_summary.count - 1);
            field_value_entry.first := FALSE;
          ELSE
            ptv$interval.millisecond := field_summary.interval DIV (field_summary.count);
          IFEND;
          IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
            pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            clp$convert_date_time_to_string (clt_date_time, date_time_format_i, date_time_string, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            ptv$output_line (report_entry_field.start_column + report_entry_field.column_width -
                  ptc$time_length, report_entry_field.column_width) := date_time_string.value (1, * );
          ELSE { ptv$time_increment_format = 'SECONDS'
            STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                  ptv$output_line_length, ($REAL (ptv$interval.millisecond) *
                  0.001): report_entry_field.column_width: 3);
          IFEND;

        = count_per_second =
          IF field_summary.interval > 0 THEN
            STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                  ptv$output_line_length, ($REAL (field_summary.count) / $REAL (field_summary.interval) *
                  1000.0): report_entry_field.column_width: ptv$counter_fraction);
          IFEND;

        = sum_per_second =
          IF field_summary.interval > 0 THEN
            STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                  ptv$output_line_length, ($REAL (field_summary.sum) *
                  report_entry_field.field_p^.multiplier / $REAL (field_summary.interval) *
                  1000.0): report_entry_field.column_width: ptv$counter_fraction);
          IFEND;

        ELSE
        CASEND;

      = elapsed_time_since_predecessor =
        ptv$interval.millisecond := field_summary.elapsed_time_since_predecessor DIV field_summary.count;
        IF ptv$time_increment_format = 'TIME_INCREMENT' THEN
          pmp$compute_date_time (ptv$min_date_time, ptv$interval, clt_date_time.value, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          clp$convert_date_time_to_string (clt_date_time, date_time_format_i, date_time_string, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          ptv$output_line (report_entry_field.start_column + report_entry_field.column_width -
                ptc$time_length, report_entry_field.column_width) := date_time_string.value (1, * );
        ELSE { ptv$time_increment_format = 'SECONDS'
          STRINGREP (ptv$output_line (report_entry_field.start_column, report_entry_field.column_width),
                ptv$output_line_length, ($REAL (ptv$interval.millisecond) *
                0.001): report_entry_field.column_width: 3);
        IFEND;

      = text =
        IF descriptive_p <> NIL THEN
          ptv$output_line (report_entry_field.start_column, report_entry_field.column_width) :=
                descriptive_p^ (1, * );
        IFEND;

      ELSE
      CASEND;

    ELSE {field_summary.count = 0
      ptv$output_line (report_entry_field.start_column, report_entry_field.column_width) := ptc$blanks;

    IFEND;

  PROCEND write_interval_field;

?? OLDTITLE ??
?? NEWTITLE := 'write_interval_report', EJECT ??

{ PURPOSE:
{   The purpose of this request is to write an interval field report.
{
{ DESIGN:
{   The procedure receives a pointer to an interval field entry.  The procedure writes the report headers,
{ initializes the report and while there is at least one active field (field with value that was not written)
{ the procedure writes report lines.
{   The procedure scans all the fields with the index range 1..last_non_null_field.  If the field is active
{ the procedure calls write_interval_field.  If the field is not active but it is a string field then the
{ string is placed in the report line.  If the report row_label_type is start_time, end_time or time_range
{ then the procedure converts end_date_time to string.  The procedure adds the row_label to the report line
{ and writes the line into the output file.

  PROCEDURE write_interval_report
    (    report_entry_p: ^put_entry;
     VAR status: ost$status);

    VAR
      active_fields: active_fields_set,
      begin_date_time: ost$date_time,
      begin_date_time_string: ost$string,
      clt_date_time: [STATIC] clt$date_time := [ * , FALSE, TRUE],
      date_time_format_i: [STATIC] string (clc$max_date_time_form_string) := 'H24:MM:SS.S1000',
      date_time_string: ost$string,
      end_date_time: ost$date_time,
      end_date_time_string: ost$string,
      field_p: ^field,
      field_value_p: field_value_type,
      index: integer,
      last_non_null_field: integer,
      number_of_active_fields: integer,
      output_line_length: integer;

    status.normal := TRUE;
    end_date_time := ptv$min_date_time;

    write_interval_header (report_entry_p, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    initialize_write_interval (report_entry_p, active_fields, begin_date_time, field_value_p,
          last_non_null_field, number_of_active_fields, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF (report_entry_p^.row_label_type <> row_label_none) AND
          (report_entry_p^.row_label_type <> string_label) THEN
      ptv$clt_date_time.value := begin_date_time;
      clp$convert_date_time_to_string (ptv$clt_date_time, report_entry_p^.date_time_format_p^,
            begin_date_time_string, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    IFEND;

  /report/
    WHILE number_of_active_fields > 0 DO

{  Write one line of report
{    Initialize line

      ptv$output_line := '';
      output_line_length := 0;

    /line/

{  Format each field in report line

      FOR index := LOWERBOUND (field_vector_type) TO last_non_null_field DO
        IF index IN active_fields THEN

          write_interval_field (report_entry_p^.field_vector [index], index, report_entry_p^.report_interval,
                active_fields, number_of_active_fields, field_value_p [index], end_date_time, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

        ELSEIF report_entry_p^.field_vector [index].field_p^.field_type = text_field THEN
          { Field is a STRING. }
          ptv$output_line (report_entry_p^.field_vector [index].
                start_column, report_entry_p^.field_vector [index].column_width) :=
                report_entry_p^.field_vector [index].field_p^.descriptive_text_p^;
        IFEND;

        IF output_line_length < (report_entry_p^.field_vector [index].start_column +
              report_entry_p^.field_vector [index].column_width - 1) THEN
          output_line_length := report_entry_p^.field_vector [index].start_column +
                report_entry_p^.field_vector [index].column_width - 1;
        IFEND
      FOREND /line/;

{  Format row label of report line.  Is it date_time or a string?

      IF (report_entry_p^.row_label_type <> row_label_none) AND
            (report_entry_p^.row_label_type <> string_label) THEN

        ptv$clt_date_time.value := end_date_time;
        clp$convert_date_time_to_string (ptv$clt_date_time, report_entry_p^.date_time_format_p^,
              end_date_time_string, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;

        CASE report_entry_p^.row_label_type OF
        = start_time =
          ptv$output_line (report_entry_p^.date_time_start_column,
                report_entry_p^.date_time_column_width) := begin_date_time_string.value;

        = end_time =
          ptv$output_line (report_entry_p^.date_time_start_column,
                report_entry_p^.date_time_column_width) := end_date_time_string.value;

        = time_range =
          STRINGREP (ptv$output_line (report_entry_p^.date_time_start_column,
                report_entry_p^.date_time_column_width), ptv$output_line_length,
                begin_date_time_string.value (1, begin_date_time_string.size), ' .. ',
                end_date_time_string.value (1, end_date_time_string.size));

        ELSE
        CASEND;

        begin_date_time := end_date_time;
        begin_date_time_string := end_date_time_string;

      ELSEIF report_entry_p^.row_label_type = string_label THEN
        ptv$output_line (report_entry_p^.date_time_start_column,
              report_entry_p^.date_time_column_width) := report_entry_p^.row_label;
      IFEND;

{  Prepare final format of report line

      IF ptv$excel THEN
        convert_output_line_to_excel (report_entry_p, ptv$output_line, ptv$output_line,
              ptv$output_line_length);
      ELSE
        ptv$output_line_length := clp$trimmed_string_size (ptv$output_line (1, output_line_length));
      IFEND;

{  Output report line

      cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

    WHILEND /report/;

  PROCEND write_interval_report;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] write_statistic_header', EJECT ??

{ PURPOSE:
{   The purpose of this request is to convert a statistic header to a string for
{ write_statistic_to_legible_log and write_statistic_to_list_log.
{
{ DESIGN:
{   The procedure converts the statistic code, date_time, global task ID, number of counters and descriptive
{ data size to strings.  It concatenate the strings with system job name to form one string.

  PROCEDURE [INLINE] write_statistic_header
    (    statistic_header_p: ^sft$statistic_header;
         descriptive_data_length: integer;
     VAR output_line: string ( * );
     VAR output_line_length: integer;
     VAR status: ost$status);

    VAR
      counter: string (ptc$length_of_counter_field),
      date_time_string: ost$string,
      descriptive_data_length_string: string (ptc$ddl_string_size),
      number_of_counters_string: string (ptc$num_of_counter_string_size),
      statistic_name: ost$name,
      task_id_index: string (ptc$task_id_index_string_size),
      task_id_seqno: string (ptc$task_id_seqno_string_size);

    status.normal := TRUE;

    sfp$convert_stat_code_to_name (statistic_header_p^.statistic_code, statistic_name, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    ptv$clt_date_time.value := statistic_header_p^.date_time;
    clp$convert_date_time_to_string (ptv$clt_date_time, ptv$date_time_format, date_time_string, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    clp$convert_integer_to_rjstring (statistic_header_p^.task_id.index, 10, FALSE, '0', task_id_index,
          status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    clp$convert_integer_to_rjstring (statistic_header_p^.task_id.seqno, 10, FALSE, '0', task_id_seqno,
          status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF ptv$number_of_counters.float THEN
      clp$convert_integer_to_rjstring (statistic_header_p^.number_of_counters, 10, FALSE, ' ',
            number_of_counters_string, status);
    ELSE
      clp$convert_integer_to_rjstring (ptv$number_of_counters.number, 10, FALSE, ' ',
            number_of_counters_string, status);
    IFEND;
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF ptv$descriptive_data_size.float THEN
      clp$convert_integer_to_rjstring (descriptive_data_length, 10, FALSE, ' ',
            descriptive_data_length_string, status);
    ELSE
      clp$convert_integer_to_rjstring (ptv$descriptive_data_size.number, 10, FALSE, ' ',
            descriptive_data_length_string, status);
    IFEND;
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    STRINGREP (output_line, output_line_length, statistic_name (1, 7),
          '  ', date_time_string.value (1, date_time_string.size): date_time_string.size, '  ',
          statistic_header_p^.job_name, '  ', { job_name: jmt$system_supplied_name,   }
          task_id_index, '-', task_id_seqno, '  ', number_of_counters_string, '  ',
          descriptive_data_length_string);

  PROCEND write_statistic_header;

?? OLDTITLE ??
?? NEWTITLE := 'write_statistic_to_binary_log', EJECT ??

{ PURPOSE:
{  The purpose of this request is to write a statistic record into binary log file.
{
{ DESIGN:
{   The procedure receives 3 pointers:
{    -  pointer to the statistic header.
{    -  pointer to the counters array.
{    -  pointer to the descriptive data string.
{   If the statistic record is written into the output log without any changes from the input (number of
{ counters, descriptive data size etc.) then the procedure calls put_statistic_record with the original
{ pointers.  Otherwise  the procedure creates a new statistic record with 3 new pointers, copies the
{ data with the required changes from the input record into the output record and calls put_statistic_record
{ with the new pointers.
{
{ NOTE:
{ - The procedure processes the log_entry counter base to in order to write only the required counters.
{ - The procedure processes ptv$number_of_counter in order to write a fixed number of counters or a floating
{   number.
{   - If the number of counters is fixed and fewer than the number of available counters from the statistic
{     (after processing the log_entry counter base) the procedure ignores the extra counters.
{   - If the number of counters is fixed and more than the number of available counters from the statistic
{     (after processing the log_entry counter base) the procedure pads the output log with zero values.
{ - This procedure uses the base in the log_entry counter base only to delete counters (base 0).

  PROCEDURE write_statistic_to_binary_log
    (    log_entry_p: ^put_entry;
         statistic_header_p: ^sft$statistic_header;
         counters_p: sft$counters;
         descriptive_data_in_p: ^sft$descriptive_data;
     VAR status: ost$status);

    VAR
      counters_out_p: sft$counters,
      descriptive_data_length: integer,
      descriptive_data_out_p: ^sft$descriptive_data,
      descriptive_data_p: ^sft$descriptive_data,
      descriptive_data_start: integer,
      index: integer,
      log_header_out_p: ^bat$record_header,
      null_subfield: boolean,
      number_of_counters: integer,
      statistic_header_out_p: ^sft$statistic_header,
      substring_found: boolean;

    status.normal := TRUE;

    IF log_entry_p^.descriptive_text_p = NIL THEN
      descriptive_data_p := descriptive_data_in_p;
      get_descriptive_data_subfield (descriptive_data_p, statistic_header_p^.descriptive_data_size,
            log_entry_p^.subfield_position, log_entry_p^.subfield_length, log_entry_p^.subfield_number,
            log_entry_p^.subfield_delimiter, null_subfield, substring_found, descriptive_data_start,
            descriptive_data_length);
    ELSE
      descriptive_data_p := log_entry_p^.descriptive_text_p;
      descriptive_data_start := 1;
      descriptive_data_length := #SIZE (log_entry_p^.descriptive_text_p^);
    IFEND;

    IF ptv$number_of_counters.float AND ptv$descriptive_data_size.float AND
          NOT log_entry_p^.delete_counters AND (statistic_header_p^.descriptive_data_size =
          descriptive_data_length) THEN
      put_statistic_record (ptv$output_log_p, statistic_header_p, counters_p, descriptive_data_p, status);
    ELSE
      PUSH statistic_header_out_p;
      statistic_header_out_p^ := statistic_header_p^;
      IF ptv$number_of_counters.float AND NOT log_entry_p^.delete_counters THEN
        counters_out_p := counters_p;
      ELSEIF ptv$number_of_counters.float THEN

{ delete_counters

        number_of_counters := 0;
        FOR index := 1 TO statistic_header_p^.number_of_counters DO
          IF log_entry_p^.counter_base [index] <> base_0 THEN
            number_of_counters := number_of_counters + 1;
          IFEND;
        FOREND;
        statistic_header_out_p^.number_of_counters := number_of_counters;
        IF number_of_counters > 0 THEN
          PUSH counters_out_p: [1 .. statistic_header_out_p^.number_of_counters];
          number_of_counters := 1;
          FOR index := 1 TO statistic_header_p^.number_of_counters DO
            IF log_entry_p^.counter_base [index] <> base_0 THEN
              counters_out_p^ [number_of_counters] := counters_p^ [index];
              number_of_counters := number_of_counters + 1;
            IFEND;
          FOREND;
        ELSE
          counters_out_p := NIL;
        IFEND;
      ELSE
        statistic_header_out_p^.number_of_counters := ptv$number_of_counters.number;
        IF ptv$number_of_counters.number > 0 THEN
          PUSH counters_out_p: [1 .. statistic_header_out_p^.number_of_counters];
          index := 1;
          number_of_counters := 1;
          WHILE (number_of_counters <= ptv$number_of_counters.number) AND
                (index <= statistic_header_p^.number_of_counters) DO
            IF log_entry_p^.counter_base [index] <> base_0 THEN
              counters_out_p^ [number_of_counters] := counters_p^ [index];
              number_of_counters := number_of_counters + 1;
            IFEND;
            index := index + 1;
          WHILEND;
          FOR index := number_of_counters TO ptv$number_of_counters.number DO
            counters_out_p^ [index] := 0;
          FOREND;
        ELSE
          counters_out_p := NIL;
        IFEND;
      IFEND;

      IF ptv$descriptive_data_size.float THEN
        IF descriptive_data_length <> 0 THEN
          IF statistic_header_p^.descriptive_data_size = descriptive_data_length THEN
            descriptive_data_out_p := descriptive_data_p;
          ELSE
            statistic_header_out_p^.descriptive_data_size := ptv$descriptive_data_size.number;
            PUSH descriptive_data_out_p: [statistic_header_out_p^.descriptive_data_size];
            descriptive_data_out_p^ := descriptive_data_p^ (descriptive_data_start, descriptive_data_length);
          IFEND;
        IFEND;
      ELSE
        IF ptv$descriptive_data_size.number > 0 THEN
          statistic_header_out_p^.descriptive_data_size := ptv$descriptive_data_size.number;
          PUSH descriptive_data_out_p: [statistic_header_out_p^.descriptive_data_size];
          IF ptv$descriptive_data_size.number <= descriptive_data_length THEN
            descriptive_data_out_p^ := descriptive_data_p^ (descriptive_data_start,
                  ptv$descriptive_data_size.number);
          ELSEIF descriptive_data_length > 0 THEN
            descriptive_data_out_p^ := descriptive_data_p^ (descriptive_data_start, descriptive_data_length);
          ELSE
            descriptive_data_out_p^ := '';
          IFEND;
        ELSE
          statistic_header_out_p^.descriptive_data_size := 0;
          descriptive_data_out_p := NIL;
        IFEND;
      IFEND;

      put_statistic_record (ptv$output_log_p, statistic_header_out_p, counters_out_p, descriptive_data_out_p,
            status);
    IFEND;

  PROCEND write_statistic_to_binary_log;

?? OLDTITLE, EJECT ??
?? NEWTITLE := '[INLINE] write_counter_legible_log', EJECT ??

{ PURPOSE:
{   The purpose of this request is to convert an integer to the string representation of the integer in the
{ required base and format (fixed/unfixed).

  PROCEDURE [INLINE] write_counter_legible_log
    (    counter: integer;
         base: radix;
     VAR output_line: string ( * );
     VAR output_line_length: integer;
     VAR status: ost$status);

    VAR
      counter_string: ost$string;

    status.normal := TRUE;

    IF ptv$number_of_counters.fixed_format THEN
      CASE base OF
      = base_2 =
        clp$convert_integer_to_rjstring (counter, 2, TRUE, ' ', output_line (1, ptc$base_2_length), status);
        output_line_length := output_line_length + ptc$base_2_length;
      = base_8 =
        clp$convert_integer_to_rjstring (counter, 8, TRUE, ' ', output_line (1, ptc$base_8_length), status);
        output_line_length := output_line_length + ptc$base_8_length;
      = base_10 =
        clp$convert_integer_to_rjstring (counter, 10, FALSE, ' ', output_line (1, ptc$base_10_length),
              status);
        output_line_length := output_line_length + ptc$base_10_length;
      = base_16 =
        clp$convert_integer_to_rjstring (counter, 16, TRUE, ' ', output_line (1, ptc$base_16_length), status);
        output_line_length := output_line_length + ptc$base_16_length;
      = base_16_group =
        convert_integer_to_hex (counter, output_line (1, ptc$base_16_group_length), status);
        output_line_length := output_line_length + ptc$base_16_group_length;
      ELSE
      CASEND;
    ELSE
      CASE base OF
      = base_2 =
        clp$convert_integer_to_string (counter, 2, TRUE, counter_string, status);
      = base_8 =
        clp$convert_integer_to_string (counter, 8, TRUE, counter_string, status);
      = base_10 =
        clp$convert_integer_to_string (counter, 10, FALSE, counter_string, status);
      = base_16 =
        clp$convert_integer_to_string (counter, 16, TRUE, counter_string, status);
      = base_16_group =
        convert_integer_to_hex (counter, output_line (1, ptc$base_16_group_length), status);
        output_line_length := output_line_length + ptc$base_16_group_length;
      ELSE
      CASEND;
      IF base <> base_16_group THEN
        output_line (1) := ' ';
        output_line (2, counter_string.size) := counter_string.value (1, counter_string.size);
        output_line_length := output_line_length + counter_string.size + 1;
      IFEND;
    IFEND;

    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

  PROCEND write_counter_legible_log;

?? OLDTITLE ??
?? NEWTITLE := 'write_statistic_to_legible_log', EJECT ??

{ PURPOSE:
{  The purpose of this request is to write a statistic record into legible log file.
{
{ DESIGN:
{   The procedure receives 3 pointers:
{    -  pointer to the statistic header.
{    -  pointer to the counters array.
{    -  pointer to the descriptive data string.
{  The procedure tries to write the output record in one line but if the output file page_width is not enough
{  it folds the output line into a few lines in the output log.
{
{ NOTE:
{ - The procedure processes the log_entry counter base in order to write only the required counters.
{ - The procedure processes ptv$number_of_counter in order to write a fixed number of counters or a floating
{   number.
{   - If the number of counters is fixed and fewer than the number of available counters from the statistic
{     (after processing the log_entry counter base) the procedure ignores the extra counters.
{   - If the number of counters is fixed and more than the number of available counters from the statistic
{     (after processing the log_entry counter base) the procedure pads the output log with zero values.
{ - This procedure uses the base in the log_entry counter base to delete counters (base 0) and to write the
{   counters in the specified base.

  PROCEDURE write_statistic_to_legible_log
    (    log_entry_p: ^put_entry;
         statistic_header_p: ^sft$statistic_header;
         counters_p: sft$counters;
         descriptive_data_in_p: ^sft$descriptive_data;
     VAR status: ost$status);

    VAR
      descriptive_data_length: integer,
      descriptive_data_p: ^sft$descriptive_data,
      descriptive_data_start: integer,
      index: integer,
      line_length: integer,
      null_subfield: boolean,
      number_of_counters: integer,
      substring_found: boolean;

    status.normal := TRUE;

    IF log_entry_p^.descriptive_text_p = NIL THEN
      descriptive_data_p := descriptive_data_in_p;
      get_descriptive_data_subfield (descriptive_data_p, statistic_header_p^.descriptive_data_size,
            log_entry_p^.subfield_position, log_entry_p^.subfield_length, log_entry_p^.subfield_number,
            log_entry_p^.subfield_delimiter, null_subfield, substring_found, descriptive_data_start,
            descriptive_data_length);
    ELSE
      descriptive_data_p := log_entry_p^.descriptive_text_p;
      descriptive_data_start := 1;
      descriptive_data_length := #SIZE (log_entry_p^.descriptive_text_p^);
    IFEND;

    write_statistic_header (statistic_header_p, descriptive_data_length, ptv$output_line_log,
          ptv$output_line_length, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF ptv$number_of_counters.float THEN
      FOR index := 1 TO statistic_header_p^.number_of_counters DO
        IF log_entry_p^.counter_base [index] <> base_0 THEN
          write_counter_legible_log (counters_p^ [index], log_entry_p^.counter_base [index],
                ptv$output_line_log (ptv$output_line_length + 1, * ), ptv$output_line_length, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        IFEND;
      FOREND;
    ELSE
      index := 1;
      number_of_counters := 1;
      WHILE (number_of_counters <= ptv$number_of_counters.number) AND
            (index <= statistic_header_p^.number_of_counters) DO
        IF log_entry_p^.counter_base [index] <> base_0 THEN
          write_counter_legible_log (counters_p^ [index], log_entry_p^.counter_base [index],
                ptv$output_line_log (ptv$output_line_length + 1, * ), ptv$output_line_length, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          number_of_counters := number_of_counters + 1;
        IFEND;
        index := index + 1;
      WHILEND;
      FOR index := number_of_counters TO ptv$number_of_counters.number DO
        write_counter_legible_log (0, base_10, ptv$output_line_log (ptv$output_line_length + 1, * ),
              ptv$output_line_length, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
      FOREND;
    IFEND;

    ptv$output_line_log (ptv$output_line_length + 1) := ' ';
    IF ptv$descriptive_data_size.float THEN
      IF descriptive_data_length <> 0 THEN
        ptv$output_line_log (ptv$output_line_length + 2, descriptive_data_length) :=
              descriptive_data_p^ (descriptive_data_start, descriptive_data_length);
        ptv$output_line_length := ptv$output_line_length + descriptive_data_length + 1;
      IFEND;
    ELSEIF ptv$descriptive_data_size.number > 0 THEN
      IF descriptive_data_length <> 0 THEN
        IF ptv$descriptive_data_size.number <= descriptive_data_length THEN
          ptv$output_line_log (ptv$output_line_length + 2, ptv$descriptive_data_size.number) :=
                descriptive_data_p^ (descriptive_data_start, ptv$descriptive_data_size.number);
          ptv$output_line_length := ptv$output_line_length + ptv$descriptive_data_size.number + 1;
        ELSE
          ptv$output_line_log (ptv$output_line_length + 2, ptv$descriptive_data_size.number) :=
                descriptive_data_p^ (descriptive_data_start, descriptive_data_length);
          ptv$output_line_length := ptv$output_line_length + ptv$descriptive_data_size.number + 1;
        IFEND;
      ELSE
        ptv$output_line_log (ptv$output_line_length + 2, ptv$descriptive_data_size.number) := '';
      IFEND;
    IFEND;

    line_length := ptv$output_line_length;
    index := 1;
    WHILE line_length > ptv$maximum_line_length DO
      cyp$put_next_line (ptv$output_file, ptv$output_line_log (index, ptv$maximum_line_length), status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      line_length := line_length - ptv$maximum_line_length;
      index := index + ptv$maximum_line_length;
    WHILEND;
    cyp$put_next_line (ptv$output_file, ptv$output_line_log (index, line_length), status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

  PROCEND write_statistic_to_legible_log;

?? OLDTITLE ??
?? NEWTITLE := 'write_statistic_to_list_log', EJECT ??

{ PURPOSE:
{  The purpose of this request is to write a statistic record into list log file.
{
{ DESIGN:
{   The procedure receives 3 pointers:
{    -  pointer to the statistic header.
{    -  pointer to the counters array.
{    -  pointer to the descriptive data string.
{ The procedure writes the statistic record on one line, the counters on a new line, folding the counters on
{ as few lines as necessary, with the number of the first counter in every line at the beginning of the line
{ and the descriptive data with apostrophes on a new line folded as necessary.
{
{ NOTE:
{ - The procedure processes the log_entry counter base in order to write only the required counters.
{ - The procedure processes ptv$number_of_counter in order to write a fixed number of counters or a floating
{   number.
{   - If the number of counters is fixed and fewer than the number of available counters from the statistic
{     (after processing the log_entry counter base) the procedure ignores the extra counters.
{   - If the number of counters is fixed and more than the number of available counters from the statistic
{     (after processing the log_entry counter base) the procedure doesn't pad the output log with zero values.
{ - This procedure uses the base in the log_entry counter base to delete counters (base 0) and to write the
{   counters in the specified base.
{ - In a list log when the counter_format is fixed all counters are written in the same length.

  PROCEDURE write_statistic_to_list_log
    (    log_entry_p: ^put_entry;
         statistic_header_p: ^sft$statistic_header;
         counters_p: sft$counters;
         descriptive_data_in_p: ^sft$descriptive_data;
     VAR status: ost$status);

    VAR
      counter_string: string (ptc$max_output_line_length),
      descriptive_data_length: integer,
      descriptive_data_p: ^sft$descriptive_data,
      descriptive_data_start: integer,
      index: integer,
      line_length: integer,
      null_subfield: boolean,
      number_of_counters: integer,
      substring_found: boolean;

?? NEWTITLE := '[INLINE] convert_counter_to_string', EJECT ??

{ PURPOSE:
{   The purpose of this request is to convert an integer to the string representation of the integer in the
{ required base and format (fixed/unfixed).

    PROCEDURE [INLINE] convert_counter_to_string
      (    counter_value: integer;
           base: radix;
       VAR length { input, output } : integer;
       VAR output_string: string (ptc$max_output_line_length);
       VAR status: ost$status);

      VAR
        counter_string: ost$string;

      status.normal := TRUE;

      IF ptv$number_of_counters.fixed_format THEN
        CASE base OF
        = base_2 =
          clp$convert_integer_to_rjstring (counter_value, 2, TRUE, ' ', output_string (1, length), status);
        = base_8 =
          clp$convert_integer_to_rjstring (counter_value, 8, TRUE, ' ', output_string (1, length), status);
        = base_10 =
          clp$convert_integer_to_rjstring (counter_value, 10, FALSE, ' ', output_string (1, length), status);
        = base_16 =
          clp$convert_integer_to_rjstring (counter_value, 16, TRUE, ' ', output_string (1, length), status);
        = base_16_group =
          convert_integer_to_hex (counter_value, output_string (1, length), status);
        ELSE
        CASEND;
      ELSE
        CASE base OF
        = base_2 =
          clp$convert_integer_to_string (counter_value, 2, TRUE, counter_string, status);
        = base_8 =
          clp$convert_integer_to_string (counter_value, 8, TRUE, counter_string, status);
        = base_10 =
          clp$convert_integer_to_string (counter_value, 10, FALSE, counter_string, status);
        = base_16 =
          clp$convert_integer_to_string (counter_value, 16, TRUE, counter_string, status);
        = base_16_group =
          convert_integer_to_hex (counter_value, output_string (1, ptc$base_16_group_length), status);
          length := ptc$base_16_group_length;
        ELSE
        CASEND;
        IF base <> base_16_group THEN
          output_string (1) := ' ';
          output_string (2, counter_string.size) := counter_string.value (1, counter_string.size);
          length := counter_string.size + 1;
        IFEND;
      IFEND;

      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

    PROCEND convert_counter_to_string;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] write_counter_to_list', EJECT ??

{ PURPOSE:
{  The purpose of this request is to write a counter into list log file.
{
{ DESIGN:
{   If the output line length plus the length of the new counter is longer than the output file page width
{   the procedure writes the line into output log, adds in the beginning of the line the number of the first
{   counter in the new line (the number of current counters) and adds the counter (the string) to the line.
{
{ NOTE:
{ - The first time the procedure is called it writes the statistic header.  The last line of the counters
{   is written to the log in the write_statistic_to_list_log procedure before writing the descriptive_data.

    PROCEDURE [INLINE] write_counter_to_list
      (VAR status: ost$status);

      status.normal := TRUE;

      line_length := line_length + ptv$fixed_counter_length;
      IF line_length >= ptv$maximum_line_length THEN
        cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        clp$convert_integer_to_rjstring (index, 10, FALSE, ' ',
              ptv$output_line (1, ptc$num_of_counter_string_size), status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        ptv$output_line (ptc$num_of_counter_string_size + 1) := ':';
        ptv$output_line_length := ptc$num_of_counter_string_size + 1;
      IFEND;
      ptv$output_line (ptv$output_line_length + 1, ptv$fixed_counter_length) := counter_string;
      ptv$output_line_length := ptv$output_line_length + ptv$fixed_counter_length;
      line_length := ptv$output_line_length;

    PROCEND write_counter_to_list;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

    cyp$put_next_line (ptv$output_file, ' ', status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF log_entry_p^.descriptive_text_p = NIL THEN
      descriptive_data_p := descriptive_data_in_p;
      get_descriptive_data_subfield (descriptive_data_p, statistic_header_p^.descriptive_data_size,
            log_entry_p^.subfield_position, log_entry_p^.subfield_length, log_entry_p^.subfield_number,
            log_entry_p^.subfield_delimiter, null_subfield, substring_found, descriptive_data_start,
            descriptive_data_length);
    ELSE
      descriptive_data_p := log_entry_p^.descriptive_text_p;
      descriptive_data_start := 1;
      descriptive_data_length := #SIZE (log_entry_p^.descriptive_text_p^);
    IFEND;

    write_statistic_header (statistic_header_p, descriptive_data_length, ptv$output_line,
          ptv$output_line_length, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    line_length := ptv$max_report_page_width;
    IF ptv$number_of_counters.float THEN
      FOR index := 1 TO statistic_header_p^.number_of_counters DO
        IF log_entry_p^.counter_base [index] <> base_0 THEN
          convert_counter_to_string (counters_p^ [index], log_entry_p^.counter_base [index],
                ptv$fixed_counter_length, counter_string, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          write_counter_to_list (status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        IFEND;
      FOREND;
    ELSE
      index := 1;
      number_of_counters := 1;
      WHILE (number_of_counters <= ptv$number_of_counters.number) AND
            (index <= statistic_header_p^.number_of_counters) DO
        IF log_entry_p^.counter_base [index] <> base_0 THEN
          convert_counter_to_string (counters_p^ [index], log_entry_p^.counter_base [index],
                ptv$fixed_counter_length, counter_string, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          write_counter_to_list (status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          number_of_counters := number_of_counters + 1;
        IFEND;
        index := index + 1;
      WHILEND;
      IF number_of_counters <= ptv$number_of_counters.number THEN
        convert_counter_to_string (0, base_10, ptv$fixed_counter_length, counter_string, status);
      IFEND;
      FOR index := number_of_counters TO ptv$number_of_counters.number DO
        write_counter_to_list (status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
      FOREND;
    IFEND;

{ This call writes the last line of counters if there are counters to print or the statistic header.

    cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF descriptive_data_p <> NIL THEN
      write_descriptive_data_to_list (descriptive_data_p^ (descriptive_data_start, descriptive_data_length),
            0, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    IFEND;

  PROCEND write_statistic_to_list_log;

?? OLDTITLE ??
?? NEWTITLE := 'ANABL Subcommands' ??
?? NEWTITLE := 'add_selection_cmd', EJECT ??

{ This procedure processes the add_selection command.

*copyc pth$anabl_add_selection

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

{ PROCEDURE (ptm$anabl_adds) add_selection, adds (
{   selection, s: (CHECK) name = $required
{   statistic_code, sc: (CHECK) statistic_code = $optional
{   time, t: (CHECK) range of date_time = $optional
{   continuous_date_time, cdt: boolean = false
{   descriptive_data, dd: list of record
{       string: list of string 0..sfc$max_descriptive_data_size
{       position: integer 0..sfc$max_descriptive_data_size = $optional
{       length: any of
{         key
{           all
{         keyend
{         integer 0..sfc$max_descriptive_data_size
{       anyend = $optional
{       field_number: any of
{         key
{           all
{         keyend
{         integer 1..sfc$max_descriptive_data_size
{       anyend = $optional
{       field_delimiter: string 1 = $optional
{     recend = $optional
{   job_predecessor, jp: (CHECK) name = $optional
{   task_predecessor, tp: (CHECK) name = $optional
{   system_job_name, sjn: name 19..19 = $optional
{   global_task_id, gti: (CHECK) string 3..9 = $optional
{   inverted_selection, is: boolean = false
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 21] of clt$pdt_parameter_name,
      parameters: array [1 .. 11] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$range_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$date_time_type_qualifier,
        recend,
      recend,
      type4: record
        header: clt$type_specification_header,
        default_value: string (5),
      recend,
      type5: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$record_type_qualifier,
          field_spec_1: clt$field_specification,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$list_type_qualifier_v2,
            element_type_spec: record
              header: clt$type_specification_header,
              qualifier: clt$string_type_qualifier,
            recend,
          recend,
          field_spec_2: clt$field_specification,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
          field_spec_3: clt$field_specification,
          element_type_spec_3: 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,
              qualifier: clt$keyword_type_qualifier,
              keyword_specs: array [1 .. 1] of clt$keyword_specification,
            recend,
            type_size_2: clt$type_specification_size,
            element_type_spec_2: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
          recend,
          field_spec_4: clt$field_specification,
          element_type_spec_4: 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,
              qualifier: clt$keyword_type_qualifier,
              keyword_specs: array [1 .. 1] of clt$keyword_specification,
            recend,
            type_size_2: clt$type_specification_size,
            element_type_spec_2: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
          recend,
          field_spec_5: clt$field_specification,
          element_type_spec_5: record
            header: clt$type_specification_header,
            qualifier: clt$string_type_qualifier,
          recend,
        recend,
      recend,
      type6: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type7: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type8: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type9: record
        header: clt$type_specification_header,
        qualifier: clt$string_type_qualifier,
      recend,
      type10: record
        header: clt$type_specification_header,
        default_value: string (5),
      recend,
      type11: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [103, 3, 5, 9, 48, 16, 77],
    clc$command, 21, 11, 1, 0, 0, 0, 11, 'PTM$ANABL_ADDS'], [
    ['CDT                            ',clc$abbreviation_entry, 4],
    ['CONTINUOUS_DATE_TIME           ',clc$nominal_entry, 4],
    ['DD                             ',clc$abbreviation_entry, 5],
    ['DESCRIPTIVE_DATA               ',clc$nominal_entry, 5],
    ['GLOBAL_TASK_ID                 ',clc$nominal_entry, 9],
    ['GTI                            ',clc$abbreviation_entry, 9],
    ['INVERTED_SELECTION             ',clc$nominal_entry, 10],
    ['IS                             ',clc$abbreviation_entry, 10],
    ['JOB_PREDECESSOR                ',clc$nominal_entry, 6],
    ['JP                             ',clc$abbreviation_entry, 6],
    ['S                              ',clc$abbreviation_entry, 1],
    ['SC                             ',clc$abbreviation_entry, 2],
    ['SELECTION                      ',clc$nominal_entry, 1],
    ['SJN                            ',clc$abbreviation_entry, 8],
    ['STATISTIC_CODE                 ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 11],
    ['SYSTEM_JOB_NAME                ',clc$nominal_entry, 8],
    ['T                              ',clc$abbreviation_entry, 3],
    ['TASK_PREDECESSOR               ',clc$nominal_entry, 7],
    ['TIME                           ',clc$nominal_entry, 3],
    ['TP                             ',clc$abbreviation_entry, 7]],
    [
{ PARAMETER 1
    [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$extended_parameter_checking, 5, clc$required_parameter, 0
  , 0],
{ PARAMETER 2
    [15, 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$extended_parameter_checking, 3, clc$optional_parameter, 0
  , 0],
{ PARAMETER 3
    [20, 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$extended_parameter_checking, 12, clc$optional_parameter,
  0, 0],
{ 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, 3,
  clc$optional_default_parameter, 0, 5],
{ PARAMETER 5
    [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, 423,
  clc$optional_parameter, 0, 0],
{ PARAMETER 6
    [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$extended_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 7
    [19, 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$extended_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 8
    [17, 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$optional_parameter, 0
  , 0],
{ PARAMETER 9
    [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$extended_parameter_checking, 8, clc$optional_parameter, 0
  , 0],
{ PARAMETER 10
    [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_default_parameter, 0, 5],
{ PARAMETER 11
    [16, 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, osc$max_name_size]],
{ PARAMETER 2
    [[1, 0, clc$statistic_code_type]],
{ PARAMETER 3
    [[1, 0, clc$range_type], [5],
      [[1, 0, clc$date_time_type], [$clt$date_and_or_time [clc$date, clc$time], $clt$date_time_tenses [
  clc$past, clc$present, clc$future]]]
    ],
{ PARAMETER 4
    [[1, 0, clc$boolean_type],
    'false'],
{ PARAMETER 5
    [[1, 0, clc$list_type], [407, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$record_type], [5],
      ['STRING                         ', clc$required_field, 24], [[1, 0, clc$list_type], [8, 0,
  clc$max_list_size, 0, FALSE, FALSE],
          [[1, 0, clc$string_type], [0, sfc$max_descriptive_data_size, FALSE]]
        ],
      ['POSITION                       ', clc$optional_field, 20], [[1, 0, clc$integer_type], [0,
  sfc$max_descriptive_data_size, 10]],
      ['LENGTH                         ', clc$optional_field, 84], [[1, 0, clc$union_type], [[
        clc$integer_type, clc$keyword_type],
        FALSE, 2],
        44, [[1, 0, clc$keyword_type], [1], [
          ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
          ],
        20, [[1, 0, clc$integer_type], [0, sfc$max_descriptive_data_size, 10]]
        ],
      ['FIELD_NUMBER                   ', clc$optional_field, 84], [[1, 0, clc$union_type], [[
        clc$integer_type, clc$keyword_type],
        FALSE, 2],
        44, [[1, 0, clc$keyword_type], [1], [
          ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
          ],
        20, [[1, 0, clc$integer_type], [1, sfc$max_descriptive_data_size, 10]]
        ],
      ['FIELD_DELIMITER                ', clc$optional_field, 8], [[1, 0, clc$string_type], [1, 1, FALSE]]
      ]
    ],
{ PARAMETER 6
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 7
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 8
    [[1, 0, clc$name_type], [19, 19]],
{ PARAMETER 9
    [[1, 0, clc$string_type], [3, 9, FALSE]],
{ PARAMETER 10
    [[1, 0, clc$boolean_type],
    'false'],
{ PARAMETER 11
    [[1, 0, clc$status_type]]];

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

    CONST
      p$selection = 1,
      p$statistic_code = 2,
      p$time = 3,
      p$continuous_date_time = 4,
      p$descriptive_data = 5,
      p$job_predecessor = 6,
      p$task_predecessor = 7,
      p$system_job_name = 8,
      p$global_task_id = 9,
      p$inverted_selection = 10,
      p$status = 11;

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

    VAR
      initial_selection: [STATIC, READ] selection := [
{ NAME                           } * ,
{ SELECTION_CHAIN_LINK_P         } NIL,
{ INVERTED_SELECTION             } FALSE,
{ STATISTIC_SPECIFIED            } FALSE,
{ STATISTIC_NAME                 } * ,
{ STATISTIC_CODE                 } * ,
{ DATE_TIME_SPECIFIED            } FALSE,
{ START_DATE_TIME                } * ,
{ END_DATE_TIME                  } * ,
{ CONTINUOUS_DATE_TIME           } TRUE,
{ NEW_DAY_DATE_TIME              } * ,
{ DESCRIPTIVE_SPECIFIED          } FALSE,
{ DESCRIPTIVE_SUBFIELD_P         } NIL,
{ PREDECESSOR_JOB_STATISTIC_P    } NIL,
{ PREDECESSOR_TASK_STATISTIC_P   } NIL,
{ JOB_NAME                       } jmc$blank_system_supplied_name,
{ TASK_ID_SPECIFIED              } FALSE,
{ TASK_ID                        } [
{   INDEX                          } * ,
{   SEQNO                          } * ],
{ LOG_ENTRY_P                    } NIL,
{ FIELD_CHAIN_P                  } NIL,
{ NUMBER_OF_SUCCESSOR_STATISTICS } 0,
{ SUCCESSOR_LIST_HEAD_P          } NIL,
{ SUCCESSOR_LIST_TAIL_P          } NIL,
{ COLLECT_DATE_TIME              } FALSE,
{ DATE_TIME_VALUE_HEAD_P         } NIL,
{ DATE_TIME_VALUE_TAIL_P         } NIL,
{ COLLECT_PREDECESSOR_DATE_TIME  } FALSE,
{  PREDECESSOR_DT_VALUE_HEAD_P   } NIL,
{  PREDECESSOR_DT_VALUE_TAIL_P   } NIL,
{ STATISTIC_LOCATION_P           } NIL,
{ INCREMENTAL                    } FALSE,
{ INCREMENTAL_COUNTER_P          } NIL,
{ LOST_INTERVAL                  } 0,
{ SKIP_DATE_TIME                 } FALSE,
{ SKIP_DATE_TIME_HEAD_P          } NIL,
{ SKIP_DATE_TIME_TAIL_P          } NIL,
{ SHADOW_FIELDS                  } FALSE,
{ SHADOW_FIELD_CHAIN_P           } NIL];

    VAR
      end_date_time: clt$date_time,
      index_value: clt$integer,
      selection_p: ^selection,
      seqno_value: clt$integer,
      start_date_time: clt$date_time,
      temp_selection: ^selection;

?? NEWTITLE := 'check_add_selection', EJECT ??

    PROCEDURE check_add_selection
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      VAR
        end_time: integer,
        start_time: integer;

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF

        = p$selection =
          check_duplicate_selection_name (pvt [p$selection].value^.name_value, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          temp_selection^.name := pvt [p$selection].value^.name_value;

        = p$statistic_code =
          temp_selection^.statistic_specified := FALSE;
          IF pvt [p$statistic_code].specified THEN
            temp_selection^.statistic_code := pvt [p$statistic_code].value^.statistic_code_value;
            sfp$convert_stat_code_to_name (temp_selection^.statistic_code, temp_selection^.statistic_name,
                  status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            temp_selection^.statistic_specified := TRUE;
          IFEND;

        = p$time =
          temp_selection^.date_time_specified := FALSE;
          IF pvt [p$time].specified THEN
            process_time_selection (pvt [p$time], start_date_time, end_date_time, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            temp_selection^.start_date_time := start_date_time.value;
            temp_selection^.end_date_time := end_date_time.value;
            temp_selection^.date_time_specified := TRUE;
          IFEND;

        = p$job_predecessor =
          temp_selection^.predecessor_job_statistic_p := NIL;
          IF pvt [p$job_predecessor].specified THEN
            check_undefined_selection (pvt [p$job_predecessor].value^.name_value,
                  pte$undefined_selec_for_predec, temp_selection^.predecessor_job_statistic_p, status);
          IFEND;

        = p$task_predecessor =
          temp_selection^.predecessor_task_statistic_p := NIL;
          IF pvt [p$task_predecessor].specified THEN
            check_undefined_selection (pvt [p$task_predecessor].value^.name_value,
                  pte$undefined_selec_for_predec, temp_selection^.predecessor_task_statistic_p, status);
          IFEND;

        = p$global_task_id =
          IF pvt [p$global_task_id].specified THEN
            process_global_task_id (pvt [p$global_task_id].value^, index_value, seqno_value, status);
          IFEND;

        ELSE
        CASEND;
      ELSE
        IF temp_selection^.date_time_specified AND NOT pvt [p$continuous_date_time].value^.boolean_value.
              value THEN
          start_time := temp_selection^.start_date_time.hour *
                3600000 + temp_selection^.start_date_time.minute *
                60000 + temp_selection^.start_date_time.second *
                1000 + temp_selection^.start_date_time.millisecond;
          end_time := temp_selection^.end_date_time.hour * 3600000 + temp_selection^.end_date_time.minute *
                60000 + temp_selection^.end_date_time.second * 1000 +
                temp_selection^.end_date_time.millisecond;
          IF start_time >= end_time THEN
            osp$set_status_condition (pte$date_time_range_order, status);
            RETURN; {----->
          IFEND;
        IFEND;

        IF pvt [p$job_predecessor].specified AND pvt [p$task_predecessor].specified THEN
          osp$set_status_condition (pte$job_and_task_predecessor, status);
          RETURN; {----->
        IFEND;

        check_duplicate_selection_name (pvt [p$selection].value^.name_value, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
      IFEND;

    PROCEND check_add_selection;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

    ALLOCATE temp_selection;
    temp_selection^ := initial_selection;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), ^check_add_selection, ^pvt, status);
    IF NOT status.normal THEN
      FREE temp_selection;
      RETURN; {----->
    IFEND;

{SCL in full screen prompting returns a good status when QUIT is pressed again.
{So we have to check this again except we should ever fix SCL....

    check_duplicate_selection_name (pvt [p$selection].value^.name_value, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

{ continuous_date_time

    temp_selection^.continuous_date_time := pvt [p$continuous_date_time].value^.boolean_value.value;

{ descriptive_data

    IF pvt [p$descriptive_data].specified THEN
      process_descriptive_selection (pvt [p$descriptive_data].value, temp_selection);
      temp_selection^.descriptive_specified := TRUE;
    IFEND;

{ job_predecessor

    IF temp_selection^.predecessor_job_statistic_p <> NIL THEN
      temp_selection^.predecessor_job_statistic_p^.number_of_successor_statistics :=
            temp_selection^.predecessor_job_statistic_p^.number_of_successor_statistics + 1;
    IFEND;

{ task_predecessor

    IF temp_selection^.predecessor_task_statistic_p <> NIL THEN
      temp_selection^.predecessor_task_statistic_p^.number_of_successor_statistics :=
            temp_selection^.predecessor_task_statistic_p^.number_of_successor_statistics + 1;
    IFEND;

{ system_job_name

    IF pvt [p$system_job_name].specified THEN
      temp_selection^.job_name := pvt [p$system_job_name].value^.
            name_value (1, jmc$system_supplied_name_size);
    IFEND;

{ global_task_id

    IF pvt [p$global_task_id].specified THEN
      temp_selection^.task_id.index := index_value.value;
      temp_selection^.task_id.seqno := seqno_value.value;
      temp_selection^.task_id_specified := TRUE;
    IFEND;

{ inverted_selection
    temp_selection^.inverted_selection := pvt [p$inverted_selection].value^.boolean_value.value;

    IF ptv$selection_chain_head_p <> NIL THEN
      ptv$selection_chain_tail_p^.selection_chain_link_p := temp_selection;
      ptv$selection_chain_tail_p := temp_selection;
    ELSE
      ptv$selection_chain_head_p := temp_selection;
      ptv$selection_chain_tail_p := temp_selection;
    IFEND;

  PROCEND add_selection_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'change_selection_cmd', EJECT ??

*copyc pth$anabl_change_selection

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

{ PROCEDURE (ptm$anabl_chas) change_selection, chas (
{   selection, s: (CHECK) name = $required
{   new_selection, ns: (CHECK) name = $optional
{   statistic_code, sc: (CHECK) any of
{       key
{         none
{       keyend
{       statistic_code
{     anyend = $optional
{   time, t: (CHECK) any of
{       key
{         none
{       keyend
{       range of date_time
{     anyend = $optional
{   continuous_date_time, cdt: boolean = $optional
{   descriptive_data, dd: any of
{       key
{         none
{       keyend
{       list of record
{         string: list of string 0..sfc$max_descriptive_data_size = $optional
{         position: integer 0..sfc$max_descriptive_data_size = $optional
{         length: any of
{           key
{             all
{           keyend
{           integer 0..sfc$max_descriptive_data_size
{         anyend = $optional
{         field_number: any of
{           key
{             all
{           keyend
{           integer 1..sfc$max_descriptive_data_size
{         anyend = $optional
{         field_delimiter: string 1 = $optional
{       recend
{     anyend = $optional
{   job_predecessor, jp: (CHECK) any of
{       key
{         none
{       keyend
{       name
{     anyend = $optional
{   task_predecessor, tp: (CHECK) any of
{       key
{         none
{       keyend
{       name
{     anyend = $optional
{   system_job_name, sjn: any of
{       key
{         none
{       keyend
{       name 19..19
{     anyend = $optional
{   global_task_id, gti: (CHECK) any of
{       key
{         none
{       keyend
{       string 3..9
{     anyend = $optional
{   inverted_selection, iv: any of
{       key
{         none
{       keyend
{       boolean
{     anyend = $optional
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 23] of clt$pdt_parameter_name,
      parameters: array [1 .. 12] 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$name_type_qualifier,
      recend,
      type3: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
      recend,
      type4: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$range_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$date_time_type_qualifier,
          recend,
        recend,
      recend,
      type5: record
        header: clt$type_specification_header,
      recend,
      type6: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$record_type_qualifier,
            field_spec_1: clt$field_specification,
            element_type_spec_1: record
              header: clt$type_specification_header,
              qualifier: clt$list_type_qualifier_v2,
              element_type_spec: record
                header: clt$type_specification_header,
                qualifier: clt$string_type_qualifier,
              recend,
            recend,
            field_spec_2: clt$field_specification,
            element_type_spec_2: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
            field_spec_3: clt$field_specification,
            element_type_spec_3: 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,
                qualifier: clt$keyword_type_qualifier,
                keyword_specs: array [1 .. 1] of clt$keyword_specification,
              recend,
              type_size_2: clt$type_specification_size,
              element_type_spec_2: record
                header: clt$type_specification_header,
                qualifier: clt$integer_type_qualifier,
              recend,
            recend,
            field_spec_4: clt$field_specification,
            element_type_spec_4: 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,
                qualifier: clt$keyword_type_qualifier,
                keyword_specs: array [1 .. 1] of clt$keyword_specification,
              recend,
              type_size_2: clt$type_specification_size,
              element_type_spec_2: record
                header: clt$type_specification_header,
                qualifier: clt$integer_type_qualifier,
              recend,
            recend,
            field_spec_5: clt$field_specification,
            element_type_spec_5: record
              header: clt$type_specification_header,
              qualifier: clt$string_type_qualifier,
            recend,
          recend,
        recend,
      recend,
      type7: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type8: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type9: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type10: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
      recend,
      type11: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
      recend,
      type12: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [103, 3, 5, 9, 58, 33, 65],
    clc$command, 23, 12, 1, 0, 0, 0, 12, 'PTM$ANABL_CHAS'], [
    ['CDT                            ',clc$abbreviation_entry, 5],
    ['CONTINUOUS_DATE_TIME           ',clc$nominal_entry, 5],
    ['DD                             ',clc$abbreviation_entry, 6],
    ['DESCRIPTIVE_DATA               ',clc$nominal_entry, 6],
    ['GLOBAL_TASK_ID                 ',clc$nominal_entry, 10],
    ['GTI                            ',clc$abbreviation_entry, 10],
    ['INVERTED_SELECTION             ',clc$nominal_entry, 11],
    ['IV                             ',clc$abbreviation_entry, 11],
    ['JOB_PREDECESSOR                ',clc$nominal_entry, 7],
    ['JP                             ',clc$abbreviation_entry, 7],
    ['NEW_SELECTION                  ',clc$nominal_entry, 2],
    ['NS                             ',clc$abbreviation_entry, 2],
    ['S                              ',clc$abbreviation_entry, 1],
    ['SC                             ',clc$abbreviation_entry, 3],
    ['SELECTION                      ',clc$nominal_entry, 1],
    ['SJN                            ',clc$abbreviation_entry, 9],
    ['STATISTIC_CODE                 ',clc$nominal_entry, 3],
    ['STATUS                         ',clc$nominal_entry, 12],
    ['SYSTEM_JOB_NAME                ',clc$nominal_entry, 9],
    ['T                              ',clc$abbreviation_entry, 4],
    ['TASK_PREDECESSOR               ',clc$nominal_entry, 8],
    ['TIME                           ',clc$nominal_entry, 4],
    ['TP                             ',clc$abbreviation_entry, 8]],
    [
{ PARAMETER 1
    [15, 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$extended_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$extended_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 3
    [17, 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$extended_parameter_checking, 67, clc$optional_parameter,
  0, 0],
{ PARAMETER 4
    [22, 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$extended_parameter_checking, 76, clc$optional_parameter,
  0, 0],
{ 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
    [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, 487,
  clc$optional_parameter, 0, 0],
{ PARAMETER 7
    [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$extended_parameter_checking, 69, clc$optional_parameter,
  0, 0],
{ PARAMETER 8
    [21, 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$extended_parameter_checking, 69, clc$optional_parameter,
  0, 0],
{ PARAMETER 9
    [19, 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, 69, clc$optional_parameter,
  0, 0],
{ PARAMETER 10
    [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$extended_parameter_checking, 72, clc$optional_parameter,
  0, 0],
{ PARAMETER 11
    [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, 67, clc$optional_parameter,
  0, 0],
{ PARAMETER 12
    [18, 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, osc$max_name_size]],
{ PARAMETER 2
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 3
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$statistic_code_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$statistic_code_type]]
    ],
{ PARAMETER 4
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$range_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    12, [[1, 0, clc$range_type], [5],
        [[1, 0, clc$date_time_type], [$clt$date_and_or_time [clc$date, clc$time], $clt$date_time_tenses [
  clc$past, clc$present, clc$future]]]
      ]
    ],
{ PARAMETER 5
    [[1, 0, clc$boolean_type]],
{ PARAMETER 6
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    423, [[1, 0, clc$list_type], [407, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$record_type], [5],
        ['STRING                         ', clc$optional_field, 24], [[1, 0, clc$list_type], [8, 0,
  clc$max_list_size, 0, FALSE, FALSE],
            [[1, 0, clc$string_type], [0, sfc$max_descriptive_data_size, FALSE]]
          ],
        ['POSITION                       ', clc$optional_field, 20], [[1, 0, clc$integer_type], [0,
  sfc$max_descriptive_data_size, 10]],
        ['LENGTH                         ', clc$optional_field, 84], [[1, 0, clc$union_type], [[
          clc$integer_type, clc$keyword_type],
          FALSE, 2],
          44, [[1, 0, clc$keyword_type], [1], [
            ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
            ],
          20, [[1, 0, clc$integer_type], [0, sfc$max_descriptive_data_size, 10]]
          ],
        ['FIELD_NUMBER                   ', clc$optional_field, 84], [[1, 0, clc$union_type], [[
          clc$integer_type, clc$keyword_type],
          FALSE, 2],
          44, [[1, 0, clc$keyword_type], [1], [
            ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
            ],
          20, [[1, 0, clc$integer_type], [1, sfc$max_descriptive_data_size, 10]]
          ],
        ['FIELD_DELIMITER                ', clc$optional_field, 8], [[1, 0, clc$string_type], [1, 1, FALSE]]
        ]
      ]
    ],
{ PARAMETER 7
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    5, [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 8
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    5, [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 9
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    5, [[1, 0, clc$name_type], [19, 19]]
    ],
{ PARAMETER 10
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$string_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    8, [[1, 0, clc$string_type], [3, 9, FALSE]]
    ],
{ PARAMETER 11
    [[1, 0, clc$union_type], [[clc$boolean_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$boolean_type]]
    ],
{ PARAMETER 12
    [[1, 0, clc$status_type]]];

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

    CONST
      p$selection = 1,
      p$new_selection = 2,
      p$statistic_code = 3,
      p$time = 4,
      p$continuous_date_time = 5,
      p$descriptive_data = 6,
      p$job_predecessor = 7,
      p$task_predecessor = 8,
      p$system_job_name = 9,
      p$global_task_id = 10,
      p$inverted_selection = 11,
      p$status = 12;

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

    VAR
      end_date_time: clt$date_time,
      index_value: clt$integer,
      job_predecessor_p: ^selection,
      selection_p: ^selection,
      seqno_value: clt$integer,
      start_date_time: clt$date_time,
      statistic_name: ost$name,
      task_predecessor_p: ^selection,
      temp_selection: ^selection,
      value: ^clt$data_value;

?? NEWTITLE := 'check_change_selection', EJECT ??

    PROCEDURE check_change_selection
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      VAR
        end_time: integer,
        new_time_range: boolean,
        new_not_continuous_date_time: boolean,
        start_time: integer;

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF

        = p$selection =
          check_undefined_selection (pvt [p$selection].value^.name_value, pte$undefined_selec_for_change,
                temp_selection, status);

        = p$new_selection =
          IF pvt [p$new_selection].specified THEN
            check_duplicate_selection_name (pvt [p$new_selection].value^.name_value, status);
          IFEND;

        = p$statistic_code =
          IF pvt [p$statistic_code].specified AND (pvt [p$statistic_code].value^.kind =
                clc$statistic_code) THEN
            sfp$convert_stat_code_to_name (pvt [p$statistic_code].value^.statistic_code_value, statistic_name,
                  status);
          IFEND;

        = p$time =
          IF pvt [p$time].specified AND (pvt [p$time].value^.kind = clc$range) THEN { Range of clc$date_time }
            process_time_selection (pvt [p$time], start_date_time, end_date_time, status);
          IFEND;

        = p$job_predecessor =
          IF pvt [p$job_predecessor].specified AND (pvt [p$job_predecessor].value^.kind = clc$name) THEN
            check_undefined_selection (pvt [p$job_predecessor].value^.name_value,
                  pte$undefined_selec_for_predec, job_predecessor_p, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            IF job_predecessor_p = temp_selection THEN
              osp$set_status_condition (pte$predecessor_itself, status);
              RETURN; {----->
            IFEND;
            check_recursive_predecessor (temp_selection, job_predecessor_p, status);
          IFEND;

        = p$task_predecessor =
          IF pvt [p$task_predecessor].specified AND (pvt [p$task_predecessor].value^.kind = clc$name) THEN
            check_undefined_selection (pvt [p$task_predecessor].value^.name_value,
                  pte$undefined_selec_for_predec, task_predecessor_p, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            IF task_predecessor_p = temp_selection THEN
              osp$set_status_condition (pte$predecessor_itself, status);
              RETURN; {----->
            IFEND;
            check_recursive_predecessor (temp_selection, task_predecessor_p, status);
          IFEND;

        = p$global_task_id =
          IF pvt [p$global_task_id].specified AND (pvt [p$global_task_id].value^.kind = clc$string) THEN
            process_global_task_id (pvt [p$global_task_id].value^, index_value, seqno_value, status);
          IFEND;

        ELSE
        CASEND;
      ELSE

{ If a new time range was specified and continuous_date_time is FALSE, or
{   if continuous_date_time was changed to FALSE and a time range was specified or time had
{   already been used as a selection criterion, then check for a valid time range.

        new_time_range := (pvt [p$time].specified AND (pvt [p$time].value^.kind = clc$range));
        new_not_continuous_date_time := (pvt [p$continuous_date_time].specified AND
              NOT pvt [p$continuous_date_time].value^.boolean_value.value);

        IF (new_time_range AND (new_not_continuous_date_time OR NOT temp_selection^.continuous_date_time)) OR
           (new_not_continuous_date_time AND (new_time_range OR temp_selection^.date_time_specified)) THEN

          IF pvt [p$time].specified THEN
            start_time := start_date_time.value.hour * 3600000 + start_date_time.value.minute *
                  60000 + start_date_time.value.second * 1000 + start_date_time.value.millisecond;
            end_time := end_date_time.value.hour * 3600000 + end_date_time.value.minute *
                  60000 + end_date_time.value.second * 1000 + end_date_time.value.millisecond;
          ELSE
            start_time := temp_selection^.start_date_time.hour *
                  3600000 + temp_selection^.start_date_time.minute *
                  60000 + temp_selection^.start_date_time.second *
                  1000 + temp_selection^.start_date_time.millisecond;
            end_time := temp_selection^.end_date_time.hour * 3600000 + temp_selection^.end_date_time.minute *
                  60000 + temp_selection^.end_date_time.second *
                  1000 + temp_selection^.end_date_time.millisecond;
          IFEND;
          IF start_time >= end_time THEN
            osp$set_status_condition (pte$date_time_range_order, status);
            RETURN; {----->
          IFEND;
        IFEND;

        IF pvt [p$job_predecessor].specified AND (pvt [p$job_predecessor].value^.kind = clc$name) AND
              pvt [p$task_predecessor].specified AND (pvt [p$task_predecessor].value^.kind = clc$name) THEN
          osp$set_status_condition (pte$job_and_task_predecessor, status);
          RETURN; {----->
        IFEND;

        IF pvt [p$job_predecessor].specified AND (pvt [p$job_predecessor].value^.kind = clc$name) AND
              (temp_selection^.predecessor_task_statistic_p <> NIL) AND NOT pvt [p$task_predecessor].specified
              { none } THEN
          osp$set_status_condition (pte$task_predecessor_defined, status);
          RETURN; {----->
        ELSEIF pvt [p$task_predecessor].specified AND (pvt [p$task_predecessor].value^.kind = clc$name) AND
              (temp_selection^.predecessor_job_statistic_p <> NIL) AND NOT pvt [p$job_predecessor].specified
              { none } THEN
          osp$set_status_condition (pte$job_predecessor_defined, status);
          RETURN; {----->
        IFEND;

      IFEND;

    PROCEND check_change_selection;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

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

{ new_selection

    IF pvt [p$new_selection].specified THEN
      temp_selection^.name := pvt [p$new_selection].value^.name_value;
    IFEND;

{ statistic_code

    IF pvt [p$statistic_code].specified THEN
      IF pvt [p$statistic_code].value^.kind = clc$statistic_code THEN
        temp_selection^.statistic_code := pvt [p$statistic_code].value^.statistic_code_value;
        temp_selection^.statistic_name := statistic_name;
        temp_selection^.statistic_specified := TRUE;
      ELSE { none }
        temp_selection^.statistic_specified := FALSE;
      IFEND;
    IFEND;

{ time

    IF pvt [p$time].specified THEN
      IF pvt [p$time].value^.kind = clc$range THEN { Range of clc$date_time }
        temp_selection^.start_date_time := start_date_time.value;
        temp_selection^.end_date_time := end_date_time.value;
        temp_selection^.date_time_specified := TRUE;
      ELSE { none }
        temp_selection^.date_time_specified := FALSE;
      IFEND;
    IFEND;

{ continuous_date_time

    IF pvt [p$continuous_date_time].specified THEN
      temp_selection^.continuous_date_time := pvt [p$continuous_date_time].value^.boolean_value.value;
    IFEND;

{ descriptive_data

    IF pvt [p$descriptive_data].specified THEN
      IF pvt [p$descriptive_data].value^.kind = clc$list THEN
        free_descriptive_selection (temp_selection^.descriptive_subfield_p);
        process_descriptive_selection (pvt [p$descriptive_data].value, temp_selection);
        temp_selection^.descriptive_specified := TRUE;
      ELSE { none }
        free_descriptive_selection (temp_selection^.descriptive_subfield_p);
        temp_selection^.descriptive_specified := FALSE
      IFEND;
    IFEND;

{ job_predecessor

    IF pvt [p$job_predecessor].specified THEN
      IF temp_selection^.predecessor_job_statistic_p <> NIL THEN
        temp_selection^.predecessor_job_statistic_p^.number_of_successor_statistics :=
              temp_selection^.predecessor_job_statistic_p^.number_of_successor_statistics - 1;
      IFEND;
      IF pvt [p$job_predecessor].value^.kind = clc$name THEN
        temp_selection^.predecessor_job_statistic_p := job_predecessor_p;
        temp_selection^.predecessor_job_statistic_p^.number_of_successor_statistics :=
              temp_selection^.predecessor_job_statistic_p^.number_of_successor_statistics + 1;
      ELSE { none }
        temp_selection^.predecessor_job_statistic_p := NIL;
      IFEND;
    IFEND;

{ task_predecessor

    IF pvt [p$task_predecessor].specified THEN
      IF temp_selection^.predecessor_task_statistic_p <> NIL THEN
        temp_selection^.predecessor_task_statistic_p^.number_of_successor_statistics :=
              temp_selection^.predecessor_task_statistic_p^.number_of_successor_statistics - 1;
      IFEND;
      IF pvt [p$task_predecessor].value^.kind = clc$name THEN
        temp_selection^.predecessor_task_statistic_p := task_predecessor_p;
        temp_selection^.predecessor_task_statistic_p^.number_of_successor_statistics :=
              temp_selection^.predecessor_task_statistic_p^.number_of_successor_statistics + 1;
      ELSE { none }
        temp_selection^.predecessor_task_statistic_p := NIL;
      IFEND;
    IFEND;

{ job_name

    IF pvt [p$system_job_name].specified THEN
      IF pvt [p$system_job_name].value^.kind = clc$name THEN
        temp_selection^.job_name := pvt [p$system_job_name].
              value^.name_value (1, jmc$system_supplied_name_size);
      ELSE { none }
        temp_selection^.job_name := jmc$blank_system_supplied_name;
      IFEND;
    IFEND;

{ global_task_id

    IF pvt [p$global_task_id].specified THEN
      IF pvt [p$global_task_id].value^.kind = clc$string THEN
        temp_selection^.task_id.index := index_value.value;
        temp_selection^.task_id.seqno := seqno_value.value;
        temp_selection^.task_id_specified := TRUE;
      ELSE { none }
        temp_selection^.task_id_specified := FALSE;
      IFEND;
    IFEND;

{ inverted_selection
    IF pvt [p$inverted_selection].specified THEN
      temp_selection^.inverted_selection := pvt [p$inverted_selection].value^.boolean_value.value;
    IFEND;

  PROCEND change_selection_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'delete_selection_cmd', EJECT ??

{ This procedure processes the delete_selection command.

*copyc pth$anabl_delete_selection

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

{  PROCEDURE (ptm$anabl_dels) delete_selection, dels (
{  selection, selections, s: (CHECK) any of
{      key
{        all
{      keyend
{      list of name
{    anyend = $required
{  status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 4] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        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,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 28, 10, 28, 28, 835],
    clc$command, 4, 2, 1, 0, 0, 0, 2, 'PTM$ANABL_DELS'], [
    ['S                              ',clc$abbreviation_entry, 1],
    ['SELECTION                      ',clc$nominal_entry, 1],
    ['SELECTIONS                     ',clc$alias_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 2]],
    [
{ 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$extended_parameter_checking, 85, 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$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$name_type], [1, osc$max_name_size]]
      ]
    ],
{ PARAMETER 2
    [[1, 0, clc$status_type]]];

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

    CONST
      p$selection = 1,
      p$status = 2;

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

    VAR
      delete_more: boolean,
      delete_selection_list_head: ^name_list,
      delete_selection_list_1_p: ^name_list,
      delete_selection_list_2: ^name_list,
      delete_status: boolean,
      errors_detected: boolean,
      failing_status: ost$status,
      new_delete_selection_list_head: ^name_list,
      selection_1_p: ^selection,
      selection_2_p: ^selection,
      value_p: ^clt$data_value;

?? NEWTITLE := 'check_delete_selection', EJECT ??

    PROCEDURE check_delete_selection
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$selection =
          IF pvt [p$selection].value^.kind = clc$list THEN
            report_duplicate_name (pvt [p$selection].value, 'SELECTION', status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          IFEND;
          report_fields_and_put (pvt [p$selection].value, status);
        ELSE
        CASEND;
      IFEND;

    PROCEND check_delete_selection;

?? OLDTITLE, EJECT ??

    PROCEDURE delete
      (    delete_selection_list_p: ^name_list;
       VAR delete_status: boolean;
       VAR status: ost$status);

      status.normal := TRUE;

      selection_1_p := ptv$selection_chain_head_p;
      selection_2_p := ptv$selection_chain_head_p;
      WHILE (selection_1_p <> NIL) AND (selection_1_p^.name <> delete_selection_list_p^.name) DO
        selection_2_p := selection_1_p;
        selection_1_p := selection_1_p^.selection_chain_link_p;
      WHILEND;

      IF selection_1_p <> NIL THEN
        IF selection_1_p^.number_of_successor_statistics = 0 THEN

          IF selection_1_p^.predecessor_job_statistic_p <> NIL THEN
            selection_1_p^.predecessor_job_statistic_p^.number_of_successor_statistics :=
                  selection_1_p^.predecessor_job_statistic_p^.number_of_successor_statistics - 1;
          IFEND;

          IF selection_1_p^.predecessor_task_statistic_p <> NIL THEN
            selection_1_p^.predecessor_task_statistic_p^.number_of_successor_statistics :=
                  selection_1_p^.predecessor_task_statistic_p^.number_of_successor_statistics - 1;
          IFEND;

          IF selection_1_p = ptv$selection_chain_head_p THEN
            ptv$selection_chain_head_p := selection_1_p^.selection_chain_link_p;
          ELSE
            selection_2_p^.selection_chain_link_p := selection_1_p^.selection_chain_link_p;
          IFEND;
          free_descriptive_selection (selection_1_p^.descriptive_subfield_p);
          FREE selection_1_p;

          delete_status := TRUE;
        ELSE
          delete_status := FALSE;
        IFEND;
      ELSE
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$undefined_selec_for_delete,
              delete_selection_list_p^.name, failing_status);
        report_intermediate_error (failing_status, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        errors_detected := TRUE;
        delete_status := TRUE;
      IFEND;

    PROCEND delete;


    status.normal := TRUE;
    errors_detected := FALSE;

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

    IF pvt [p$selection].value^.kind = clc$keyword THEN

{ ALL

      selection_1_p := ptv$selection_chain_head_p;
      WHILE selection_1_p <> NIL DO
        selection_2_p := selection_1_p^.selection_chain_link_p;
        FREE selection_1_p;
        selection_1_p := selection_2_p;
      WHILEND;
      ptv$selection_chain_head_p := NIL;
    ELSE

{ LIST

      value_p := pvt [p$selection].value;
      PUSH delete_selection_list_head;
      delete_selection_list_1_p := delete_selection_list_head;
      delete_selection_list_1_p^.name := value_p^.element_value^.name_value;
      value_p := value_p^.link;
      WHILE value_p <> NIL DO
        PUSH delete_selection_list_1_p^.link_p;
        delete_selection_list_1_p := delete_selection_list_1_p^.link_p;
        delete_selection_list_1_p^.name := value_p^.element_value^.name_value;
        value_p := value_p^.link;
      WHILEND;
      delete_selection_list_1_p^.link_p := NIL;

      delete_more := TRUE;
      WHILE (delete_selection_list_head <> NIL) AND delete_more DO
        delete_selection_list_1_p := delete_selection_list_head;
        delete_more := FALSE;
        new_delete_selection_list_head := NIL;
        WHILE delete_selection_list_1_p <> NIL DO
          delete (delete_selection_list_1_p, delete_status, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          IF delete_status THEN
            delete_more := TRUE;
          ELSE
            IF new_delete_selection_list_head = NIL THEN
              PUSH new_delete_selection_list_head;
              delete_selection_list_2 := new_delete_selection_list_head;
            ELSE
              PUSH delete_selection_list_2^.link_p;
              delete_selection_list_2 := delete_selection_list_2^.link_p;
            IFEND;
            delete_selection_list_2^.name := delete_selection_list_1_p^.name;
            delete_selection_list_2^.link_p := NIL;
          IFEND;
          delete_selection_list_1_p := delete_selection_list_1_p^.link_p;
        WHILEND;
        delete_selection_list_head := new_delete_selection_list_head;
      WHILEND;

      IF delete_selection_list_head <> NIL THEN
        delete_selection_list_1_p := delete_selection_list_head;
        WHILE delete_selection_list_1_p <> NIL DO
          osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$selection_has_successor,
                delete_selection_list_1_p^.name, failing_status);
          report_intermediate_error (failing_status, status);
          delete_selection_list_1_p := delete_selection_list_1_p^.link_p;
        WHILEND;
        errors_detected := TRUE;
      IFEND;

      IF ptv$selection_chain_head_p <> NIL THEN
        ptv$selection_chain_tail_p := ptv$selection_chain_head_p;
        WHILE ptv$selection_chain_tail_p^.selection_chain_link_p <> NIL DO
          ptv$selection_chain_tail_p := ptv$selection_chain_tail_p^.selection_chain_link_p;
        WHILEND;
      IFEND;

      IF errors_detected THEN
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$error_processing_parameter, 'SELECTION',
              status);
        RETURN; {----->
      IFEND;
    IFEND;

  PROCEND delete_selection_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'display_selection_cmd', EJECT ??

{ This procedure processes the display_selection command.

*copyc pth$anabl_display_selection

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

{  PROCEDURE (ptm$anabl_diss) display_selection, diss (
{  selection, selections, s: (CHECK) any of
{      key
{        all
{      keyend
{      list of name
{    anyend = all
{  display_option, do: key
{      (name, names, n)
{      all
{    keyend = name
{  output, o: file = $output
{  status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 8] of clt$pdt_parameter_name,
      parameters: array [1 .. 4] 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        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,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
        default_value: string (3),
      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 (4),
      recend,
      type3: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 28, 10, 36, 42, 520],
    clc$command, 8, 4, 0, 0, 0, 0, 4, 'PTM$ANABL_DISS'], [
    ['DISPLAY_OPTION                 ',clc$nominal_entry, 2],
    ['DO                             ',clc$abbreviation_entry, 2],
    ['O                              ',clc$abbreviation_entry, 3],
    ['OUTPUT                         ',clc$nominal_entry, 3],
    ['S                              ',clc$abbreviation_entry, 1],
    ['SELECTION                      ',clc$nominal_entry, 1],
    ['SELECTIONS                     ',clc$alias_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 4]],
    [
{ 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$extended_parameter_checking, 85,
  clc$optional_default_parameter, 0, 3],
{ PARAMETER 2
    [1, 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, 4],
{ PARAMETER 3
    [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$optional_default_parameter, 0, 7],
{ PARAMETER 4
    [8, 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$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$name_type], [1, osc$max_name_size]]
      ]
    ,
    'all'],
{ PARAMETER 2
    [[1, 0, clc$keyword_type], [4], [
    ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['NAME                           ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['NAMES                          ', clc$alias_entry, clc$normal_usage_entry, 1]]
    ,
    'name'],
{ PARAMETER 3
    [[1, 0, clc$file_type],
    '$output'],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

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

    CONST
      p$selection = 1,
      p$display_option = 2,
      p$output = 3,
      p$status = 4;

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

    VAR
      errors_detected: boolean,
      failing_status: ost$status,
      number: integer,
      put_entry_p: ^put_entry,
      selection_p: ^selection,
      task_id_index: string (ptc$task_id_index_string_size),
      task_id_seqno: string (ptc$task_id_seqno_string_size),
      value_p: ^clt$data_value;

?? NEWTITLE := 'check_display_selection', EJECT ??

    PROCEDURE check_display_selection
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$selection =
          IF pvt [p$selection].value^.kind = clc$list THEN
            report_duplicate_name (pvt [p$selection].value, 'SELECTION', status);
          IFEND;
        ELSE
        CASEND;
      IFEND;

    PROCEND check_display_selection;

?? OLDTITLE ??
?? NEWTITLE := 'format_selection_display', EJECT ??

    PROCEDURE format_selection_display
      (VAR status: ost$status);

      VAR
        date_time_string_1: ost$string,
        date_time_string_2: ost$string,
        field_p: ^field,
        length_string: ost$string,
        string_p: ^descriptive_data_string,
        subfield_number_string: ost$string,
        subfield_p: ^descriptive_data_subfield;

?? NEWTITLE := '[inline] put_next_line', EJECT ??

      PROCEDURE [INLINE] put_next_line
        (    str: string ( * ));

        cyp$put_next_line (ptv$output_file, str, status);
        IF NOT status.normal THEN
          EXIT format_selection_display; {----->
        IFEND;

      PROCEND put_next_line;
?? OLDTITLE ??
?? EJECT ??
      status.normal := TRUE;

      IF pvt [p$display_option].value^.keyword_value = 'ALL' THEN

        STRINGREP (ptv$output_line, ptv$output_line_length, ' Selection  : ', selection_p^.name);
        put_next_line (ptv$output_line (1, ptv$output_line_length));

        IF selection_p^.statistic_specified OR selection_p^.date_time_specified OR
              selection_p^.descriptive_specified OR (selection_p^.predecessor_job_statistic_p <> NIL) OR
              (selection_p^.predecessor_task_statistic_p <> NIL) OR
              (selection_p^.job_name <> jmc$blank_system_supplied_name) OR selection_p^.task_id_specified THEN

          put_next_line ('   Selection Criteria');

          IF selection_p^.statistic_specified THEN
            ptv$output_line (1, 25) := '     Statistic Code    : ';
            ptv$output_line (26, 7) := selection_p^.statistic_name (1, 7);
          IFEND;
          put_next_line (ptv$output_line (1, 33));

          IF selection_p^.date_time_specified THEN
            ptv$clt_date_time.value := selection_p^.start_date_time;
            clp$convert_date_time_to_string (ptv$clt_date_time, ptv$date_time_format, date_time_string_1,
                  status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            ptv$clt_date_time.value := selection_p^.end_date_time;
            clp$convert_date_time_to_string (ptv$clt_date_time, ptv$date_time_format, date_time_string_2,
                  status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            STRINGREP (ptv$output_line, ptv$output_line_length, '     Time              : ',
                  date_time_string_1.value (1, date_time_string_1.size): date_time_string_1.size, ' .. ',
                  date_time_string_2.value (1, date_time_string_2.size): date_time_string_2.size);
            put_next_line (ptv$output_line (1, ptv$output_line_length));

            STRINGREP (ptv$output_line, ptv$output_line_length, '     Continuous        :',
                  selection_p^.continuous_date_time);
            put_next_line (ptv$output_line (1, ptv$output_line_length));
          IFEND;

          IF selection_p^.descriptive_specified THEN
            put_next_line ('     Descriptive Data');

            subfield_p := selection_p^.descriptive_subfield_p;
            WHILE subfield_p <> NIL DO
              IF subfield_p^.subfield_length = sfc$max_descriptive_data_size THEN
                length_string.value := 'ALL';
                length_string.size := 3;
              ELSE
                clp$convert_integer_to_string (subfield_p^.subfield_length, 10, FALSE, length_string, status);
              IFEND;

              IF subfield_p^.subfield_number = 0 THEN
                subfield_number_string.value := 'ALL';
                subfield_number_string.size := 3;
              ELSE
                clp$convert_integer_to_string (subfield_p^.subfield_number, 10, FALSE, subfield_number_string,
                      status);
              IFEND;

              STRINGREP (ptv$output_line, ptv$output_line_length, '       Position        : ',
                    subfield_p^.subfield_position);
              put_next_line (ptv$output_line (1, ptv$output_line_length));

              STRINGREP (ptv$output_line, ptv$output_line_length, '       Length          : ',
                    length_string.value (1, length_string.size));
              put_next_line (ptv$output_line (1, ptv$output_line_length));

              STRINGREP (ptv$output_line, ptv$output_line_length, '       Field Number    : ',
                    subfield_number_string.value (1, subfield_number_string.size));
              put_next_line (ptv$output_line (1, ptv$output_line_length));

              STRINGREP (ptv$output_line, ptv$output_line_length, '       Field Delimiter : ''',
                    subfield_p^.subfield_delimiter, '''');
              put_next_line (ptv$output_line (1, ptv$output_line_length));

              put_next_line ('       String(s) :');
              string_p := subfield_p^.descriptive_data_string_p;
              WHILE string_p <> NIL DO
                write_descriptive_data_to_list (string_p^.descriptive_text
                      (1, #SIZE (string_p^.descriptive_text)), 9, status);
                IF NOT status.normal THEN
                  RETURN; {----->
                IFEND;
                string_p := string_p^.descriptive_string_link_p;
              WHILEND;
              subfield_p := subfield_p^.descriptive_subfield_link_p;
            WHILEND;
          IFEND;

          IF selection_p^.predecessor_job_statistic_p <> NIL THEN
            STRINGREP (ptv$output_line, ptv$output_line_length, '     Job predecessor   : ',
                  selection_p^.predecessor_job_statistic_p^.name);
            put_next_line (ptv$output_line (1, ptv$output_line_length));
          IFEND;

          IF selection_p^.predecessor_task_statistic_p <> NIL THEN
            STRINGREP (ptv$output_line, ptv$output_line_length, '     Task predecessor  : ',
                  selection_p^.predecessor_task_statistic_p^.name);
            put_next_line (ptv$output_line (1, ptv$output_line_length));
          IFEND;

          IF selection_p^.job_name <> jmc$blank_system_supplied_name THEN
            STRINGREP (ptv$output_line, ptv$output_line_length, '     Job Name          : ',
                  selection_p^.job_name);
            put_next_line (ptv$output_line (1, ptv$output_line_length));
          IFEND;

          IF selection_p^.task_id_specified THEN
            clp$convert_integer_to_rjstring (selection_p^.task_id.index, 10, FALSE, '0', task_id_index,
                  status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            clp$convert_integer_to_rjstring (selection_p^.task_id.seqno, 10, FALSE, '0', task_id_seqno,
                  status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

            STRINGREP (ptv$output_line, ptv$output_line_length, '     Task ID           : ', task_id_index,
                  '-', task_id_seqno);
            put_next_line (ptv$output_line (1, ptv$output_line_length));
          IFEND;

          STRINGREP (ptv$output_line, ptv$output_line_length, '     Inverted Selection: ',
                selection_p^.inverted_selection);
          put_next_line (ptv$output_line (1, ptv$output_line_length));
        ELSE
          put_next_line ('   Selection Criteria : No Selection');
        IFEND;

        IF selection_p^.number_of_successor_statistics > 0 THEN
          put_next_line ('   Usage');
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          STRINGREP (ptv$output_line, ptv$output_line_length, '     Number of successor statistics   : ',
                selection_p^.number_of_successor_statistics);
          put_next_line (ptv$output_line (1, ptv$output_line_length));
        ELSE
          put_next_line ('   Usage : No References');
        IFEND;

        IF selection_p^.log_entry_p <> NIL THEN
          put_entry_p := ptv$log_entry_chain_head_p;
          number := 1;
          WHILE selection_p^.log_entry_p <> put_entry_p DO
            put_entry_p := put_entry_p^.put_chain_link_p;
            number := number + 1;
          WHILEND;
          put_next_line ('   Put log reference :');
          STRINGREP (ptv$output_line, ptv$output_line_length, '     Number : ', number, '   Name : ',
                selection_p^.log_entry_p^.name);
          put_next_line (ptv$output_line (1, ptv$output_line_length));
        IFEND;

        IF selection_p^.field_chain_p <> NIL THEN
          put_next_line ('   Field References');
          put_next_line ('Field Name                      Field Type');

          field_p := selection_p^.field_chain_p;
          WHILE field_p <> NIL DO

            CASE field_p^.field_type OF

            = counter_field =
              STRINGREP (ptv$output_line, ptv$output_line_length, field_p^.field_name,
                    ' Counter                Counter Number: ', field_p^.counter_number: 4);

            = descriptive_data_field =
              STRINGREP (ptv$output_line, ptv$output_line_length, field_p^.field_name, ' Descriptive Data');

            = date_time_field =
              STRINGREP (ptv$output_line, ptv$output_line_length, field_p^.field_name, ' Date Time');

            = statistic_code_field =
              STRINGREP (ptv$output_line, ptv$output_line_length, field_p^.field_name, ' Statistic Code');

            = system_job_name_field =
              STRINGREP (ptv$output_line, ptv$output_line_length, field_p^.field_name, ' System Job Name');

            = global_task_id_field =
              STRINGREP (ptv$output_line, ptv$output_line_length, field_p^.field_name, ' Global Task ID');

            = number_of_counters_field =
              STRINGREP (ptv$output_line, ptv$output_line_length, field_p^.field_name, ' Number of Counters');

            = descriptive_data_size_field =
              STRINGREP (ptv$output_line, ptv$output_line_length, field_p^.field_name,
                    ' Descriptive Data Size');

            = previous_occurrence_field =
              STRINGREP (ptv$output_line, ptv$output_line_length, field_p^.field_name,
                    ' Previous Occurrence');

            = predecessor_field =
              STRINGREP (ptv$output_line, ptv$output_line_length, field_p^.field_name, ' Predecessor');

            = predecessor_chain_head_field =
              STRINGREP (ptv$output_line, ptv$output_line_length, field_p^.field_name,
                    ' Predecessor Chain Head');

            = value_per_second_field =
              STRINGREP (ptv$output_line, ptv$output_line_length, field_p^.field_name, ' Value Per Second');

            = occurrence_per_second_field =
              STRINGREP (ptv$output_line, ptv$output_line_length, field_p^.field_name,
                    ' Occurrence Per Second');

            = text_field =
              STRINGREP (ptv$output_line, ptv$output_line_length, field_p^.field_name, ' Text');

            CASEND;

            put_next_line (ptv$output_line (1, ptv$output_line_length));
            field_p := field_p^.field_chain_link_p;
          WHILEND;

        IFEND;

        put_next_line (' ');
      ELSE
        put_next_line (selection_p^.name);
      IFEND;

    PROCEND format_selection_display;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

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

{ Opens output file.

    cyp$open_file (pvt [p$output].value^.file_value^, ^ptv$display_file_specifications, ptv$output_file,
          status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    ptv$maximum_line_length := cyp$page_width (ptv$output_file);
    IF ptv$maximum_line_length > 132 THEN
      ptv$maximum_line_length := 132;
    IFEND;

    errors_detected := FALSE;
    IF pvt [p$selection].value^.kind = clc$keyword THEN

{ ALL

      selection_p := ptv$selection_chain_head_p;
      WHILE selection_p <> NIL DO
        format_selection_display (status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        selection_p := selection_p^.selection_chain_link_p;
      WHILEND;
    ELSE

{ LIST

      value_p := pvt [p$selection].value;
      WHILE value_p <> NIL DO
        selection_p := ptv$selection_chain_head_p;
        WHILE (selection_p <> NIL) AND (value_p^.element_value^.name_value <> selection_p^.name) DO
          selection_p := selection_p^.selection_chain_link_p;
        WHILEND;
        IF selection_p <> NIL THEN
          format_selection_display (status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        ELSE
          errors_detected := TRUE;
          osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$undefined_selec_for_dis,
                value_p^.element_value^.name_value, failing_status);
          report_intermediate_error (failing_status, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          errors_detected := TRUE;
        IFEND;
        value_p := value_p^.link;
      WHILEND;
    IFEND;

    cyp$close_file (ptv$output_file, cyc$default_open_position, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF errors_detected THEN
      osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$error_processing_parameter, 'SELECTION',
            status);
      RETURN; {----->
    IFEND;

  PROCEND display_selection_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'add_field_cmd', EJECT ??

{ This procedure processes the add_field command.

*copyc pth$anabl_add_field

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

{  PROCEDURE (ptm$anabl_addf) add_field, addf (
{  field, f: (CHECK) name = $required
{  selection, s: (CHECK) name = $required
{  counter, c: record
{      counter_number: integer 1..sfc$max_number_of_counters
{      multiplier: real = $optional
{      incremental: boolean = $optional
{      allow_negative_increment: boolean = $optional
{    recend = $optional
{  descriptive_data, dd: record
{      position: integer 1..sfc$max_descriptive_data_size = $optional
{      length: any of
{        key
{          all
{        keyend
{        integer 1..sfc$max_descriptive_data_size
{      anyend = $optional
{      field_number: any of
{        key
{          all
{        keyend
{        integer 1..sfc$max_descriptive_data_size
{      anyend = $optional
{      field_delimiter: string 1 = $optional
{    recend = $optional
{  header, h: key
{      (statistic_code , sc)
{      (date_time, dt)
{      (system_job_name, sjn)
{      (global_task_id, gti)
{      (number_of_counters, noc)
{      (descriptive_data_length, ddl)
{    keyend = $optional
{    elapsed_time, et: key
{      (previous_occurrence, po)
{      (predecessor, p)
{      (predecessor_chain_head, pch)
{    keyend = $optional
{  string, str: string 0..sfc$max_descriptive_data_size = $optional
{  elapsed_time_calculation, etc: (CHECK) record
{      calculation: key
{        (value_per_second, vps)
{        (occurrence_per_second, ops)
{      keyend
{      elapsed_time: key
{        (previous_occurrence, po)
{        (predecessor, p)
{        (predecessor_chain_head, pch)
{      keyend
{      counter_number: integer 1..sfc$max_number_of_counters = $optional
{      multiplier: real = $optional
{      incremental: boolean = $optional
{      allow_negative_increment: boolean = $optional
{    recend = $optional
{  text, t: (hidden) any of
{      string 0..sfc$max_descriptive_data_size
{      record
{        position: integer 1..sfc$max_descriptive_data_size = $optional
{        length: any of
{          key
{            (all, a)
{          keyend
{          integer 1..sfc$max_descriptive_data_size
{        anyend = $optional
{        field_number: any of
{          key
{            (all, a)
{          keyend
{          integer 1..sfc$max_descriptive_data_size
{        anyend = $optional
{        field_delimiter: string 1 = $optional
{      recend
{    anyend = $optional
{  multiplier, m: (hidden) real = $optional
{  incremental, i: (hidden) boolean = $optional
{  status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 23] of clt$pdt_parameter_name,
      parameters: array [1 .. 12] 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$name_type_qualifier,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$record_type_qualifier,
        field_spec_1: clt$field_specification,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        field_spec_2: clt$field_specification,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$real_type_qualifier,
        recend,
        field_spec_3: clt$field_specification,
        element_type_spec_3: record
          header: clt$type_specification_header,
        recend,
        field_spec_4: clt$field_specification,
        element_type_spec_4: record
          header: clt$type_specification_header,
        recend,
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$record_type_qualifier,
        field_spec_1: clt$field_specification,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        field_spec_2: clt$field_specification,
        element_type_spec_2: 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,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 1] of clt$keyword_specification,
          recend,
          type_size_2: clt$type_specification_size,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
        recend,
        field_spec_3: clt$field_specification,
        element_type_spec_3: 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,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 1] of clt$keyword_specification,
          recend,
          type_size_2: clt$type_specification_size,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
        recend,
        field_spec_4: clt$field_specification,
        element_type_spec_4: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
      recend,
      type5: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 12] of clt$keyword_specification,
      recend,
      type6: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 6] of clt$keyword_specification,
      recend,
      type7: record
        header: clt$type_specification_header,
        qualifier: clt$string_type_qualifier,
      recend,
      type8: record
        header: clt$type_specification_header,
        qualifier: clt$record_type_qualifier,
        field_spec_1: clt$field_specification,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 4] of clt$keyword_specification,
        recend,
        field_spec_2: clt$field_specification,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 6] of clt$keyword_specification,
        recend,
        field_spec_3: clt$field_specification,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        field_spec_4: clt$field_specification,
        element_type_spec_4: record
          header: clt$type_specification_header,
          qualifier: clt$real_type_qualifier,
        recend,
        field_spec_5: clt$field_specification,
        element_type_spec_5: record
          header: clt$type_specification_header,
        recend,
        field_spec_6: clt$field_specification,
        element_type_spec_6: record
          header: clt$type_specification_header,
        recend,
      recend,
      type9: 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,
          qualifier: clt$string_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$record_type_qualifier,
          field_spec_1: clt$field_specification,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
          field_spec_2: clt$field_specification,
          element_type_spec_2: 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,
              qualifier: clt$keyword_type_qualifier,
              keyword_specs: array [1 .. 2] of clt$keyword_specification,
            recend,
            type_size_2: clt$type_specification_size,
            element_type_spec_2: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
          recend,
          field_spec_3: clt$field_specification,
          element_type_spec_3: 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,
              qualifier: clt$keyword_type_qualifier,
              keyword_specs: array [1 .. 2] of clt$keyword_specification,
            recend,
            type_size_2: clt$type_specification_size,
            element_type_spec_2: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
          recend,
          field_spec_4: clt$field_specification,
          element_type_spec_4: record
            header: clt$type_specification_header,
            qualifier: clt$string_type_qualifier,
          recend,
        recend,
      recend,
      type10: record
        header: clt$type_specification_header,
        qualifier: clt$real_type_qualifier,
      recend,
      type11: record
        header: clt$type_specification_header,
      recend,
      type12: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 28, 10, 51, 31, 378],
    clc$command, 23, 12, 2, 0, 3, 0, 12, 'PTM$ANABL_ADDF'], [
    ['C                              ',clc$abbreviation_entry, 3],
    ['COUNTER                        ',clc$nominal_entry, 3],
    ['DD                             ',clc$abbreviation_entry, 4],
    ['DESCRIPTIVE_DATA               ',clc$nominal_entry, 4],
    ['ELAPSED_TIME                   ',clc$nominal_entry, 6],
    ['ELAPSED_TIME_CALCULATION       ',clc$nominal_entry, 8],
    ['ET                             ',clc$abbreviation_entry, 6],
    ['ETC                            ',clc$abbreviation_entry, 8],
    ['F                              ',clc$abbreviation_entry, 1],
    ['FIELD                          ',clc$nominal_entry, 1],
    ['H                              ',clc$abbreviation_entry, 5],
    ['HEADER                         ',clc$nominal_entry, 5],
    ['I                              ',clc$abbreviation_entry, 11],
    ['INCREMENTAL                    ',clc$nominal_entry, 11],
    ['M                              ',clc$abbreviation_entry, 10],
    ['MULTIPLIER                     ',clc$nominal_entry, 10],
    ['S                              ',clc$abbreviation_entry, 2],
    ['SELECTION                      ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 12],
    ['STR                            ',clc$abbreviation_entry, 7],
    ['STRING                         ',clc$nominal_entry, 7],
    ['T                              ',clc$abbreviation_entry, 9],
    ['TEXT                           ',clc$nominal_entry, 9]],
    [
{ PARAMETER 1
    [10, 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$extended_parameter_checking, 5, clc$required_parameter, 0
  , 0],
{ PARAMETER 2
    [18, 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$extended_parameter_checking, 5, clc$required_parameter, 0
  , 0],
{ PARAMETER 3
    [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, 212,
  clc$optional_parameter, 0, 0],
{ PARAMETER 4
    [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, 347,
  clc$optional_parameter, 0, 0],
{ PARAMETER 5
    [12, 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, 451,
  clc$optional_parameter, 0, 0],
{ PARAMETER 6
    [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, 229,
  clc$optional_parameter, 0, 0],
{ PARAMETER 7
    [21, 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, 8, clc$optional_parameter, 0
  , 0],
{ PARAMETER 8
    [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$extended_parameter_checking, 668,
  clc$optional_parameter, 0, 0],
{ PARAMETER 9
    [23, clc$hidden_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 449,
  clc$optional_parameter, 0, 0],
{ PARAMETER 10
    [16, clc$hidden_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 35, clc$optional_parameter,
  0, 0],
{ PARAMETER 11
    [14, clc$hidden_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$optional_parameter, 0
  , 0],
{ PARAMETER 12
    [19, 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, osc$max_name_size]],
{ PARAMETER 2
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 3
    [[1, 0, clc$record_type], [4],
    ['COUNTER_NUMBER                 ', clc$required_field, 20], [[1, 0, clc$integer_type], [1,
  sfc$max_number_of_counters, 10]],
    ['MULTIPLIER                     ', clc$optional_field, 35], [[1, 0, clc$real_type],
      [[{-$INFINITY} 3, [[0D000(16), 0(16)], [0D000(16), 0(16)]]],
      [{$INFINITY} 3, [[5000(16), 0(16)], [5000(16), 0(16)]]]]
      ],
    ['INCREMENTAL                    ', clc$optional_field, 3], [[1, 0, clc$boolean_type]],
    ['ALLOW_NEGATIVE_INCREMENT       ', clc$optional_field, 3], [[1, 0, clc$boolean_type]]
    ],
{ PARAMETER 4
    [[1, 0, clc$record_type], [4],
    ['POSITION                       ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  sfc$max_descriptive_data_size, 10]],
    ['LENGTH                         ', clc$optional_field, 84], [[1, 0, clc$union_type], [[
      clc$integer_type, clc$keyword_type],
      FALSE, 2],
      44, [[1, 0, clc$keyword_type], [1], [
        ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
        ],
      20, [[1, 0, clc$integer_type], [1, sfc$max_descriptive_data_size, 10]]
      ],
    ['FIELD_NUMBER                   ', clc$optional_field, 84], [[1, 0, clc$union_type], [[
      clc$integer_type, clc$keyword_type],
      FALSE, 2],
      44, [[1, 0, clc$keyword_type], [1], [
        ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
        ],
      20, [[1, 0, clc$integer_type], [1, sfc$max_descriptive_data_size, 10]]
      ],
    ['FIELD_DELIMITER                ', clc$optional_field, 8], [[1, 0, clc$string_type], [1, 1, FALSE]]
    ],
{ PARAMETER 5
    [[1, 0, clc$keyword_type], [12], [
    ['DATE_TIME                      ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['DDL                            ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
    ['DESCRIPTIVE_DATA_LENGTH        ', clc$nominal_entry, clc$normal_usage_entry, 6],
    ['DT                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['GLOBAL_TASK_ID                 ', clc$nominal_entry, clc$normal_usage_entry, 4],
    ['GTI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
    ['NOC                            ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
    ['NUMBER_OF_COUNTERS             ', clc$nominal_entry, clc$normal_usage_entry, 5],
    ['SC                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['SJN                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['STATISTIC_CODE                 ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['SYSTEM_JOB_NAME                ', clc$nominal_entry, clc$normal_usage_entry, 3]]
    ],
{ PARAMETER 6
    [[1, 0, clc$keyword_type], [6], [
    ['P                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['PCH                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['PO                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['PREDECESSOR                    ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['PREDECESSOR_CHAIN_HEAD         ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['PREVIOUS_OCCURRENCE            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
    ],
{ PARAMETER 7
    [[1, 0, clc$string_type], [0, sfc$max_descriptive_data_size, FALSE]],
{ PARAMETER 8
    [[1, 0, clc$record_type], [6],
    ['CALCULATION                    ', clc$required_field, 155], [[1, 0, clc$keyword_type], [4], [
      ['OCCURRENCE_PER_SECOND          ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['OPS                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['VALUE_PER_SECOND               ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['VPS                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1]]
      ],
    ['ELAPSED_TIME                   ', clc$required_field, 229], [[1, 0, clc$keyword_type], [6], [
      ['P                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['PCH                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['PO                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['PREDECESSOR                    ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['PREDECESSOR_CHAIN_HEAD         ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['PREVIOUS_OCCURRENCE            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    ['COUNTER_NUMBER                 ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  sfc$max_number_of_counters, 10]],
    ['MULTIPLIER                     ', clc$optional_field, 35], [[1, 0, clc$real_type],
      [[{-$INFINITY} 3, [[0D000(16), 0(16)], [0D000(16), 0(16)]]],
      [{$INFINITY} 3, [[5000(16), 0(16)], [5000(16), 0(16)]]]]
      ],
    ['INCREMENTAL                    ', clc$optional_field, 3], [[1, 0, clc$boolean_type]],
    ['ALLOW_NEGATIVE_INCREMENT       ', clc$optional_field, 3], [[1, 0, clc$boolean_type]]
    ],
{ PARAMETER 9
    [[1, 0, clc$union_type], [[clc$record_type, clc$string_type],
    FALSE, 2],
    8, [[1, 0, clc$string_type], [0, sfc$max_descriptive_data_size, FALSE]],
    421, [[1, 0, clc$record_type], [4],
      ['POSITION                       ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  sfc$max_descriptive_data_size, 10]],
      ['LENGTH                         ', clc$optional_field, 121], [[1, 0, clc$union_type], [[
        clc$integer_type, clc$keyword_type],
        FALSE, 2],
        81, [[1, 0, clc$keyword_type], [2], [
          ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
          ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
          ],
        20, [[1, 0, clc$integer_type], [1, sfc$max_descriptive_data_size, 10]]
        ],
      ['FIELD_NUMBER                   ', clc$optional_field, 121], [[1, 0, clc$union_type], [[
        clc$integer_type, clc$keyword_type],
        FALSE, 2],
        81, [[1, 0, clc$keyword_type], [2], [
          ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
          ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
          ],
        20, [[1, 0, clc$integer_type], [1, sfc$max_descriptive_data_size, 10]]
        ],
      ['FIELD_DELIMITER                ', clc$optional_field, 8], [[1, 0, clc$string_type], [1, 1, FALSE]]
      ]
    ],
{ PARAMETER 10
    [[1, 0, clc$real_type],
    [[{-$INFINITY} 3, [[0D000(16), 0(16)], [0D000(16), 0(16)]]],
    [{$INFINITY} 3, [[5000(16), 0(16)], [5000(16), 0(16)]]]]
    ],
{ PARAMETER 11
    [[1, 0, clc$boolean_type]],
{ PARAMETER 12
    [[1, 0, clc$status_type]]];

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

    CONST
      p$field = 1,
      p$selection = 2,
      p$counter = 3,
      p$descriptive_data = 4,
      p$header = 5,
      p$elapsed_time = 6,
      p$string = 7,
      p$elapsed_time_calculation = 8,
      p$text = 9,
      p$multiplier = 10,
      p$incremental = 11,
      p$status = 12;

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

    VAR
      field_p: ^field,
      field_type: type_of_field,

{ The record initial_field must be initialized with a field type, that type is date_time_field.

      initial_field: [STATIC, READ] field := [ * { field_name } , NIL
            { field_chain_link_p } , NIL { selection_p } , NIL { original_selection_p } , NIL
            { report_list_p } , FALSE { first_value } , FALSE { collect_summary } , FALSE
            { collect_all_occurrences } , [0 { count } , 0 { sum } , 0.0 { mean } ,
            0.0 { standard_deviation }, 0.0 { square_sum } , clc$max_integer { minimum } , -clc$max_integer
            { maximum } , 0 { interval } , 0 { elapsed_time_since_predecessor } , 0.0 { count_per_sec } , 0.0
            { sum_per_sec } , * { first_date_time } , * { last_date_time } , FALSE { sum_overflow } ], 1
            { counter_number } , 1.0 { multiplier } , FALSE { incremental } , FALSE
            { allow_negative_increment } , 0 { last_value } , date_time_field
            { field_type } , * { first_date_time_value } , * { last_date_time_value } , NIL
            { date_time_value_head_p } , NIL { date_time_value_tail_p } ],
      long_real_value: record
        high: real,
        low: real,
      recend,
      selection_p: ^selection;

?? NEWTITLE := 'check_add_field', EJECT ??

    PROCEDURE check_add_field
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF

        = p$field =
          check_duplicate_field_name (pvt [p$field].value^.name_value, status);

        = p$selection =
          check_undefined_selection (pvt [p$selection].value^.name_value, pte$undefined_selec_for_field,
                selection_p, status);

        = p$elapsed_time_calculation =
          IF pvt [p$elapsed_time_calculation].value^.field_values^ [1].value^.keyword_value =
                ptc$key_value_per_second THEN
            IF pvt [p$elapsed_time_calculation].value^.field_values^ [3].value = NIL { counter_number } THEN
              osp$set_status_condition (pte$no_counter_in_etc_vps, status);
            IFEND;
          ELSE { = ptc$key_occurrence_per_second }
            IF (pvt [p$elapsed_time_calculation].value^.field_values^ [3].value <> NIL)
                  { counter_number } OR (pvt [p$elapsed_time_calculation].value^.field_values^ [4].
                  value <> NIL) { multiplier } OR (pvt [p$elapsed_time_calculation].value^.field_values^ [5].
                  value <> NIL) { incremental } OR (pvt [p$elapsed_time_calculation].value^.field_values^ [6].
                  value <> NIL) { allow_negative_increment } THEN
              osp$set_status_condition (pte$counter_in_etc_ops, status);
            IFEND;
          IFEND;

        ELSE
        CASEND;

      ELSE
        check_duplicate_field_name (pvt [p$field].value^.name_value, status);
      IFEND;

    PROCEND check_add_field;

?? OLDTITLE ??
?? NEWTITLE := 'allocate_field', EJECT ??

    PROCEDURE allocate_field;

      IF selection_p^.field_chain_p <> NIL THEN
        field_p := selection_p^.field_chain_p;
        WHILE field_p^.field_chain_link_p <> NIL DO
          field_p := field_p^.field_chain_link_p;
        WHILEND;
        ALLOCATE field_p^.field_chain_link_p;
        field_p := field_p^.field_chain_link_p;
      ELSE
        ALLOCATE selection_p^.field_chain_p;
        field_p := selection_p^.field_chain_p;
      IFEND;

      field_p^ := initial_field;
      field_p^.field_name := pvt [p$field].value^.name_value;
      field_p^.selection_p := selection_p;
      field_p^.field_type := field_type;

    PROCEND allocate_field;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;
    field_type := undefined_field;
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), ^check_add_field, ^pvt, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

{SCL in full screen prompting returns a good status when QUIT is pressed again.
{So we have to check this again except we should ever fix SCL....

    check_duplicate_field_name (pvt [p$field].value^.name_value, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    process_field_type (pvt [p$counter], pvt [p$descriptive_data], pvt [p$header], pvt [p$elapsed_time],
          pvt [p$string], pvt [p$elapsed_time_calculation], pvt[p$text], field_type, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF field_type = undefined_field THEN
      osp$set_status_condition (pte$no_field_type_parameter, status);
      RETURN;
    IFEND;

    IF (pvt [p$incremental].specified OR pvt [p$multiplier].specified) THEN

{  Incremental and multiplier are valid only for counter_field, value_per_second_field and
{  occurrence_per_second_field.

      IF NOT ((field_type = counter_field) OR
              (field_type = value_per_second_field) OR
              (field_type = occurrence_per_second_field)) THEN
          osp$set_status_condition (pte$incr_or_mult_not_allowed, status);
          RETURN;
      IFEND;
    IFEND;

    allocate_field;
    set_field_type (field_type, field_p, status);

{ Start 1.4.1 compatibility code.

      IF pvt [p$incremental].specified THEN
        field_p^.incremental := pvt [p$incremental].value^.boolean_value.value;
      IFEND;

      IF pvt [p$multiplier].specified THEN
        #UNCHECKED_CONVERSION (pvt [p$multiplier].value^.real_value.value, long_real_value);
        field_p^.multiplier := long_real_value.high;
      IFEND;

{ End 1.4.1 compatibility code.

    CASE field_type OF

    = counter_field =
      set_field_counter (pvt [p$counter].value, field_p);

    = descriptive_data_field =
      IF pvt [p$descriptive_data].specified THEN
        set_field_descriptive_data (pvt [p$descriptive_data].value, field_p);
      ELSE { text parameter specified - 1.4.1 compatibility code }
        set_field_descriptive_data (pvt [p$text].value, field_p);
      IFEND;

    = value_per_second_field =
      set_field_counter (pvt [p$elapsed_time_calculation].value, field_p);
      set_elapsed_time_field (pvt [p$elapsed_time_calculation].value^.field_values^ [2], field_p);

    = occurrence_per_second_field =
      set_elapsed_time_field (pvt [p$elapsed_time_calculation].value^.field_values^ [2], field_p);

    = text_field =
      IF pvt [p$string].specified THEN
        ALLOCATE field_p^.descriptive_text_p: [#SIZE (pvt [p$string].value^.string_value^)];
        field_p^.descriptive_text_p^ := pvt [p$string].value^.string_value^;
      ELSE { text parameter specified - 1.4.1 compatibility code }
        ALLOCATE field_p^.descriptive_text_p: [#SIZE (pvt [p$text].value^.string_value^)];
        field_p^.descriptive_text_p^ := pvt [p$text].value^.string_value^;
      IFEND;

    ELSE
    CASEND;

  PROCEND add_field_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'change_field_cmd', EJECT ??

{ This procedure processes the change_field command.

*copyc pth$anabl_change_field

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

{  PROCEDURE (ptm$anabl_chaf) change_field, chaf (
{  field, f: (CHECK) name = $required
{  new_field, nf: (CHECK) name = $optional
{  selection, s: (CHECK) name = $optional
{  counter, c: (CHECK) record
{      counter_number: integer 1..sfc$max_number_of_counters = $optional
{      multiplier: real = $optional
{      incremental: boolean = $optional
{      allow_negative_increment: boolean = $optional
{    recend = $optional
{  descriptive_data, dd: record
{      position: integer 1..sfc$max_descriptive_data_size = $optional
{      length: any of
{        key
{          all
{        keyend
{        integer 1..sfc$max_descriptive_data_size
{      anyend = $optional
{      field_number: any of
{        key
{          all
{        keyend
{        integer 1..sfc$max_descriptive_data_size
{      anyend = $optional
{      field_delimiter: string 1 = $optional
{    recend = $optional
{  header, h: key
{      (statistic_code , sc)
{      (date_time, dt)
{      (system_job_name, sjn)
{      (global_task_id, gti)
{      (number_of_counters, noc)
{      (descriptive_data_length, ddl)
{    keyend = $optional
{    elapsed_time, et: key
{      (previous_occurrence, po)
{      (predecessor, p)
{      (predecessor_chain_head, pch)
{    keyend = $optional
{  string, str: string 0..sfc$max_descriptive_data_size = $optional
{  elapsed_time_calculation, etc: (CHECK) record
{      calculation: key
{        (value_per_second, vps)
{        (occurrence_per_second, ops)
{      keyend = $optional
{      elapsed_time: key
{        (previous_occurrence, po)
{        (predecessor, p)
{        (predecessor_chain_head, pch)
{      keyend = $optional
{      counter_number: integer 1..sfc$max_number_of_counters = $optional
{      multiplier: real = $optional
{      incremental: boolean = $optional
{      allow_negative_increment: boolean = $optional
{    recend = $optional
{  text, t: (hidden) any of
{      string 0..sfc$max_descriptive_data_size
{      record
{        position: integer 1..sfc$max_descriptive_data_size = $optional
{        length: any of
{          key
{            (all, a)
{          keyend
{          integer 1..sfc$max_descriptive_data_size
{        anyend = $optional
{        field_number: any of
{          key
{            (all, a)
{          keyend
{          integer 1..sfc$max_descriptive_data_size
{        anyend = $optional
{        field_delimiter: string 1 = $optional
{      recend
{    anyend = $optional
{  multiplier, m: (hidden) real = $optional
{  incremental, i: (hidden) boolean = $optional
{  status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 25] of clt$pdt_parameter_name,
      parameters: array [1 .. 13] 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$name_type_qualifier,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$record_type_qualifier,
        field_spec_1: clt$field_specification,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        field_spec_2: clt$field_specification,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$real_type_qualifier,
        recend,
        field_spec_3: clt$field_specification,
        element_type_spec_3: record
          header: clt$type_specification_header,
        recend,
        field_spec_4: clt$field_specification,
        element_type_spec_4: record
          header: clt$type_specification_header,
        recend,
      recend,
      type5: record
        header: clt$type_specification_header,
        qualifier: clt$record_type_qualifier,
        field_spec_1: clt$field_specification,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        field_spec_2: clt$field_specification,
        element_type_spec_2: 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,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 1] of clt$keyword_specification,
          recend,
          type_size_2: clt$type_specification_size,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
        recend,
        field_spec_3: clt$field_specification,
        element_type_spec_3: 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,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 1] of clt$keyword_specification,
          recend,
          type_size_2: clt$type_specification_size,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
        recend,
        field_spec_4: clt$field_specification,
        element_type_spec_4: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
      recend,
      type6: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 12] of clt$keyword_specification,
      recend,
      type7: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 6] of clt$keyword_specification,
      recend,
      type8: record
        header: clt$type_specification_header,
        qualifier: clt$string_type_qualifier,
      recend,
      type9: record
        header: clt$type_specification_header,
        qualifier: clt$record_type_qualifier,
        field_spec_1: clt$field_specification,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 4] of clt$keyword_specification,
        recend,
        field_spec_2: clt$field_specification,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 6] of clt$keyword_specification,
        recend,
        field_spec_3: clt$field_specification,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        field_spec_4: clt$field_specification,
        element_type_spec_4: record
          header: clt$type_specification_header,
          qualifier: clt$real_type_qualifier,
        recend,
        field_spec_5: clt$field_specification,
        element_type_spec_5: record
          header: clt$type_specification_header,
        recend,
        field_spec_6: clt$field_specification,
        element_type_spec_6: record
          header: clt$type_specification_header,
        recend,
      recend,
      type10: 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,
          qualifier: clt$string_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$record_type_qualifier,
          field_spec_1: clt$field_specification,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
          field_spec_2: clt$field_specification,
          element_type_spec_2: 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,
              qualifier: clt$keyword_type_qualifier,
              keyword_specs: array [1 .. 2] of clt$keyword_specification,
            recend,
            type_size_2: clt$type_specification_size,
            element_type_spec_2: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
          recend,
          field_spec_3: clt$field_specification,
          element_type_spec_3: 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,
              qualifier: clt$keyword_type_qualifier,
              keyword_specs: array [1 .. 2] of clt$keyword_specification,
            recend,
            type_size_2: clt$type_specification_size,
            element_type_spec_2: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
          recend,
          field_spec_4: clt$field_specification,
          element_type_spec_4: record
            header: clt$type_specification_header,
            qualifier: clt$string_type_qualifier,
          recend,
        recend,
      recend,
      type11: record
        header: clt$type_specification_header,
        qualifier: clt$real_type_qualifier,
      recend,
      type12: record
        header: clt$type_specification_header,
      recend,
      type13: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 28, 11, 0, 41, 494],
    clc$command, 25, 13, 1, 0, 3, 0, 13, 'PTM$ANABL_CHAF'], [
    ['C                              ',clc$abbreviation_entry, 4],
    ['COUNTER                        ',clc$nominal_entry, 4],
    ['DD                             ',clc$abbreviation_entry, 5],
    ['DESCRIPTIVE_DATA               ',clc$nominal_entry, 5],
    ['ELAPSED_TIME                   ',clc$nominal_entry, 7],
    ['ELAPSED_TIME_CALCULATION       ',clc$nominal_entry, 9],
    ['ET                             ',clc$abbreviation_entry, 7],
    ['ETC                            ',clc$abbreviation_entry, 9],
    ['F                              ',clc$abbreviation_entry, 1],
    ['FIELD                          ',clc$nominal_entry, 1],
    ['H                              ',clc$abbreviation_entry, 6],
    ['HEADER                         ',clc$nominal_entry, 6],
    ['I                              ',clc$abbreviation_entry, 12],
    ['INCREMENTAL                    ',clc$nominal_entry, 12],
    ['M                              ',clc$abbreviation_entry, 11],
    ['MULTIPLIER                     ',clc$nominal_entry, 11],
    ['NEW_FIELD                      ',clc$nominal_entry, 2],
    ['NF                             ',clc$abbreviation_entry, 2],
    ['S                              ',clc$abbreviation_entry, 3],
    ['SELECTION                      ',clc$nominal_entry, 3],
    ['STATUS                         ',clc$nominal_entry, 13],
    ['STR                            ',clc$abbreviation_entry, 8],
    ['STRING                         ',clc$nominal_entry, 8],
    ['T                              ',clc$abbreviation_entry, 10],
    ['TEXT                           ',clc$nominal_entry, 10]],
    [
{ PARAMETER 1
    [10, 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$extended_parameter_checking, 5, clc$required_parameter, 0
  , 0],
{ PARAMETER 2
    [17, 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$extended_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 3
    [20, 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$extended_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ 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$extended_parameter_checking, 212,
  clc$optional_parameter, 0, 0],
{ PARAMETER 5
    [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, 347,
  clc$optional_parameter, 0, 0],
{ PARAMETER 6
    [12, 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, 451,
  clc$optional_parameter, 0, 0],
{ PARAMETER 7
    [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, 229,
  clc$optional_parameter, 0, 0],
{ PARAMETER 8
    [23, 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, 8, clc$optional_parameter, 0
  , 0],
{ PARAMETER 9
    [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$extended_parameter_checking, 668,
  clc$optional_parameter, 0, 0],
{ PARAMETER 10
    [25, clc$hidden_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 449,
  clc$optional_parameter, 0, 0],
{ PARAMETER 11
    [16, clc$hidden_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 35, clc$optional_parameter,
  0, 0],
{ PARAMETER 12
    [14, clc$hidden_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$optional_parameter, 0
  , 0],
{ PARAMETER 13
    [21, 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, osc$max_name_size]],
{ PARAMETER 2
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 3
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 4
    [[1, 0, clc$record_type], [4],
    ['COUNTER_NUMBER                 ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  sfc$max_number_of_counters, 10]],
    ['MULTIPLIER                     ', clc$optional_field, 35], [[1, 0, clc$real_type],
      [[{-$INFINITY} 3, [[0D000(16), 0(16)], [0D000(16), 0(16)]]],
      [{$INFINITY} 3, [[5000(16), 0(16)], [5000(16), 0(16)]]]]
      ],
    ['INCREMENTAL                    ', clc$optional_field, 3], [[1, 0, clc$boolean_type]],
    ['ALLOW_NEGATIVE_INCREMENT       ', clc$optional_field, 3], [[1, 0, clc$boolean_type]]
    ],
{ PARAMETER 5
    [[1, 0, clc$record_type], [4],
    ['POSITION                       ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  sfc$max_descriptive_data_size, 10]],
    ['LENGTH                         ', clc$optional_field, 84], [[1, 0, clc$union_type], [[
      clc$integer_type, clc$keyword_type],
      FALSE, 2],
      44, [[1, 0, clc$keyword_type], [1], [
        ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
        ],
      20, [[1, 0, clc$integer_type], [1, sfc$max_descriptive_data_size, 10]]
      ],
    ['FIELD_NUMBER                   ', clc$optional_field, 84], [[1, 0, clc$union_type], [[
      clc$integer_type, clc$keyword_type],
      FALSE, 2],
      44, [[1, 0, clc$keyword_type], [1], [
        ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
        ],
      20, [[1, 0, clc$integer_type], [1, sfc$max_descriptive_data_size, 10]]
      ],
    ['FIELD_DELIMITER                ', clc$optional_field, 8], [[1, 0, clc$string_type], [1, 1, FALSE]]
    ],
{ PARAMETER 6
    [[1, 0, clc$keyword_type], [12], [
    ['DATE_TIME                      ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['DDL                            ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
    ['DESCRIPTIVE_DATA_LENGTH        ', clc$nominal_entry, clc$normal_usage_entry, 6],
    ['DT                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['GLOBAL_TASK_ID                 ', clc$nominal_entry, clc$normal_usage_entry, 4],
    ['GTI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
    ['NOC                            ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
    ['NUMBER_OF_COUNTERS             ', clc$nominal_entry, clc$normal_usage_entry, 5],
    ['SC                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['SJN                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['STATISTIC_CODE                 ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['SYSTEM_JOB_NAME                ', clc$nominal_entry, clc$normal_usage_entry, 3]]
    ],
{ PARAMETER 7
    [[1, 0, clc$keyword_type], [6], [
    ['P                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['PCH                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['PO                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['PREDECESSOR                    ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['PREDECESSOR_CHAIN_HEAD         ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['PREVIOUS_OCCURRENCE            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
    ],
{ PARAMETER 8
    [[1, 0, clc$string_type], [0, sfc$max_descriptive_data_size, FALSE]],
{ PARAMETER 9
    [[1, 0, clc$record_type], [6],
    ['CALCULATION                    ', clc$optional_field, 155], [[1, 0, clc$keyword_type], [4], [
      ['OCCURRENCE_PER_SECOND          ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['OPS                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['VALUE_PER_SECOND               ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['VPS                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1]]
      ],
    ['ELAPSED_TIME                   ', clc$optional_field, 229], [[1, 0, clc$keyword_type], [6], [
      ['P                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['PCH                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['PO                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['PREDECESSOR                    ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['PREDECESSOR_CHAIN_HEAD         ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['PREVIOUS_OCCURRENCE            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    ['COUNTER_NUMBER                 ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  sfc$max_number_of_counters, 10]],
    ['MULTIPLIER                     ', clc$optional_field, 35], [[1, 0, clc$real_type],
      [[{-$INFINITY} 3, [[0D000(16), 0(16)], [0D000(16), 0(16)]]],
      [{$INFINITY} 3, [[5000(16), 0(16)], [5000(16), 0(16)]]]]
      ],
    ['INCREMENTAL                    ', clc$optional_field, 3], [[1, 0, clc$boolean_type]],
    ['ALLOW_NEGATIVE_INCREMENT       ', clc$optional_field, 3], [[1, 0, clc$boolean_type]]
    ],
{ PARAMETER 10
    [[1, 0, clc$union_type], [[clc$record_type, clc$string_type],
    FALSE, 2],
    8, [[1, 0, clc$string_type], [0, sfc$max_descriptive_data_size, FALSE]],
    421, [[1, 0, clc$record_type], [4],
      ['POSITION                       ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  sfc$max_descriptive_data_size, 10]],
      ['LENGTH                         ', clc$optional_field, 121], [[1, 0, clc$union_type], [[
        clc$integer_type, clc$keyword_type],
        FALSE, 2],
        81, [[1, 0, clc$keyword_type], [2], [
          ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
          ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
          ],
        20, [[1, 0, clc$integer_type], [1, sfc$max_descriptive_data_size, 10]]
        ],
      ['FIELD_NUMBER                   ', clc$optional_field, 121], [[1, 0, clc$union_type], [[
        clc$integer_type, clc$keyword_type],
        FALSE, 2],
        81, [[1, 0, clc$keyword_type], [2], [
          ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
          ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
          ],
        20, [[1, 0, clc$integer_type], [1, sfc$max_descriptive_data_size, 10]]
        ],
      ['FIELD_DELIMITER                ', clc$optional_field, 8], [[1, 0, clc$string_type], [1, 1, FALSE]]
      ]
    ],
{ PARAMETER 11
    [[1, 0, clc$real_type],
    [[{-$INFINITY} 3, [[0D000(16), 0(16)], [0D000(16), 0(16)]]],
    [{$INFINITY} 3, [[5000(16), 0(16)], [5000(16), 0(16)]]]]
    ],
{ PARAMETER 12
    [[1, 0, clc$boolean_type]],
{ PARAMETER 13
    [[1, 0, clc$status_type]]];

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

    CONST
      p$field = 1,
      p$new_field = 2,
      p$selection = 3,
      p$counter = 4,
      p$descriptive_data = 5,
      p$header = 6,
      p$elapsed_time = 7,
      p$string = 8,
      p$elapsed_time_calculation = 9,
      p$text = 10,
      p$multiplier = 11,
      p$incremental = 12,
      p$status = 13;

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

    VAR
      field_p: ^field,
      field_1_p: ^field,
      long_real_value: record
        high: real,
        low: real,
      recend,
      new_field_type: type_of_field,
      new_selection_p: ^selection,
      selection_p: ^selection,
      test_field_type: type_of_field;

?? NEWTITLE := 'check_change_field', EJECT ??

    PROCEDURE check_change_field
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);


      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF

        = p$field =
          selection_p := ptv$selection_chain_head_p;

        /change/
          WHILE selection_p <> NIL DO

            field_p := selection_p^.field_chain_p;
            WHILE (field_p <> NIL) AND (field_p^.field_name <> pvt [p$field].value^.name_value) DO
              field_p := field_p^.field_chain_link_p;
            WHILEND;

            IF field_p <> NIL THEN
              EXIT /change/; {----->
            IFEND;

            selection_p := selection_p^.selection_chain_link_p;
          WHILEND /change/;
          IF field_p = NIL THEN
            osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$undefined_field_for_change,
                  pvt [p$field].value^.name_value, status);
          IFEND;

        = p$new_field =
          IF pvt [p$new_field].specified THEN
            check_duplicate_field_name (pvt [p$new_field].value^.name_value, status);
          IFEND;

        = p$selection =
          IF pvt [p$selection].specified THEN
            check_undefined_selection (pvt [p$selection].value^.name_value, pte$undefined_selec_for_field,
                  new_selection_p, status);
          IFEND;

        = p$counter =
          IF (field_p <> NIL) AND (field_p^.field_type <> counter_field) AND
                (pvt [p$counter].value^.field_values^ [1].value = NIL) { counter_number } THEN

{ User must specify counter_number in order to change the type of the field to counter field type.

            osp$set_status_condition (pte$no_counter_number, status);
          IFEND;

        = p$elapsed_time_calculation =
          IF (field_p^.field_type <> value_per_second_field) AND
                (field_p^.field_type <> occurrence_per_second_field) THEN

{ User must specify calculation and elapsed_time in order to change the type of the field to
{ occurrence_per_second field type or value_per_second field type.

            IF pvt [p$elapsed_time_calculation].value^.field_values^ [1].value = NIL { calculation } THEN

{ User specified parameter elapsed_time_calculation when the current field type isn't value_per_second_field
{ or occurrence_per_second_field and didn't specify the required field calculation.

              osp$set_status_condition (pte$no_calculation_in_etc, status);
              RETURN; {----->
            IFEND;

            IF pvt [p$elapsed_time_calculation].value^.field_values^ [2].value = NIL { elapsed_time } THEN

{ User specified parameter elapsed_time_calculation when the current field type isn't value_per_second_field
{ or occurrence_per_second_field and didn't specify the required field elapsed_time.

              osp$set_status_condition (pte$no_elapsed_time_in_etc, status);
              RETURN; {----->
            IFEND;

          IFEND;

          IF (field_p^.field_type <> value_per_second_field) AND
                (pvt [p$elapsed_time_calculation].value^.field_values^ [1].value^.keyword_value =
                ptc$key_value_per_second) AND (pvt [p$elapsed_time_calculation].value^.field_values^ [3].
                value = NIL) { counter_number } THEN

{ User must specify counter_number in order to change the type of the field to value_per_second field type.

            osp$set_status_condition (pte$no_counter_in_etc_vps, status);
            RETURN; {----->
          IFEND;

          IF ((field_p^.field_type = occurrence_per_second_field) AND
                (pvt [p$elapsed_time_calculation].value^.field_values^ [1].value = NIL)) OR
                ((pvt [p$elapsed_time_calculation].value^.field_values^ [1].value <> NIL) AND
                (pvt [p$elapsed_time_calculation].value^.field_values^ [1].value^.keyword_value =
                ptc$key_occurrence_per_second)) THEN
            IF (pvt [p$elapsed_time_calculation].value^.field_values^ [3].value <> NIL)
                  { counter_number } OR (pvt [p$elapsed_time_calculation].value^.field_values^ [4].
                  value <> NIL) { multiplier } OR (pvt [p$elapsed_time_calculation].value^.field_values^ [5].
                  value <> NIL) { incremental } OR (pvt [p$elapsed_time_calculation].value^.field_values^ [6].
                  value <> NIL) { allow_negative_increment} THEN
              osp$set_status_condition (pte$counter_in_etc_ops, status);
              RETURN; {----->
            IFEND;
          IFEND;

        ELSE
        CASEND;
      IFEND;

    PROCEND check_change_field;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;
    new_field_type := undefined_field;
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), ^check_change_field, ^pvt, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    process_field_type (pvt [p$counter], pvt [p$descriptive_data], pvt [p$header], pvt [p$elapsed_time],
          pvt [p$string], pvt [p$elapsed_time_calculation], pvt [p$text], new_field_type, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF (new_field_type = undefined_field) AND pvt [p$elapsed_time_calculation].specified THEN

{   Elapsed_time_calculation parameter was specified without specifying the field calculation.  The new field
{ type is the current field type (value_per_second_field or occurrence_per_second_field).

      new_field_type := field_p^.field_type;
    IFEND;

    IF (pvt [p$incremental].specified OR pvt [p$multiplier].specified) THEN

{  Incremental and multiplier are valid only for counter_field, value_per_second_field and
{  occurrence_per_second_field.  If a field type is specified on the change_field command
{  check using the new field type, otherwise check using the existing field type.

      IF new_field_type = undefined_field THEN
        test_field_type := field_p^.field_type;
      ELSE
        test_field_type := new_field_type;
      IFEND;

      IF NOT ((test_field_type = counter_field) OR
              (test_field_type = value_per_second_field) OR
              (test_field_type = occurrence_per_second_field)) THEN
          osp$set_status_condition (pte$incr_or_mult_not_allowed, status);
          RETURN;
      IFEND;
    IFEND;

{ Start 1.4.1 compatibility code.

    IF pvt [p$incremental].specified THEN
      field_p^.incremental := pvt [p$incremental].value^.boolean_value.value;
    IFEND;

    IF pvt [p$multiplier].specified THEN
      #UNCHECKED_CONVERSION (pvt [p$multiplier].value^.real_value.value, long_real_value);
      field_p^.multiplier := long_real_value.high;
    IFEND;

{ End 1.4.1 compatibility code.

    IF pvt [p$new_field].specified THEN
      field_p^.field_name := pvt [p$new_field].value^.name_value;
    IFEND;

    IF pvt [p$selection].specified THEN
      IF selection_p^.field_chain_p = field_p THEN
        selection_p^.field_chain_p := field_p^.field_chain_link_p;
      ELSE
        field_1_p := selection_p^.field_chain_p;
        WHILE field_1_p^.field_chain_link_p <> field_p DO
          field_1_p := field_1_p^.field_chain_link_p;
        WHILEND;
        field_1_p^.field_chain_link_p := field_p^.field_chain_link_p;
      IFEND;

      IF new_selection_p^.field_chain_p <> NIL THEN
        field_1_p := new_selection_p^.field_chain_p;
        WHILE field_1_p^.field_chain_link_p <> NIL DO
          field_1_p := field_1_p^.field_chain_link_p;
        WHILEND;
        field_1_p^.field_chain_link_p := field_p;
      ELSE
        new_selection_p^.field_chain_p := field_p;
      IFEND;
      field_p^.field_chain_link_p := NIL;
      field_p^.selection_p := new_selection_p;
    IFEND;

    IF new_field_type <> undefined_field THEN

      IF field_p^.field_type = text_field THEN
        FREE field_p^.descriptive_text_p;
      IFEND;

      IF new_field_type <> field_p^.field_type THEN
        field_p^.field_type := new_field_type;
        set_field_type (new_field_type, field_p, status);
      IFEND;

      CASE new_field_type OF

      = counter_field =
        set_field_counter (pvt [p$counter].value, field_p);

      = descriptive_data_field =
        IF pvt [p$descriptive_data].specified THEN
          set_field_descriptive_data (pvt [p$descriptive_data].value, field_p);
        ELSE { text parameter specified - 1.4.1 compatibility code }
          set_field_descriptive_data (pvt [p$text].value, field_p);
        IFEND;

      = value_per_second_field =
        set_field_counter (pvt [p$elapsed_time_calculation].value, field_p);
        set_elapsed_time_field (pvt [p$elapsed_time_calculation].value^.field_values^ [2], field_p);

      = occurrence_per_second_field =
        set_elapsed_time_field (pvt [p$elapsed_time_calculation].value^.field_values^ [2], field_p);

      = text_field =
        IF pvt [p$string].specified THEN
          ALLOCATE field_p^.descriptive_text_p: [#SIZE (pvt [p$string].value^.string_value^)];
          field_p^.descriptive_text_p^ := pvt [p$string].value^.string_value^;
        ELSE { text parameter specified - 1.4.1 compatibility code }
          ALLOCATE field_p^.descriptive_text_p: [#SIZE (pvt [p$text].value^.string_value^)];
          field_p^.descriptive_text_p^ := pvt [p$text].value^.string_value^;
        IFEND;

      ELSE
      CASEND;

    IFEND;

  PROCEND change_field_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'delete_field_cmd', EJECT ??

{ This procedure processes the delete_field command.

*copyc pth$anabl_delete_field

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

{  PROCEDURE (ptm$anabl_delf) delete_field, delf (
{  field, fields, f: (CHECK) any of
{      key
{        all
{      keyend
{      list of name
{    anyend = $required
{  status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 4] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        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,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 27, 12, 46, 13, 237],
    clc$command, 4, 2, 1, 0, 0, 0, 2, 'PTM$ANABL_DELF'], [
    ['F                              ',clc$abbreviation_entry, 1],
    ['FIELD                          ',clc$nominal_entry, 1],
    ['FIELDS                         ',clc$alias_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 2]],
    [
{ 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$extended_parameter_checking, 85, 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$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$name_type], [1, osc$max_name_size]]
      ]
    ],
{ PARAMETER 2
    [[1, 0, clc$status_type]]];

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

    CONST
      p$field = 1,
      p$status = 2;

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

    VAR
      delete_status: boolean,
      errors_detected: boolean,
      failing_status: ost$status,
      field_1_p: ^field,
      field_2_p: ^field,
      selection_p: ^selection,
      value_p: ^clt$data_value;

?? NEWTITLE := 'check_delete_field', EJECT ??

    PROCEDURE check_delete_field
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$field =
          IF pvt [p$field].value^.kind = clc$list THEN
            report_duplicate_name (pvt [p$field].value, 'FIELD', status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          IFEND;
          report_put (pvt [p$field].value, status);
        ELSE
        CASEND;
      IFEND;

    PROCEND check_delete_field;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;
    errors_detected := FALSE;

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

    IF pvt [p$field].value^.kind = clc$keyword THEN

{ ALL

      selection_p := ptv$selection_chain_head_p;
      WHILE selection_p <> NIL DO

        field_1_p := selection_p^.field_chain_p;
        WHILE field_1_p <> NIL DO
          field_2_p := field_1_p^.field_chain_link_p;
          IF field_1_p^.field_type = text_field THEN
            FREE field_1_p^.descriptive_text_p;
          IFEND;
          FREE field_1_p;
          field_1_p := field_2_p;
        WHILEND;
        selection_p^.field_chain_p := NIL;

        selection_p := selection_p^.selection_chain_link_p;
      WHILEND;
    ELSE

{ LIST

      value_p := pvt [p$field].value;
      WHILE value_p <> NIL DO
        delete_status := FALSE;
        selection_p := ptv$selection_chain_head_p;

      /delete/
        WHILE selection_p <> NIL DO

          field_1_p := selection_p^.field_chain_p;
          field_2_p := selection_p^.field_chain_p;
          WHILE (field_1_p <> NIL) AND (field_1_p^.field_name <> value_p^.element_value^.name_value) DO
            field_2_p := field_1_p;
            field_1_p := field_1_p^.field_chain_link_p;
          WHILEND;

          IF field_1_p <> NIL THEN
            IF field_1_p = selection_p^.field_chain_p THEN
              selection_p^.field_chain_p := field_1_p^.field_chain_link_p;
            ELSE
              field_2_p^.field_chain_link_p := field_1_p^.field_chain_link_p;
            IFEND;
            IF field_1_p^.field_type = text_field THEN
              FREE field_1_p^.descriptive_text_p;
            IFEND;
            FREE field_1_p;
            delete_status := TRUE;
            EXIT /delete/; {----->
          IFEND;

          selection_p := selection_p^.selection_chain_link_p;
        WHILEND /delete/;

        IF NOT delete_status THEN
          osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$undefined_field_for_delete,
                value_p^.element_value^.name_value, failing_status);
          report_intermediate_error (failing_status, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          errors_detected := TRUE;
        IFEND;

        value_p := value_p^.link;
      WHILEND;
      IF errors_detected THEN
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$error_processing_parameter, 'FIELD', status);
        RETURN; {----->
      IFEND;
    IFEND;

  PROCEND delete_field_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'display_field_cmd', EJECT ??

{ This procedure processes the display_field command.

*copyc pth$anabl_display_field

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

{  PROCEDURE (ptm$anabl_disf) display_field, disf (
{  field, fields, f: (CHECK) any of
{      key
{        all
{      keyend
{      list of name
{    anyend = all
{  display_option, do: key
{      (all, a)
{      (name, names, n)
{    keyend = name
{  output, o: file = $output
{  status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 8] of clt$pdt_parameter_name,
      parameters: array [1 .. 4] 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        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,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
        default_value: string (3),
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 5] of clt$keyword_specification,
        default_value: string (4),
      recend,
      type3: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 27, 12, 46, 59, 719],
    clc$command, 8, 4, 0, 0, 0, 0, 4, 'PTM$ANABL_DISF'], [
    ['DISPLAY_OPTION                 ',clc$nominal_entry, 2],
    ['DO                             ',clc$abbreviation_entry, 2],
    ['F                              ',clc$abbreviation_entry, 1],
    ['FIELD                          ',clc$nominal_entry, 1],
    ['FIELDS                         ',clc$alias_entry, 1],
    ['O                              ',clc$abbreviation_entry, 3],
    ['OUTPUT                         ',clc$nominal_entry, 3],
    ['STATUS                         ',clc$nominal_entry, 4]],
    [
{ 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$extended_parameter_checking, 85,
  clc$optional_default_parameter, 0, 3],
{ PARAMETER 2
    [1, 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, 192,
  clc$optional_default_parameter, 0, 4],
{ 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_default_parameter, 0, 7],
{ PARAMETER 4
    [8, 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$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$name_type], [1, osc$max_name_size]]
      ]
    ,
    'all'],
{ PARAMETER 2
    [[1, 0, clc$keyword_type], [5], [
    ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['NAME                           ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['NAMES                          ', clc$alias_entry, clc$normal_usage_entry, 2]]
    ,
    'name'],
{ PARAMETER 3
    [[1, 0, clc$file_type],
    '$output'],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

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

    CONST
      p$field = 1,
      p$display_option = 2,
      p$output = 3,
      p$status = 4;

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

    VAR
      display_status: boolean,
      errors_detected: boolean,
      failing_status: ost$status,
      field_p: ^field,
      number: integer,
      put_entry_p: ^put_entry,
      report_list_p: ^report_list,
      selection_p: ^selection,
      value_p: ^clt$data_value;


?? NEWTITLE := 'check_display_field', EJECT ??

    PROCEDURE check_display_field
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$field =
          IF pvt [p$field].value^.kind = clc$list THEN
            report_duplicate_name (pvt [p$field].value, 'FIELD', status);
          IFEND;
        ELSE
        CASEND;
      IFEND;

    PROCEND check_display_field;

?? OLDTITLE ??
?? NEWTITLE := 'display_report_list', EJECT ??

    PROCEDURE display_report_list
      (VAR status: ost$status);

      status.normal := TRUE;

      cyp$put_next_line (ptv$output_file, '   Put Report Reference :', status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

      WHILE report_list_p <> NIL DO
        put_entry_p := ptv$report_entry_chain_head_p;
        number := 1;
        WHILE report_list_p^.report_p <> put_entry_p DO
          put_entry_p := put_entry_p^.put_chain_link_p;
          number := number + 1;
        WHILEND;
        CASE report_list_p^.report_p^.put OF
        = put_field =
          STRINGREP (ptv$output_line, ptv$output_line_length, '     Number : ', number, '   Name : ',
                report_list_p^.report_p^.name, '  Put Type : Put Field');
        = put_field_summary =
          STRINGREP (ptv$output_line, ptv$output_line_length, '     Number : ', number, '   Name : ',
                report_list_p^.report_p^.name, '  Put Type : Put Field Summary');
        = put_interval_field =
          STRINGREP (ptv$output_line, ptv$output_line_length, '     Number : ', number, '   Name : ',
                report_list_p^.report_p^.name, '  Put Type : Put Interval Field');
        ELSE
        CASEND;
        cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        report_list_p := report_list_p^.link_p;
      WHILEND;

    PROCEND display_report_list;

?? OLDTITLE ??
?? NEWTITLE := 'format_counter_display', EJECT ??

    PROCEDURE format_counter_display
      (VAR status: ost$status);

      VAR
        length_string: ost$string,
        subfield_number_string: ost$string;

      status.normal := TRUE;

      STRINGREP (ptv$output_line, ptv$output_line_length, '     Counter Number: ',
            field_p^.counter_number: 4);
      cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

      STRINGREP (ptv$output_line, ptv$output_line_length, '     Multiplier: ', field_p^.multiplier);
      cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

      IF field_p^.incremental THEN
        cyp$put_next_line (ptv$output_file, '     Incremental Counter', status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        IF field_p^.allow_negative_increment THEN
          cyp$put_next_line (ptv$output_file, '     Allow Negative Increment', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        IFEND;
      IFEND;

    PROCEND format_counter_display;

?? OLDTITLE ??
?? NEWTITLE := 'format_descriptive_data_display', EJECT ??

    PROCEDURE format_descriptive_data_display
      (VAR status: ost$status);

      VAR
        length_string: ost$string,
        subfield_number_string: ost$string;

      status.normal := TRUE;

      cyp$put_next_line (ptv$output_file, '  Field Type: Descriptive Data', status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

      IF field_p^.subfield_length = sfc$max_descriptive_data_size THEN
        length_string.value := 'ALL';
        length_string.size := 3;
      ELSE
        clp$convert_integer_to_string (field_p^.subfield_length, 10, FALSE, length_string, status);
      IFEND;

      IF field_p^.subfield_number = 0 THEN
        subfield_number_string.value := 'ALL';
        subfield_number_string.size := 3;
      ELSE
        clp$convert_integer_to_string (field_p^.subfield_number, 10, FALSE, subfield_number_string, status);
      IFEND;

      STRINGREP (ptv$output_line, ptv$output_line_length, '     Position: ', field_p^.subfield_position,
            '  Length: ', length_string.value (1, length_string.size), '  Field Number: ',
            subfield_number_string.value (1, subfield_number_string.size), '  Field Delimiter: ''',
            field_p^.subfield_delimiter, '''');
      cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

    PROCEND format_descriptive_data_display;

?? OLDTITLE ??
?? NEWTITLE := 'format_field_display', EJECT ??

    PROCEDURE format_field_display
      (VAR status: ost$status);

      VAR
        length_string: ost$string,
        subfield_number_string: ost$string;

      status.normal := TRUE;

      IF pvt [p$display_option].value^.keyword_value = 'ALL' THEN

        STRINGREP (ptv$output_line, ptv$output_line_length, ' Field: ', field_p^.field_name);
        cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;

        STRINGREP (ptv$output_line, ptv$output_line_length, '   Selection: ', selection_p^.name);
        cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;

        CASE field_p^.field_type OF

        = counter_field =
          cyp$put_next_line (ptv$output_file, '  Field Type: Counter', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          format_counter_display (status);

        = descriptive_data_field =
          format_descriptive_data_display (status);

        = date_time_field =
          cyp$put_next_line (ptv$output_file, '  Field Type: Date Time', status);

        = statistic_code_field =
          cyp$put_next_line (ptv$output_file, '  Field Type: Statistic Code', status);

        = system_job_name_field =
          cyp$put_next_line (ptv$output_file, '  Field Type: System Job Name', status);

        = global_task_id_field =
          cyp$put_next_line (ptv$output_file, '  Field Type: Global Task ID', status);

        = number_of_counters_field =
          cyp$put_next_line (ptv$output_file, '  Field Type: Number of Counters', status);

        = descriptive_data_size_field =
          cyp$put_next_line (ptv$output_file, '  Field Type: Descriptive Data Size', status);

        = previous_occurrence_field =
          cyp$put_next_line (ptv$output_file, '  Field Type: Elapsed Time Since Previous Occurrence', status);

        = predecessor_field =
          cyp$put_next_line (ptv$output_file, '  Field Type: Elapsed Time Since Predecessor', status);

        = predecessor_chain_head_field =
          cyp$put_next_line (ptv$output_file, '  Field Type: Elapsed Time Since Predecessor Chain Head',
                status);

        = text_field =
          cyp$put_next_line (ptv$output_file, '  Field Type: Text', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          STRINGREP (ptv$output_line, ptv$output_line_length, '     Text: ', field_p^.descriptive_text_p^);
          cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);

        = value_per_second_field, occurrence_per_second_field =
          IF field_p^.field_type = value_per_second_field THEN
            cyp$put_next_line (ptv$output_file, '  Field Type: Value Per Second', status);
          ELSE
            cyp$put_next_line (ptv$output_file, '  Field Type: Occurrence Per Second', status);
          IFEND;
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          CASE field_p^.elapsed_time OF
          = previous_occurrence =
            cyp$put_next_line (ptv$output_file, '     Elapsed Time: Previous Occurrence', status);

          = predecessor =
            cyp$put_next_line (ptv$output_file, '     Elapsed Time: Predecessor', status);

          = predecessor_chain_head =
            cyp$put_next_line (ptv$output_file, '     Elapsed Time: Predecessor Chain Head', status);

          ELSE
          CASEND;
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          IF field_p^.field_type = value_per_second_field THEN
            format_counter_display (status);
          IFEND;

        ELSE
        CASEND;
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;


        IF field_p^.report_list_p <> NIL THEN
          report_list_p := field_p^.report_list_p;
          display_report_list (status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        IFEND;

        cyp$put_next_line (ptv$output_file, ' ', status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;

      ELSE
        cyp$put_next_line (ptv$output_file, field_p^.field_name, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
      IFEND;

    PROCEND format_field_display;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), ^check_display_field, ^pvt, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

{ Opens output file.

    cyp$open_file (pvt [p$output].value^.file_value^, ^ptv$display_file_specifications, ptv$output_file,
          status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    ptv$maximum_line_length := cyp$page_width (ptv$output_file);
    IF ptv$maximum_line_length > 132 THEN
      ptv$maximum_line_length := 132;
    IFEND;

    errors_detected := FALSE;
    IF pvt [p$field].value^.kind = clc$keyword THEN
      IF pvt [p$field].value^.keyword_value = 'ALL' THEN

{ ALL

        selection_p := ptv$selection_chain_head_p;
        WHILE selection_p <> NIL DO

          field_p := selection_p^.field_chain_p;
          WHILE field_p <> NIL DO
            format_field_display (status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            field_p := field_p^.field_chain_link_p;
          WHILEND;

          selection_p := selection_p^.selection_chain_link_p;
        WHILEND;
      IFEND;
    ELSE

{ LIST

      value_p := pvt [p$field].value;
      WHILE value_p <> NIL DO
        display_status := FALSE;
        selection_p := ptv$selection_chain_head_p;

      /display/
        WHILE selection_p <> NIL DO

          field_p := selection_p^.field_chain_p;
          WHILE (field_p <> NIL) AND (field_p^.field_name <> value_p^.element_value^.name_value) DO
            field_p := field_p^.field_chain_link_p;
          WHILEND;
          IF field_p <> NIL THEN
            format_field_display (status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            display_status := TRUE;
            EXIT /display/; {----->
          IFEND;

          selection_p := selection_p^.selection_chain_link_p;
        WHILEND /display/;

        IF NOT display_status THEN
          osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$undefined_field_for_dis,
                value_p^.element_value^.name_value, failing_status);
          report_intermediate_error (failing_status, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          errors_detected := TRUE;
        IFEND;

        value_p := value_p^.link;
      WHILEND;
    IFEND;

    cyp$close_file (ptv$output_file, cyc$default_open_position, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF errors_detected THEN
      osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$error_processing_parameter, 'FIELD', status);
      RETURN; {----->
    IFEND;

  PROCEND display_field_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'put_field_summary_cmd', EJECT ??

{ This procedure processes the put_field_summary command.

*copyc pth$anabl_put_field_summary

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

{   PROCEDURE (ptm$anabl_putfs) put_field_summary, putfs (
{   field, fields, f: (CHECK) list of record
{       field_name: name
{       row_label: string = $optional
{     recend = $required
{   display_option, do, summary_calculation, sc: list of record
{       calculation: key
{         (count, c)
{         (sum, s)
{         (mean, m, average, avg)
{         (standard_deviation, sd)
{         (minimum, min)
{         (maximum, max)
{         (count_per_second, cps)
{         (sum_per_second, sps)
{       hidden_key
{         (interval, i)
{         (elapsed_time_since_predecessor, etsp)
{       keyend
{       start_column: integer 1..ptc$max_page_width = $optional
{       column_width: integer 1..ptc$max_page_width = $optional
{     recend = ((count 32 10) (sum 43 15) (mean 59 15) (standard_deviation 85 15) (minimum 101 15) ..
{    (maximum 117 15))
{   display_headers, dh: boolean = false
{   row_label_format, rlf: record
{       start_column: integer 1..ptc$max_page_width
{       column_width: integer 1..ptc$max_page_width
{     recend = (1 31)
{   put, p: (CHECK) name = $optional
{   number, n: any of
{       key
{         (next, n)
{       keyend
{       integer 1..clc$max_integer
{     anyend = next
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 16] of clt$pdt_parameter_name,
      parameters: array [1 .. 7] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$record_type_qualifier,
          field_spec_1: clt$field_specification,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
          field_spec_2: clt$field_specification,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$string_type_qualifier,
          recend,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$record_type_qualifier,
          field_spec_1: clt$field_specification,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 22] of clt$keyword_specification,
          recend,
          field_spec_2: clt$field_specification,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
          field_spec_3: clt$field_specification,
          element_type_spec_3: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
        recend,
        default_value: string (104),
      recend,
      type3: record
        header: clt$type_specification_header,
        default_value: string (5),
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$record_type_qualifier,
        field_spec_1: clt$field_specification,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        field_spec_2: clt$field_specification,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (6),
      recend,
      type5: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type6: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (4),
      recend,
      type7: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 27, 12, 50, 36, 746],
    clc$command, 16, 7, 1, 0, 0, 0, 7, 'PTM$ANABL_PUTFS'], [
    ['DH                             ',clc$abbreviation_entry, 3],
    ['DISPLAY_HEADERS                ',clc$nominal_entry, 3],
    ['DISPLAY_OPTION                 ',clc$nominal_entry, 2],
    ['DO                             ',clc$alias_entry, 2],
    ['F                              ',clc$abbreviation_entry, 1],
    ['FIELD                          ',clc$nominal_entry, 1],
    ['FIELDS                         ',clc$alias_entry, 1],
    ['N                              ',clc$abbreviation_entry, 6],
    ['NUMBER                         ',clc$nominal_entry, 6],
    ['P                              ',clc$abbreviation_entry, 5],
    ['PUT                            ',clc$nominal_entry, 5],
    ['RLF                            ',clc$abbreviation_entry, 4],
    ['ROW_LABEL_FORMAT               ',clc$nominal_entry, 4],
    ['SC                             ',clc$abbreviation_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 7],
    ['SUMMARY_CALCULATION            ',clc$alias_entry, 2]],
    [
{ 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$extended_parameter_checking, 108,
  clc$required_parameter, 0, 0],
{ PARAMETER 2
    [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, 992,
  clc$optional_default_parameter, 0, 104],
{ PARAMETER 3
    [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_default_parameter, 0, 5],
{ PARAMETER 4
    [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, 119,
  clc$optional_default_parameter, 0, 6],
{ PARAMETER 5
    [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$extended_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 6
    [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, 121,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 7
    [15, 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$list_type], [92, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$record_type], [2],
      ['FIELD_NAME                     ', clc$required_field, 5], [[1, 0, clc$name_type], [1,
  osc$max_name_size]],
      ['ROW_LABEL                      ', clc$optional_field, 8], [[1, 0, clc$string_type], [0,
  clc$max_string_size, FALSE]]
      ]
    ],
{ PARAMETER 2
    [[1, 0, clc$list_type], [976, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$record_type], [3],
      ['CALCULATION                    ', clc$required_field, 821], [[1, 0, clc$keyword_type], [22], [
        ['AVERAGE                        ', clc$alias_entry, clc$normal_usage_entry, 3],
        ['AVG                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['C                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['COUNT                          ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['COUNT_PER_SECOND               ', clc$nominal_entry, clc$normal_usage_entry, 7],
        ['CPS                            ', clc$abbreviation_entry, clc$normal_usage_entry, 7],
        ['ELAPSED_TIME_SINCE_PREDECESSOR ', clc$nominal_entry, clc$hidden_entry, 10],
        ['ETSP                           ', clc$abbreviation_entry, clc$hidden_entry, 10],
        ['I                              ', clc$abbreviation_entry, clc$hidden_entry, 9],
        ['INTERVAL                       ', clc$nominal_entry, clc$hidden_entry, 9],
        ['M                              ', clc$alias_entry, clc$normal_usage_entry, 3],
        ['MAX                            ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
        ['MAXIMUM                        ', clc$nominal_entry, clc$normal_usage_entry, 6],
        ['MEAN                           ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['MIN                            ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
        ['MINIMUM                        ', clc$nominal_entry, clc$normal_usage_entry, 5],
        ['S                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['SD                             ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
        ['SPS                            ', clc$abbreviation_entry, clc$normal_usage_entry, 8],
        ['STANDARD_DEVIATION             ', clc$nominal_entry, clc$normal_usage_entry, 4],
        ['SUM                            ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['SUM_PER_SECOND                 ', clc$nominal_entry, clc$normal_usage_entry, 8]]
        ],
      ['START_COLUMN                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]],
      ['COLUMN_WIDTH                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]]
      ]
    ,
    '((count 32 10) (sum 43 15) (mean 59 15) (standard_deviation 85 15) (minimum 101 15)    (maximum 117 15))'
  ],
{ PARAMETER 3
    [[1, 0, clc$boolean_type],
    'false'],
{ PARAMETER 4
    [[1, 0, clc$record_type], [2],
    ['START_COLUMN                   ', clc$required_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]],
    ['COLUMN_WIDTH                   ', clc$required_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]]
    ,
    '(1 31)'],
{ PARAMETER 5
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 6
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['NEXT                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [1, clc$max_integer, 10]]
    ,
    'next'],
{ PARAMETER 7
    [[1, 0, clc$status_type]]];

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

    CONST
      p$field = 1,
      p$display_option = 2,
      p$display_headers = 3,
      p$row_label_format = 4,
      p$put = 5,
      p$number = 6,
      p$status = 7;

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


    VAR
      initial_put_field_summary_entry: [STATIC, READ] put_entry :=
            ['                               ' { name }, NIL { put_chain_link_p } ,
            [REP ptc$field_vector_size of [NIL, null, * , * , FALSE, NIL]]
            { field_vector } , ' ' { header_1 } , ' ' { header_2 } , 0 {max_used_column}, put_field_summary
            { put } , NIL { fields } , [REP 10 of [null, * , * ]] { summary_vector } , 1
            { row_label_start_column } , 20 { row_label_column_width } , * { display_headers } ],
      report_entry_p: ^put_entry,
      temp_report_entry: ^put_entry;

?? NEWTITLE := 'check_put_field_summary', EJECT ??

    PROCEDURE check_put_field_summary
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$put =
          temp_report_entry^.name := '';
          IF pvt [p$put].specified THEN
            process_put_parameter (pvt [p$put].value^, ptv$report_entry_chain_head_p, temp_report_entry^.name,
                  status);
          IFEND;

        = p$field =
          report_undefined_counters (pvt [p$field].value, status);

        ELSE
        CASEND;
      ELSE

{ summary_calculation & row_label_format

        process_summary_calculation (pvt [p$display_option], pvt [p$row_label_format],
              temp_report_entry, status);
      IFEND;

    PROCEND check_put_field_summary;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

    clp$get_reason_for_call (ptv$information_request, ptv$display_file, ptv$prompting_activted, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    IF NOT ptv$information_request THEN

      IF ptv$generate = log THEN
        clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
        osp$set_status_condition (pte$generate_log_mode, status);
        RETURN; {----->
      IFEND;

      ALLOCATE temp_report_entry;
      temp_report_entry^ := initial_put_field_summary_entry;
    IFEND;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), ^check_put_field_summary, ^pvt, status);
    IF NOT status.normal THEN
      IF NOT ptv$information_request THEN
        FREE temp_report_entry;
      IFEND;
      RETURN; {----->
    IFEND;

    ptv$generate := report;

{ number

    process_number_parameter (pvt [p$number].value^, temp_report_entry, ptv$report_entry_chain_head_p);

{ display_headers

    temp_report_entry^.display_headers := pvt [p$display_headers].value^.boolean_value.value;
    process_headers_putfs (temp_report_entry);

{ field

    process_field_parameter_putfs (pvt [p$field].value, temp_report_entry);

  PROCEND put_field_summary_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'put_interval_field_cmd', EJECT ??

{ This procedure processes the put_interval_field command.

*copyc pth$anabl_put_interval_field

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

{    PROCEDURE (ptm$anabl_putif) put_interval_field, putif (
{    field, fields, f: (CHECK) list 1..ptc$field_vector_size of record
{        field_name: name
{        display_option: key
{          (first_occurrence, fo)
{          (count, c)
{          (sum, s)
{          (mean, m, average, avg)
{          (standard_deviation, sd)
{          (minimum, min)
{          (maximum, max)
{          (count_per_second, cps)
{          (sum_per_second, sps)
{        hidden_key
{          (interval, i)
{          (elapsed_time_since_predecessor, etsp)
{        keyend = $optional
{        start_column: integer 1..ptc$max_page_width = $optional
{        column_width: integer 1..ptc$max_page_width = $optional
{        header_1: string 1..ptc$max_page_width = $optional
{        header_2: string 1..ptc$max_page_width = $optional
{      recend = $required
{    report_interval, ri: integer 1..10000 = 1
{    row_label, rl: record
{        label: any of
{          key
{            (start_time, st)
{            (end_time, et)
{            (time_range, tr)
{            (none, n)
{          keyend
{          string
{        anyend = $optional
{        start_column: integer 1..ptc$max_page_width = $optional
{        column_width: integer 1..ptc$max_page_width = $optional
{        date_time_format: string = $optional
{      recend = (time_range 1 31 'HMS')
{    put, p: (CHECK) name = $optional
{    number, n: any of
{        key
{          (next, n)
{        keyend
{        integer 1..clc$max_integer
{      anyend = next
{    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$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$record_type_qualifier,
          field_spec_1: clt$field_specification,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
          field_spec_2: clt$field_specification,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 24] of clt$keyword_specification,
          recend,
          field_spec_3: clt$field_specification,
          element_type_spec_3: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
          field_spec_4: clt$field_specification,
          element_type_spec_4: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
          field_spec_5: clt$field_specification,
          element_type_spec_5: record
            header: clt$type_specification_header,
            qualifier: clt$string_type_qualifier,
          recend,
          field_spec_6: clt$field_specification,
          element_type_spec_6: record
            header: clt$type_specification_header,
            qualifier: clt$string_type_qualifier,
          recend,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
        default_value: string (1),
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$record_type_qualifier,
        field_spec_1: clt$field_specification,
        element_type_spec_1: 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,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 8] of clt$keyword_specification,
          recend,
          type_size_2: clt$type_specification_size,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$string_type_qualifier,
          recend,
        recend,
        field_spec_2: clt$field_specification,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        field_spec_3: clt$field_specification,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        field_spec_4: clt$field_specification,
        element_type_spec_4: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
        default_value: string (23),
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type5: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (4),
      recend,
      type6: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 27, 12, 51, 49, 370],
    clc$command, 12, 6, 1, 0, 0, 0, 6, 'PTM$ANABL_PUTIF'], [
    ['F                              ',clc$abbreviation_entry, 1],
    ['FIELD                          ',clc$nominal_entry, 1],
    ['FIELDS                         ',clc$alias_entry, 1],
    ['N                              ',clc$abbreviation_entry, 5],
    ['NUMBER                         ',clc$nominal_entry, 5],
    ['P                              ',clc$abbreviation_entry, 4],
    ['PUT                            ',clc$nominal_entry, 4],
    ['REPORT_INTERVAL                ',clc$nominal_entry, 2],
    ['RI                             ',clc$abbreviation_entry, 2],
    ['RL                             ',clc$abbreviation_entry, 3],
    ['ROW_LABEL                      ',clc$nominal_entry, 3],
    ['STATUS                         ',clc$nominal_entry, 6]],
    [
{ 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$extended_parameter_checking, 1195,
  clc$required_parameter, 0, 0],
{ PARAMETER 2
    [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, 20,
  clc$optional_default_parameter, 0, 1],
{ PARAMETER 3
    [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, 530,
  clc$optional_default_parameter, 0, 23],
{ PARAMETER 4
    [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$extended_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 5
    [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, 121,
  clc$optional_default_parameter, 0, 4],
{ 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$list_type], [1179, 1, ptc$field_vector_size, FALSE],
      [[1, 0, clc$record_type], [6],
      ['FIELD_NAME                     ', clc$required_field, 5], [[1, 0, clc$name_type], [1,
  osc$max_name_size]],
      ['DISPLAY_OPTION                 ', clc$optional_field, 895], [[1, 0, clc$keyword_type], [24], [
        ['AVERAGE                        ', clc$alias_entry, clc$normal_usage_entry, 4],
        ['AVG                            ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
        ['C                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['COUNT                          ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['COUNT_PER_SECOND               ', clc$nominal_entry, clc$normal_usage_entry, 8],
        ['CPS                            ', clc$abbreviation_entry, clc$normal_usage_entry, 8],
        ['ELAPSED_TIME_SINCE_PREDECESSOR ', clc$nominal_entry, clc$hidden_entry, 11],
        ['ETSP                           ', clc$abbreviation_entry, clc$hidden_entry, 11],
        ['FIRST_OCCURRENCE               ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['FO                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['I                              ', clc$abbreviation_entry, clc$hidden_entry, 10],
        ['INTERVAL                       ', clc$nominal_entry, clc$hidden_entry, 10],
        ['M                              ', clc$alias_entry, clc$normal_usage_entry, 4],
        ['MAX                            ', clc$abbreviation_entry, clc$normal_usage_entry, 7],
        ['MAXIMUM                        ', clc$nominal_entry, clc$normal_usage_entry, 7],
        ['MEAN                           ', clc$nominal_entry, clc$normal_usage_entry, 4],
        ['MIN                            ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
        ['MINIMUM                        ', clc$nominal_entry, clc$normal_usage_entry, 6],
        ['S                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['SD                             ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
        ['SPS                            ', clc$abbreviation_entry, clc$normal_usage_entry, 9],
        ['STANDARD_DEVIATION             ', clc$nominal_entry, clc$normal_usage_entry, 5],
        ['SUM                            ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['SUM_PER_SECOND                 ', clc$nominal_entry, clc$normal_usage_entry, 9]]
        ],
      ['START_COLUMN                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]],
      ['COLUMN_WIDTH                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]],
      ['HEADER_1                       ', clc$optional_field, 8], [[1, 0, clc$string_type], [1,
  ptc$max_page_width, FALSE]],
      ['HEADER_2                       ', clc$optional_field, 8], [[1, 0, clc$string_type], [1,
  ptc$max_page_width, FALSE]]
      ]
    ],
{ PARAMETER 2
    [[1, 0, clc$integer_type], [1, 10000, 10],
    '1'],
{ PARAMETER 3
    [[1, 0, clc$record_type], [4],
    ['LABEL                          ', clc$optional_field, 331], [[1, 0, clc$union_type], [[
      clc$keyword_type, clc$string_type],
      FALSE, 2],
      303, [[1, 0, clc$keyword_type], [8], [
        ['END_TIME                       ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['ET                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
        ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 4],
        ['ST                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['START_TIME                     ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['TIME_RANGE                     ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['TR                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3]]
        ],
      8, [[1, 0, clc$string_type], [0, clc$max_string_size, FALSE]]
      ],
    ['START_COLUMN                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]],
    ['COLUMN_WIDTH                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]],
    ['DATE_TIME_FORMAT               ', clc$optional_field, 8], [[1, 0, clc$string_type], [0,
  clc$max_string_size, FALSE]]
    ,
    '(time_range 1 31 ''HMS'')'],
{ PARAMETER 4
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 5
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['NEXT                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [1, clc$max_integer, 10]]
    ,
    'next'],
{ PARAMETER 6
    [[1, 0, clc$status_type]]];

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

    CONST
      p$field = 1,
      p$report_interval = 2,
      p$row_label = 3,
      p$put = 4,
      p$number = 5,
      p$status = 6;

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

    VAR
      initial_put_interval_field: [STATIC, READ] put_entry :=
            ['                               ' { name } , NIL { put_chain_link_p } ,
            [REP ptc$field_vector_size of [NIL, null, * , * , FALSE, NIL]]
            { field_vector } , ' ' { header_1 } , ' ' { header_2 } , 0 {max_used_column},
            put_interval_field { put } , end_time { row_label_type } , ' ' { row_label } , 1
            { date_time_start_column } , ptc$default_row_label_size { date_time_column_width } , NIL
            { date_time_format } , 1 { report_interval } ],
      report_entry_p: ^put_entry,
      temp_report_entry: ^put_entry;

?? NEWTITLE := 'check_put_interval_field', EJECT ??

    PROCEDURE check_put_interval_field
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$put =
          temp_report_entry^.name := '';
          IF pvt [p$put].specified THEN
            process_put_parameter (pvt [p$put].value^, ptv$report_entry_chain_head_p, temp_report_entry^.name,
                  status);
          IFEND;

        = p$field =
          report_undefined_fields (pvt [p$field].value, status);

        ELSE
        CASEND;
      ELSE

{ field (field_name, summary_calculation, position_description and headers).

        process_field_position (pvt [p$field], pvt [p$row_label], temp_report_entry, status);
      IFEND;

    PROCEND check_put_interval_field;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

    clp$get_reason_for_call (ptv$information_request, ptv$display_file, ptv$prompting_activted, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    IF NOT ptv$information_request THEN

      IF ptv$generate = log THEN
        clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
        osp$set_status_condition (pte$generate_log_mode, status);
        RETURN; {----->
      IFEND;

      ALLOCATE temp_report_entry;
      temp_report_entry^ := initial_put_interval_field;
      ALLOCATE temp_report_entry^.date_time_format_p: [3];
      temp_report_entry^.date_time_format_p^ := 'HMS';

    IFEND;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), ^check_put_interval_field, ^pvt, status);
    IF NOT status.normal THEN
      IF NOT ptv$information_request THEN
        FREE temp_report_entry^.date_time_format_p;
        FREE temp_report_entry;
      IFEND;
      RETURN; {----->
    IFEND;

    ptv$generate := report;

{ field

    process_field_parameter_putif (temp_report_entry);

{ number

    process_number_parameter (pvt [p$number].value^, temp_report_entry, ptv$report_entry_chain_head_p);

{ report_interval

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

  PROCEND put_interval_field_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'put_field_cmd', EJECT ??

{ This procedure processes the put_field_cmd command.

*copyc pth$anabl_put_field

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

{   PROCEDURE (ptm$anabl_putf) put_field, putf (
{   field, fields, f: (CHECK) list 1..ptc$field_vector_size of record
{       field_name: name
{       display_option: key
{         (all_occurrences, all_occurrence, ao, detail, d)
{         (first_occurrence, fo)
{         (last_occurrence, lo)
{         (count, c)
{         (sum, s)
{         (mean, m, average, avg)
{         (standard_deviation, sd)
{         (minimum, min)
{         (maximum, max)
{         (count_per_second, cps)
{         (sum_per_second, sps)
{       hidden_key
{         (interval, i)
{         (elapsed_time_since_predecessor, etsp)
{       keyend = $optional
{       start_column: integer 1..ptc$max_page_width = $optional
{       column_width: integer 1..ptc$max_page_width = $optional
{       header_1: string 1..ptc$max_page_width = $optional
{       header_2: string 1..ptc$max_page_width = $optional
{     recend = $required
{   put, p: (CHECK) name = $optional
{   number, n: any of
{       key
{         (next, n)
{       keyend
{       integer 1..clc$max_integer
{     anyend = next
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 8] of clt$pdt_parameter_name,
      parameters: array [1 .. 4] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$record_type_qualifier,
          field_spec_1: clt$field_specification,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
          field_spec_2: clt$field_specification,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 31] of clt$keyword_specification,
          recend,
          field_spec_3: clt$field_specification,
          element_type_spec_3: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
          field_spec_4: clt$field_specification,
          element_type_spec_4: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
          field_spec_5: clt$field_specification,
          element_type_spec_5: record
            header: clt$type_specification_header,
            qualifier: clt$string_type_qualifier,
          recend,
          field_spec_6: clt$field_specification,
          element_type_spec_6: record
            header: clt$type_specification_header,
            qualifier: clt$string_type_qualifier,
          recend,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type3: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (4),
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 27, 12, 52, 34, 92],
    clc$command, 8, 4, 1, 0, 0, 0, 4, 'PTM$ANABL_PUTF'], [
    ['F                              ',clc$abbreviation_entry, 1],
    ['FIELD                          ',clc$nominal_entry, 1],
    ['FIELDS                         ',clc$alias_entry, 1],
    ['N                              ',clc$abbreviation_entry, 3],
    ['NUMBER                         ',clc$nominal_entry, 3],
    ['P                              ',clc$abbreviation_entry, 2],
    ['PUT                            ',clc$nominal_entry, 2],
    ['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$extended_parameter_checking, 1454,
  clc$required_parameter, 0, 0],
{ PARAMETER 2
    [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$extended_parameter_checking, 5, clc$optional_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, 121,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 4
    [8, 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$list_type], [1438, 1, ptc$field_vector_size, FALSE],
      [[1, 0, clc$record_type], [6],
      ['FIELD_NAME                     ', clc$required_field, 5], [[1, 0, clc$name_type], [1,
  osc$max_name_size]],
      ['DISPLAY_OPTION                 ', clc$optional_field, 1154], [[1, 0, clc$keyword_type], [31], [
        ['ALL_OCCURRENCE                 ', clc$alias_entry, clc$normal_usage_entry, 1],
        ['ALL_OCCURRENCES                ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['AO                             ', clc$alias_entry, clc$normal_usage_entry, 1],
        ['AVERAGE                        ', clc$alias_entry, clc$normal_usage_entry, 6],
        ['AVG                            ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
        ['C                              ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
        ['COUNT                          ', clc$nominal_entry, clc$normal_usage_entry, 4],
        ['COUNT_PER_SECOND               ', clc$nominal_entry, clc$normal_usage_entry, 10],
        ['CPS                            ', clc$abbreviation_entry, clc$normal_usage_entry, 10],
        ['D                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['DETAIL                         ', clc$alias_entry, clc$normal_usage_entry, 1],
        ['ELAPSED_TIME_SINCE_PREDECESSOR ', clc$nominal_entry, clc$hidden_entry, 13],
        ['ETSP                           ', clc$abbreviation_entry, clc$hidden_entry, 13],
        ['FIRST_OCCURRENCE               ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['FO                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['I                              ', clc$abbreviation_entry, clc$hidden_entry, 12],
        ['INTERVAL                       ', clc$nominal_entry, clc$hidden_entry, 12],
        ['LAST_OCCURRENCE                ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['LO                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['M                              ', clc$alias_entry, clc$normal_usage_entry, 6],
        ['MAX                            ', clc$abbreviation_entry, clc$normal_usage_entry, 9],
        ['MAXIMUM                        ', clc$nominal_entry, clc$normal_usage_entry, 9],
        ['MEAN                           ', clc$nominal_entry, clc$normal_usage_entry, 6],
        ['MIN                            ', clc$abbreviation_entry, clc$normal_usage_entry, 8],
        ['MINIMUM                        ', clc$nominal_entry, clc$normal_usage_entry, 8],
        ['S                              ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
        ['SD                             ', clc$abbreviation_entry, clc$normal_usage_entry, 7],
        ['SPS                            ', clc$abbreviation_entry, clc$normal_usage_entry, 11],
        ['STANDARD_DEVIATION             ', clc$nominal_entry, clc$normal_usage_entry, 7],
        ['SUM                            ', clc$nominal_entry, clc$normal_usage_entry, 5],
        ['SUM_PER_SECOND                 ', clc$nominal_entry, clc$normal_usage_entry, 11]]
        ],
      ['START_COLUMN                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]],
      ['COLUMN_WIDTH                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]],
      ['HEADER_1                       ', clc$optional_field, 8], [[1, 0, clc$string_type], [1,
  ptc$max_page_width, FALSE]],
      ['HEADER_2                       ', clc$optional_field, 8], [[1, 0, clc$string_type], [1,
  ptc$max_page_width, FALSE]]
      ]
    ],
{ PARAMETER 2
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 3
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['NEXT                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [1, clc$max_integer, 10]]
    ,
    'next'],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

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

    CONST
      p$field = 1,
      p$put = 2,
      p$number = 3,
      p$status = 4;

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

    VAR
      all_occurrences: boolean,
      initial_put_field: [STATIC, READ] put_entry := ['                               ' { name } , NIL
            { put_chain_link_p } , [REP ptc$field_vector_size of [NIL, null, * , * , FALSE, NIL]]
            { field_vector } , ' ' { header_1 } , ' ' { header_2 } , 0 {max_used_column}, put_field { put } ,
            FALSE { all_occurrences } ],
      report_entry_p: ^put_entry,
      temp_report_entry: ^put_entry;

?? NEWTITLE := 'check_put_field', EJECT ??

    PROCEDURE check_put_field
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$put =
          temp_report_entry^.name := '';
          IF pvt [p$put].specified THEN
            process_put_parameter (pvt [p$put].value^, ptv$report_entry_chain_head_p, temp_report_entry^.name,
                  status);
          IFEND;

        = p$field =
          report_undefined_fields (pvt [p$field].value, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          check_display_option (pvt [p$field].value, all_occurrences, status);
          temp_report_entry^.all_occurrences := all_occurrences;

        ELSE
        CASEND;
      IFEND;

    PROCEND check_put_field;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

    clp$get_reason_for_call (ptv$information_request, ptv$display_file, ptv$prompting_activted, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    IF NOT ptv$information_request THEN

      IF ptv$generate = log THEN
        clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
        osp$set_status_condition (pte$generate_log_mode, status);
        RETURN; {----->
      IFEND;

      ALLOCATE temp_report_entry;
      temp_report_entry^ := initial_put_field;
    IFEND;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), ^check_put_field, ^pvt, status);
    IF NOT status.normal THEN
      IF NOT ptv$information_request THEN
        FREE temp_report_entry;
      IFEND;
      RETURN; {----->
    IFEND;

{ field (field_name, summary_calculation and position_description).

    process_field_position (pvt [p$field], pvt [p$field], temp_report_entry, status);

    ptv$generate := report;

{ field

    process_field_parameter_putif (temp_report_entry);

{ number

    process_number_parameter (pvt [p$number].value^, temp_report_entry, ptv$report_entry_chain_head_p);

  PROCEND put_field_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'put_string_cmd', EJECT ??

{ This procedure processes the put_string command.

*copyc pth$anabl_put_string

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

{   PROCEDURE (ptm$anabl_puts) put_string, puts (
{   string, strings, str: (CHECK) list of record
{       string: string 1..ptc$max_page_width
{       start_column: integer 1..ptc$max_page_width = $optional
{       column_width: integer 1..ptc$max_page_width = $optional
{     recend = $required
{   put, p: (CHECK) name = $optional
{   number, n: any of
{       key
{         (next, n)
{       keyend
{       integer 1..clc$max_integer
{     anyend = next
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 8] of clt$pdt_parameter_name,
      parameters: array [1 .. 4] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$record_type_qualifier,
          field_spec_1: clt$field_specification,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$string_type_qualifier,
          recend,
          field_spec_2: clt$field_specification,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
          field_spec_3: clt$field_specification,
          element_type_spec_3: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type3: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (4),
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 27, 12, 53, 18, 167],
    clc$command, 8, 4, 1, 0, 0, 0, 4, 'PTM$ANABL_PUTS'], [
    ['N                              ',clc$abbreviation_entry, 3],
    ['NUMBER                         ',clc$nominal_entry, 3],
    ['P                              ',clc$abbreviation_entry, 2],
    ['PUT                            ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 4],
    ['STR                            ',clc$abbreviation_entry, 1],
    ['STRING                         ',clc$nominal_entry, 1],
    ['STRINGS                        ',clc$alias_entry, 1]],
    [
{ PARAMETER 1
    [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$extended_parameter_checking, 179,
  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$extended_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 3
    [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, 121,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 4
    [5, 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$list_type], [163, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$record_type], [3],
      ['STRING                         ', clc$required_field, 8], [[1, 0, clc$string_type], [1,
  ptc$max_page_width, FALSE]],
      ['START_COLUMN                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]],
      ['COLUMN_WIDTH                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]]
      ]
    ],
{ PARAMETER 2
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 3
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['NEXT                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [1, clc$max_integer, 10]]
    ,
    'next'],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

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

    CONST
      p$string = 1,
      p$put = 2,
      p$number = 3,
      p$status = 4;

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

    VAR
      initial_put_string: [STATIC, READ] put_entry := ['                               ' { name } , NIL
            { put_chain_link_p } , [REP ptc$field_vector_size of [NIL, null, * , * , FALSE, NIL]]
            { field_vector } , ' ' { header_1 } , ' ' { header_2 } , 0 {max_used_column},
            put_string { put } ],
      report_entry_p: ^put_entry,
      temp_report_entry: ^put_entry;

?? NEWTITLE := 'check_put_string', EJECT ??

    PROCEDURE check_put_string
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$put =
          temp_report_entry^.name := '';
          IF pvt [p$put].specified THEN
            process_put_parameter (pvt [p$put].value^, ptv$report_entry_chain_head_p, temp_report_entry^.name,
                  status);
          IFEND;

        = p$string =
          process_string (pvt [p$string], temp_report_entry, status);

        ELSE
        CASEND;
      IFEND;

    PROCEND check_put_string;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

    clp$get_reason_for_call (ptv$information_request, ptv$display_file, ptv$prompting_activted, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    IF NOT ptv$information_request THEN

      IF ptv$generate = log THEN
        clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
        osp$set_status_condition (pte$generate_log_mode, status);
        RETURN; {----->
      IFEND;

      ALLOCATE temp_report_entry;
      temp_report_entry^ := initial_put_string;
    IFEND;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), ^check_put_string, ^pvt, status);
    IF NOT status.normal THEN
      IF NOT ptv$information_request THEN
        FREE temp_report_entry;
      IFEND;
      RETURN; {----->
    IFEND;

    ptv$generate := report;

{ number

    process_number_parameter (pvt [p$number].value^, temp_report_entry, ptv$report_entry_chain_head_p);

  PROCEND put_string_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'push_page_header', EJECT ??

{ This procedure processes the push_page_header command.

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

{     PROCEDURE (ptm$anabl_pusph) push_page_header, pusph (
{     page_header, ph: (CHECK) any of
{         key
{           default
{         keyend
{         list of record
{           string: string
{           start_column: integer 1..ptc$max_page_width = $optional
{           column_width: integer 1..ptc$max_page_width = $optional
{         recend
{       anyend = default
{     put, p: (CHECK) name = $optional
{     number, n: any of
{         key
{           (next, n)
{         keyend
{         integer 1..clc$max_integer
{       anyend = next
{     status)

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

  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,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        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,
            qualifier: clt$record_type_qualifier,
            field_spec_1: clt$field_specification,
            element_type_spec_1: record
              header: clt$type_specification_header,
              qualifier: clt$string_type_qualifier,
            recend,
            field_spec_2: clt$field_specification,
            element_type_spec_2: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
            field_spec_3: clt$field_specification,
            element_type_spec_3: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
          recend,
        recend,
        default_value: string (7),
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type3: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (4),
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 27, 12, 54, 25, 13],
    clc$command, 7, 4, 0, 0, 0, 0, 4, 'PTM$ANABL_PUSPH'], [
    ['N                              ',clc$abbreviation_entry, 3],
    ['NUMBER                         ',clc$nominal_entry, 3],
    ['P                              ',clc$abbreviation_entry, 2],
    ['PAGE_HEADER                    ',clc$nominal_entry, 1],
    ['PH                             ',clc$abbreviation_entry, 1],
    ['PUT                            ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 4]],
    [
{ 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$extended_parameter_checking, 243,
  clc$optional_default_parameter, 0, 7],
{ PARAMETER 2
    [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$extended_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 3
    [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, 121,
  clc$optional_default_parameter, 0, 4],
{ 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$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['DEFAULT                        ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    179, [[1, 0, clc$list_type], [163, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$record_type], [3],
        ['STRING                         ', clc$required_field, 8], [[1, 0, clc$string_type], [0,
  clc$max_string_size, FALSE]],
        ['START_COLUMN                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]],
        ['COLUMN_WIDTH                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]]
        ]
      ]
    ,
    'default'],
{ PARAMETER 2
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 3
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['NEXT                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [1, clc$max_integer, 10]]
    ,
    'next'],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

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

    CONST
      p$page_header = 1,
      p$put = 2,
      p$number = 3,
      p$status = 4;

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

    VAR
      initial_page_header: [STATIC, READ] put_entry := ['                               ' { name } , NIL
            { put_chain_link_p } , [REP ptc$field_vector_size of [NIL, null, * , * , FALSE, NIL]]
            { field_vector } , ' ' { header_1 } , ' ' { header_2 } , 0 {max_used_column},
            push_page_header { put }, TRUE {default_header}],
      report_entry_p: ^put_entry,
      temp_report_entry: ^put_entry;

?? NEWTITLE := 'check_push_page_header', EJECT ??

    PROCEDURE check_push_page_header
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$put =
          temp_report_entry^.name := '';
          IF pvt [p$put].specified THEN
            process_put_parameter (pvt [p$put].value^, ptv$report_entry_chain_head_p, temp_report_entry^.name,
                  status);
          IFEND;

        = p$page_header =
          IF (pvt [p$page_header].value^.kind = clc$keyword) THEN

{ The only keyword is DEFAULT.
            temp_report_entry^.default_header := TRUE;
          ELSE {header string specified
            temp_report_entry^.default_header := FALSE;
            process_string (pvt [p$page_header], temp_report_entry, status);
          IFEND;
        ELSE
        CASEND;
      IFEND;

    PROCEND check_push_page_header;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

    clp$get_reason_for_call (ptv$information_request, ptv$display_file, ptv$prompting_activted, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    IF NOT ptv$information_request THEN

      IF ptv$generate = log THEN
        clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
        osp$set_status_condition (pte$generate_log_mode, status);
        RETURN; {----->
      IFEND;

      ALLOCATE temp_report_entry;
      temp_report_entry^ := initial_page_header;
    IFEND;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), ^check_push_page_header, ^pvt, status);
    IF NOT status.normal THEN
      IF NOT ptv$information_request THEN
        FREE temp_report_entry;
      IFEND;
      RETURN; {----->
    IFEND;

    ptv$generate := report;
    ptv$headers_specified := TRUE;

{ number

    process_number_parameter (pvt [p$number].value^, temp_report_entry, ptv$report_entry_chain_head_p);

  PROCEND push_page_header_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'pop_page_header_cmd', EJECT ??

{ This procedure processes the pop_page_header command.

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

{      PROCEDURE (ptm$anabl_popph) pop_page_header, popph (
{      pop_count, pc: any of
{          key
{            all
{          keyend
{          integer 1..clc$max_integer
{        anyend = 1
{      put, p: (CHECK) name = $optional
{      number, n: any of
{          key
{            (next, n)
{          keyend
{          integer 1..clc$max_integer
{        anyend = next
{      status)

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

  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,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (1),
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type3: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (4),
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 27, 12, 55, 21, 866],
    clc$command, 7, 4, 0, 0, 0, 0, 4, 'PTM$ANABL_POPPH'], [
    ['N                              ',clc$abbreviation_entry, 3],
    ['NUMBER                         ',clc$nominal_entry, 3],
    ['P                              ',clc$abbreviation_entry, 2],
    ['PC                             ',clc$abbreviation_entry, 1],
    ['POP_COUNT                      ',clc$nominal_entry, 1],
    ['PUT                            ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 4]],
    [
{ PARAMETER 1
    [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, 84,
  clc$optional_default_parameter, 0, 1],
{ PARAMETER 2
    [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$extended_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 3
    [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, 121,
  clc$optional_default_parameter, 0, 4],
{ 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$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [1, clc$max_integer, 10]]
    ,
    '1'],
{ PARAMETER 2
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 3
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['NEXT                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [1, clc$max_integer, 10]]
    ,
    'next'],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

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

    CONST
      p$pop_count = 1,
      p$put = 2,
      p$number = 3,
      p$status = 4;

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

    VAR
      initial_pop_header: [STATIC, READ] put_entry := ['                               ' { name } , NIL
            { put_chain_link_p } , [REP ptc$field_vector_size of [NIL, null, * , * , FALSE, NIL]]
            { field_vector } , ' ' { header_1 } , ' ' { header_2 } , 0 {max_used_column},
            pop_page_header { put }, FALSE {pop_all_headers}, 1 {pop_count}],
      report_entry_p: ^put_entry,
      temp_report_entry: ^put_entry;

?? NEWTITLE := 'check_pop_page_header', EJECT ??

    PROCEDURE check_pop_page_header
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$put =
          temp_report_entry^.name := '';
          IF pvt [p$put].specified THEN
            process_put_parameter (pvt [p$put].value^, ptv$report_entry_chain_head_p, temp_report_entry^.name,
                  status);
          IFEND;

        ELSE
        CASEND;
      IFEND;

    PROCEND check_pop_page_header;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

    clp$get_reason_for_call (ptv$information_request, ptv$display_file, ptv$prompting_activted, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    IF NOT ptv$information_request THEN

      IF ptv$generate = log THEN
        clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
        osp$set_status_condition (pte$generate_log_mode, status);
        RETURN; {----->
      IFEND;

      ALLOCATE temp_report_entry;
      temp_report_entry^ := initial_pop_header;
    IFEND;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), ^check_pop_page_header, ^pvt, status);
    IF NOT status.normal THEN
      IF NOT ptv$information_request THEN
        FREE temp_report_entry;
      IFEND;
      RETURN; {----->
    IFEND;

    ptv$generate := report;
    ptv$headers_specified := TRUE;

{ pop count
    IF pvt[p$pop_count].value^.kind = clc$keyword THEN

{ Only keyword is pop_count = ALL
      temp_report_entry^.pop_all_headers := TRUE;

    ELSE { Count specified

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

    IFEND;

{ number

    process_number_parameter (pvt [p$number].value^, temp_report_entry, ptv$report_entry_chain_head_p);


  PROCEND pop_page_header_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'put_new_page_cmd', EJECT ??

{ This procedure processes the put_new_page command.

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

{     PROCEDURE (ptm$anabl_putnp) put_new_page, putnp (
{     use_page_headers, use_page_header, uph: boolean = TRUE
{     put, p: (CHECK) name = $optional
{     number, n: any of
{         key
{           (next, n)
{         keyend
{         integer 1..clc$max_integer
{       anyend = next
{     status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 8] of clt$pdt_parameter_name,
      parameters: array [1 .. 4] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        default_value: string (4),
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type3: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (4),
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 27, 12, 56, 17, 194],
    clc$command, 8, 4, 0, 0, 0, 0, 4, 'PTM$ANABL_PUTNP'], [
    ['N                              ',clc$abbreviation_entry, 3],
    ['NUMBER                         ',clc$nominal_entry, 3],
    ['P                              ',clc$abbreviation_entry, 2],
    ['PUT                            ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 4],
    ['UPH                            ',clc$abbreviation_entry, 1],
    ['USE_PAGE_HEADER                ',clc$alias_entry, 1],
    ['USE_PAGE_HEADERS               ',clc$nominal_entry, 1]],
    [
{ 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, 3,
  clc$optional_default_parameter, 0, 4],
{ 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$extended_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 3
    [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, 121,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 4
    [5, 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$boolean_type],
    'TRUE'],
{ PARAMETER 2
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 3
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['NEXT                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [1, clc$max_integer, 10]]
    ,
    'next'],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

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

    CONST
      p$use_page_headers = 1,
      p$put = 2,
      p$number = 3,
      p$status = 4;

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

    VAR
      initial_put_new_page: [STATIC, READ] put_entry := ['                               ' { name } , NIL
            { put_chain_link_p } , [REP ptc$field_vector_size of [NIL, null, * , * , FALSE, NIL]]
            { field_vector } , ' ' { header_1 } , ' ' { header_2 } , 0 {max_used_column},
            put_new_page { put }, TRUE {use_page_headers}],
      report_entry_p: ^put_entry,
      temp_report_entry: ^put_entry;

?? NEWTITLE := 'check_put_new_page', EJECT ??

    PROCEDURE check_put_new_page
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$put =
          temp_report_entry^.name := '';
          IF pvt [p$put].specified THEN
            process_put_parameter (pvt [p$put].value^, ptv$report_entry_chain_head_p, temp_report_entry^.name,
                  status);
          IFEND;

        ELSE
        CASEND;
      IFEND;

    PROCEND check_put_new_page;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

    clp$get_reason_for_call (ptv$information_request, ptv$display_file, ptv$prompting_activted, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    IF NOT ptv$information_request THEN

      IF ptv$generate = log THEN
        clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
        osp$set_status_condition (pte$generate_log_mode, status);
        RETURN; {----->
      IFEND;

      ALLOCATE temp_report_entry;
      temp_report_entry^ := initial_put_new_page;
    IFEND;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), ^check_put_new_page, ^pvt, status);
    IF NOT status.normal THEN
      IF NOT ptv$information_request THEN
        FREE temp_report_entry;
      IFEND;
      RETURN; {----->
    IFEND;

    ptv$generate := report;
    ptv$headers_specified := TRUE;

{ use_report_headers

      temp_report_entry^.use_page_headers := pvt [p$use_page_headers].value^.boolean_value.value;

{ number

    process_number_parameter (pvt [p$number].value^, temp_report_entry, ptv$report_entry_chain_head_p);

  PROCEND put_new_page_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'put_record_cmd', EJECT ??

{ This procedure processes the put_record command.

*copyc pth$anabl_put_record

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

{   PROCEDURE (ptm$anabl_putr) put_record, putr (
{   selection, selections, s: (CHECK) list of name = $required
{   counter, counters, c: (CHECK) any of
{       key
{         none
{       keyend
{       list 1..sfc$max_number_of_counters of record
{         counter_number: any of
{           key
{             all
{           keyend
{           range of integer 1..sfc$max_number_of_counters
{         anyend
{         base: key
{           (base_2, b2)
{           (base_8, b8)
{           (base_10, b10)
{           (base_16, b16)
{           (base_16_group, b16g)
{         keyend
{       recend
{     anyend = ((all b10))
{   descriptive_data, dd: any of
{       string 0..sfc$max_descriptive_data_size
{       record
{         position: integer 1..sfc$max_descriptive_data_size = $optional
{         length: any of
{           key
{             all
{           keyend
{           integer 1..sfc$max_descriptive_data_size
{         anyend = $optional
{         field_number: any of
{           key
{             all
{           keyend
{           integer 1..sfc$max_descriptive_data_size
{         anyend = $optional
{         field_delimiter: string 1 = $optional
{       recend
{     anyend = (1, all, all, ',')
{   put, p: (CHECK) name = $optional
{   number, n: any of
{       key
{         (next, n)
{       keyend
{       integer 1..clc$max_integer
{     anyend = next
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 13] of clt$pdt_parameter_name,
      parameters: array [1 .. 6] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type2: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        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,
            qualifier: clt$record_type_qualifier,
            field_spec_1: clt$field_specification,
            element_type_spec_1: 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,
                qualifier: clt$keyword_type_qualifier,
                keyword_specs: array [1 .. 1] of clt$keyword_specification,
              recend,
              type_size_2: clt$type_specification_size,
              element_type_spec_2: record
                header: clt$type_specification_header,
                qualifier: clt$range_type_qualifier,
                element_type_spec: record
                  header: clt$type_specification_header,
                  qualifier: clt$integer_type_qualifier,
                recend,
              recend,
            recend,
            field_spec_2: clt$field_specification,
            element_type_spec_2: record
              header: clt$type_specification_header,
              qualifier: clt$keyword_type_qualifier,
              keyword_specs: array [1 .. 10] of clt$keyword_specification,
            recend,
          recend,
        recend,
        default_value: string (11),
      recend,
      type3: 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,
          qualifier: clt$string_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$record_type_qualifier,
          field_spec_1: clt$field_specification,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
          field_spec_2: clt$field_specification,
          element_type_spec_2: 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,
              qualifier: clt$keyword_type_qualifier,
              keyword_specs: array [1 .. 1] of clt$keyword_specification,
            recend,
            type_size_2: clt$type_specification_size,
            element_type_spec_2: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
          recend,
          field_spec_3: clt$field_specification,
          element_type_spec_3: 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,
              qualifier: clt$keyword_type_qualifier,
              keyword_specs: array [1 .. 1] of clt$keyword_specification,
            recend,
            type_size_2: clt$type_specification_size,
            element_type_spec_2: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
          recend,
          field_spec_4: clt$field_specification,
          element_type_spec_4: record
            header: clt$type_specification_header,
            qualifier: clt$string_type_qualifier,
          recend,
        recend,
        default_value: string (18),
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type5: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (4),
      recend,
      type6: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 28, 11, 16, 31, 569],
    clc$command, 13, 6, 1, 0, 0, 0, 6, 'PTM$ANABL_PUTR'], [
    ['C                              ',clc$abbreviation_entry, 2],
    ['COUNTER                        ',clc$nominal_entry, 2],
    ['COUNTERS                       ',clc$alias_entry, 2],
    ['DD                             ',clc$abbreviation_entry, 3],
    ['DESCRIPTIVE_DATA               ',clc$nominal_entry, 3],
    ['N                              ',clc$abbreviation_entry, 5],
    ['NUMBER                         ',clc$nominal_entry, 5],
    ['P                              ',clc$abbreviation_entry, 4],
    ['PUT                            ',clc$nominal_entry, 4],
    ['S                              ',clc$abbreviation_entry, 1],
    ['SELECTION                      ',clc$nominal_entry, 1],
    ['SELECTIONS                     ',clc$alias_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 6]],
    [
{ PARAMETER 1
    [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$extended_parameter_checking, 21, clc$required_parameter,
  0, 0],
{ PARAMETER 2
    [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$extended_parameter_checking, 627,
  clc$optional_default_parameter, 0, 11],
{ 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, 375,
  clc$optional_default_parameter, 0, 18],
{ PARAMETER 4
    [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$extended_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 5
    [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, 121,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 6
    [13, 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$list_type], [5, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 2
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    563, [[1, 0, clc$list_type], [547, 1, sfc$max_number_of_counters, FALSE],
        [[1, 0, clc$record_type], [2],
        ['COUNTER_NUMBER                 ', clc$required_field, 91], [[1, 0, clc$union_type], [[
          clc$keyword_type, clc$range_type],
          FALSE, 2],
          44, [[1, 0, clc$keyword_type], [1], [
            ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
            ],
          27, [[1, 0, clc$range_type], [20],
              [[1, 0, clc$integer_type], [1, sfc$max_number_of_counters, 10]]
            ]
          ],
        ['BASE                           ', clc$required_field, 377], [[1, 0, clc$keyword_type], [10], [
          ['B10                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
          ['B16                            ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
          ['B16G                           ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
          ['B2                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
          ['B8                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
          ['BASE_10                        ', clc$nominal_entry, clc$normal_usage_entry, 3],
          ['BASE_16                        ', clc$nominal_entry, clc$normal_usage_entry, 4],
          ['BASE_16_GROUP                  ', clc$nominal_entry, clc$normal_usage_entry, 5],
          ['BASE_2                         ', clc$nominal_entry, clc$normal_usage_entry, 1],
          ['BASE_8                         ', clc$nominal_entry, clc$normal_usage_entry, 2]]
          ]
        ]
      ]
    ,
    '((all b10))'],
{ PARAMETER 3
    [[1, 0, clc$union_type], [[clc$record_type, clc$string_type],
    FALSE, 2],
    8, [[1, 0, clc$string_type], [0, sfc$max_descriptive_data_size, FALSE]],
    347, [[1, 0, clc$record_type], [4],
      ['POSITION                       ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  sfc$max_descriptive_data_size, 10]],
      ['LENGTH                         ', clc$optional_field, 84], [[1, 0, clc$union_type], [[
        clc$integer_type, clc$keyword_type],
        FALSE, 2],
        44, [[1, 0, clc$keyword_type], [1], [
          ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
          ],
        20, [[1, 0, clc$integer_type], [1, sfc$max_descriptive_data_size, 10]]
        ],
      ['FIELD_NUMBER                   ', clc$optional_field, 84], [[1, 0, clc$union_type], [[
        clc$integer_type, clc$keyword_type],
        FALSE, 2],
        44, [[1, 0, clc$keyword_type], [1], [
          ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
          ],
        20, [[1, 0, clc$integer_type], [1, sfc$max_descriptive_data_size, 10]]
        ],
      ['FIELD_DELIMITER                ', clc$optional_field, 8], [[1, 0, clc$string_type], [1, 1, FALSE]]
      ]
    ,
    '(1, all, all, '','')'],
{ PARAMETER 4
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 5
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['NEXT                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [1, clc$max_integer, 10]]
    ,
    'next'],
{ PARAMETER 6
    [[1, 0, clc$status_type]]];

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

    CONST
      p$selection = 1,
      p$counter = 2,
      p$descriptive_data = 3,
      p$put = 4,
      p$number = 5,
      p$status = 6;

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

    VAR
      initial_log_entry: [STATIC, READ] put_entry := ['                               ' { name } , NIL
            { put_chain_link_p } , [REP ptc$field_vector_size of [NIL, null, * , * , FALSE, NIL]]
            { field_vector } , ' ' { header_1 } , ' ' { header_2 } , 0 {max_used_column},
            put_record { put } , NIL { records } , FALSE { delete_counters } ,
            [REP sfc$max_number_of_counters of base_10] { counter_base } , NIL
            { descriptive_text_p } , 1 { subfield_position } , sfc$max_descriptive_data_size
            { subfield_length } , 0 {  subfield_number } , ',' { subfield_delimiter } ],
      log_entry_p: ^put_entry,
      value_p: ^clt$data_value,
      temp_log_entry: ^put_entry;

?? NEWTITLE := 'check_put_record', EJECT ??

    PROCEDURE check_put_record
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$put =
          temp_log_entry^.name := '';
          IF pvt [p$put].specified THEN
            process_put_parameter (pvt [p$put].value^, ptv$log_entry_chain_head_p, temp_log_entry^.name,
                  status);
          IFEND;

        = p$selection =
          report_duplicate_name (pvt [p$selection].value, 'SELECTION', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          report_undefined_selections (pvt [p$selection].value, NIL, status);

        = p$counter =
          check_counter_parameter (pvt [p$counter], temp_log_entry, status);

        ELSE
        CASEND;
      IFEND;

    PROCEND check_put_record;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

    clp$get_reason_for_call (ptv$information_request, ptv$display_file, ptv$prompting_activted, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    IF NOT ptv$information_request THEN

      IF ptv$generate = report THEN
        clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
        osp$set_status_condition (pte$generate_report_mode, status);
        RETURN; {----->
      IFEND;

      ALLOCATE temp_log_entry;
      temp_log_entry^ := initial_log_entry;
    IFEND;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), ^check_put_record, ^pvt, status);
    IF NOT status.normal THEN
      IF NOT ptv$information_request THEN
        FREE temp_log_entry;
      IFEND;
      RETURN; {----->
    IFEND;

    ptv$generate := log;

{ records

    process_selection_parameter (pvt [p$selection].value, temp_log_entry);

{ number

    process_number_parameter (pvt [p$number].value^, temp_log_entry, ptv$log_entry_chain_head_p);

{ descriptive_data

    IF pvt [p$descriptive_data].value^.kind = clc$record THEN

      IF pvt [p$descriptive_data].value^.field_values^ [1].value <> NIL THEN
        temp_log_entry^.subfield_position := pvt [p$descriptive_data].value^.field_values^ [1].
              value^.integer_value.value;
      IFEND;

      IF pvt [p$descriptive_data].value^.field_values^ [2].value <> NIL THEN
        IF pvt [p$descriptive_data].value^.field_values^ [2].value^.kind <> clc$keyword THEN
          temp_log_entry^.subfield_length := pvt [p$descriptive_data].value^.field_values^ [2].
                value^.integer_value.value;
        IFEND;
      IFEND;

      IF pvt [p$descriptive_data].value^.field_values^ [3].value <> NIL THEN
        IF pvt [p$descriptive_data].value^.field_values^ [3].value^.kind <> clc$keyword THEN
          temp_log_entry^.subfield_number := pvt [p$descriptive_data].value^.field_values^ [3].
                value^.integer_value.value;
        IFEND;
      IFEND;

      IF pvt [p$descriptive_data].value^.field_values^ [4].value <> NIL THEN
        temp_log_entry^.subfield_delimiter := pvt [p$descriptive_data].value^.field_values^ [4].
              value^.string_value^ (1);
      IFEND;

    ELSE

      ALLOCATE temp_log_entry^.descriptive_text_p: [#SIZE (pvt [p$descriptive_data].value^.string_value^)];
      temp_log_entry^.descriptive_text_p^ := pvt [p$descriptive_data].value^.string_value^;

    IFEND;

  PROCEND put_record_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'change_put_cmd', EJECT ??

{ This procedure processes the change_put command.

*copyc pth$anabl_change_put

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

{    PROCEDURE (ptm$anabl_chap) change_put, chap (
{    put, p: name = $optional
{    number, n: any of
{        key
{          (last, l)
{        keyend
{        integer 1..clc$max_integer
{      anyend = $optional
{    new_put, np: (CHECK) name = $optional
{    new_number, nn: any of
{        key
{          (last, l)
{        keyend
{        integer 1..clc$max_integer
{      anyend = $optional
{    field, fields, f: any of
{        list of record
{          field_name: name
{          row_label: string = $optional
{        recend
{        list 1..ptc$field_vector_size of record
{          field_name: name
{          display_option: key
{            (all_occurrences, all_occurrence, ao, detail, d)
{            (first_occurrence, fo)
{            (last_occurrence, lo)
{            (count, c)
{            (sum, s)
{            (mean, m, average, avg)
{            (standard_deviation, sd)
{            (minimum, min)
{            (maximum, max)
{            (count_per_second, cps)
{            (sum_per_second, sps)
{          hidden_key
{            (interval, i)
{            (elapsed_time_since_predecessor, etsp)
{          keyend = $optional
{          start_column: integer 1..ptc$max_page_width = $optional
{          column_width: integer 1..ptc$max_page_width = $optional
{          header_1: string 1..ptc$max_page_width = $optional
{          header_2: string 1..ptc$max_page_width = $optional
{        recend
{      anyend = $optional
{    display_option, do, summary_calculation, sc: list of record
{        calculation: key
{          (count, c)
{          (sum, s)
{          (mean, m, average, avg)
{          (standard_deviation, sd)
{          (minimum, min)
{          (maximum, max)
{          (count_per_second, cps)
{          (sum_per_second, sps)
{        hidden_key
{          (interval, i)
{          (elapsed_time_since_predecessor, etsp)
{        keyend
{        start_column: integer 1..ptc$max_page_width = $optional
{        column_width: integer 1..ptc$max_page_width = $optional
{      recend = $optional
{    display_headers, dh: boolean = false
{    row_label, rl: record
{        label: any of
{          key
{            (start_time, st)
{            (end_time, et)
{            (time_range, tr)
{            (none, n)
{          keyend
{          string
{        anyend = $optional
{        start_column: integer 1..ptc$max_page_width = $optional
{        column_width: integer 1..ptc$max_page_width = $optional
{        date_time_format: string = $optional
{      recend = (time_range 1 21 'HMS')
{    row_label_format, rlf: record
{          start_column: integer 1..ptc$max_page_width
{          column_width: integer 1..ptc$max_page_width
{        recend = $optional
{    report_interval, ri: integer 1..10000 = $optional
{    string, strings, str: list 1..11 of string = $optional
{    page_header, ph: (CHECK) any of
{        key
{          default
{        keyend
{        list of record
{          string: string
{          start_column: integer 1..ptc$max_page_width = $optional
{          column_width: integer 1..ptc$max_page_width = $optional
{        recend
{      anyend = $optional
{    pop_count, pc: any of
{        key
{          all
{        keyend
{        integer 1..clc$max_integer
{      anyend = $optional
{    use_page_headers, use_page_header, uph: boolean = $optional
{    selection, s: list of name = $optional
{    counter, counters, c: any of
{        key
{          none
{        keyend
{        list 1..sfc$max_number_of_counters of record
{          counter_number: any of
{            key
{              all
{            keyend
{            range of integer 1..sfc$max_number_of_counters
{          anyend
{          base: key
{            (base_2, b2)
{            (base_8, b8)
{            (base_10, b10)
{            (base_16, b16)
{            (base_16_group, b16g)
{          keyend
{        recend
{      anyend = $optional
{    descriptive_data, dd: any of
{        string 0..sfc$max_descriptive_data_size
{        record
{          position: integer 1..sfc$max_descriptive_data_size = $optional
{          length: any of
{            key
{              all
{            keyend
{            integer 1..sfc$max_descriptive_data_size
{          anyend = $optional
{          field_number: any of
{            key
{              all
{            keyend
{            integer 1..sfc$max_descriptive_data_size
{          anyend = $optional
{          field_delimiter: string 1 = $optional
{        recend
{      anyend = $optional
{    status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 41] of clt$pdt_parameter_name,
      parameters: array [1 .. 18] 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$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type4: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      type5: 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,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$record_type_qualifier,
            field_spec_1: clt$field_specification,
            element_type_spec_1: record
              header: clt$type_specification_header,
              qualifier: clt$name_type_qualifier,
            recend,
            field_spec_2: clt$field_specification,
            element_type_spec_2: record
              header: clt$type_specification_header,
              qualifier: clt$string_type_qualifier,
            recend,
          recend,
        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,
            qualifier: clt$record_type_qualifier,
            field_spec_1: clt$field_specification,
            element_type_spec_1: record
              header: clt$type_specification_header,
              qualifier: clt$name_type_qualifier,
            recend,
            field_spec_2: clt$field_specification,
            element_type_spec_2: record
              header: clt$type_specification_header,
              qualifier: clt$keyword_type_qualifier,
              keyword_specs: array [1 .. 31] of clt$keyword_specification,
            recend,
            field_spec_3: clt$field_specification,
            element_type_spec_3: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
            field_spec_4: clt$field_specification,
            element_type_spec_4: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
            field_spec_5: clt$field_specification,
            element_type_spec_5: record
              header: clt$type_specification_header,
              qualifier: clt$string_type_qualifier,
            recend,
            field_spec_6: clt$field_specification,
            element_type_spec_6: record
              header: clt$type_specification_header,
              qualifier: clt$string_type_qualifier,
            recend,
          recend,
        recend,
      recend,
      type6: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$record_type_qualifier,
          field_spec_1: clt$field_specification,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 22] of clt$keyword_specification,
          recend,
          field_spec_2: clt$field_specification,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
          field_spec_3: clt$field_specification,
          element_type_spec_3: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
        recend,
      recend,
      type7: record
        header: clt$type_specification_header,
        default_value: string (5),
      recend,
      type8: record
        header: clt$type_specification_header,
        qualifier: clt$record_type_qualifier,
        field_spec_1: clt$field_specification,
        element_type_spec_1: 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,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 8] of clt$keyword_specification,
          recend,
          type_size_2: clt$type_specification_size,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$string_type_qualifier,
          recend,
        recend,
        field_spec_2: clt$field_specification,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        field_spec_3: clt$field_specification,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        field_spec_4: clt$field_specification,
        element_type_spec_4: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
        default_value: string (23),
      recend,
      type9: record
        header: clt$type_specification_header,
        qualifier: clt$record_type_qualifier,
        field_spec_1: clt$field_specification,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        field_spec_2: clt$field_specification,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      type10: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type11: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
      recend,
      type12: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        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,
            qualifier: clt$record_type_qualifier,
            field_spec_1: clt$field_specification,
            element_type_spec_1: record
              header: clt$type_specification_header,
              qualifier: clt$string_type_qualifier,
            recend,
            field_spec_2: clt$field_specification,
            element_type_spec_2: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
            field_spec_3: clt$field_specification,
            element_type_spec_3: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
          recend,
        recend,
      recend,
      type13: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      type14: record
        header: clt$type_specification_header,
      recend,
      type15: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type16: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        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,
            qualifier: clt$record_type_qualifier,
            field_spec_1: clt$field_specification,
            element_type_spec_1: 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,
                qualifier: clt$keyword_type_qualifier,
                keyword_specs: array [1 .. 1] of clt$keyword_specification,
              recend,
              type_size_2: clt$type_specification_size,
              element_type_spec_2: record
                header: clt$type_specification_header,
                qualifier: clt$range_type_qualifier,
                element_type_spec: record
                  header: clt$type_specification_header,
                  qualifier: clt$integer_type_qualifier,
                recend,
              recend,
            recend,
            field_spec_2: clt$field_specification,
            element_type_spec_2: record
              header: clt$type_specification_header,
              qualifier: clt$keyword_type_qualifier,
              keyword_specs: array [1 .. 10] of clt$keyword_specification,
            recend,
          recend,
        recend,
      recend,
      type17: 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,
          qualifier: clt$string_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$record_type_qualifier,
          field_spec_1: clt$field_specification,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
          field_spec_2: clt$field_specification,
          element_type_spec_2: 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,
              qualifier: clt$keyword_type_qualifier,
              keyword_specs: array [1 .. 1] of clt$keyword_specification,
            recend,
            type_size_2: clt$type_specification_size,
            element_type_spec_2: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
          recend,
          field_spec_3: clt$field_specification,
          element_type_spec_3: 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,
              qualifier: clt$keyword_type_qualifier,
              keyword_specs: array [1 .. 1] of clt$keyword_specification,
            recend,
            type_size_2: clt$type_specification_size,
            element_type_spec_2: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
          recend,
          field_spec_4: clt$field_specification,
          element_type_spec_4: record
            header: clt$type_specification_header,
            qualifier: clt$string_type_qualifier,
          recend,
        recend,
      recend,
      type18: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 28, 11, 19, 3, 366],
    clc$command, 41, 18, 0, 0, 0, 0, 18, 'PTM$ANABL_CHAP'], [
    ['C                              ',clc$abbreviation_entry, 16],
    ['COUNTER                        ',clc$nominal_entry, 16],
    ['COUNTERS                       ',clc$alias_entry, 16],
    ['DD                             ',clc$abbreviation_entry, 17],
    ['DESCRIPTIVE_DATA               ',clc$nominal_entry, 17],
    ['DH                             ',clc$abbreviation_entry, 7],
    ['DISPLAY_HEADERS                ',clc$nominal_entry, 7],
    ['DISPLAY_OPTION                 ',clc$nominal_entry, 6],
    ['DO                             ',clc$alias_entry, 6],
    ['F                              ',clc$abbreviation_entry, 5],
    ['FIELD                          ',clc$nominal_entry, 5],
    ['FIELDS                         ',clc$alias_entry, 5],
    ['N                              ',clc$abbreviation_entry, 2],
    ['NEW_NUMBER                     ',clc$nominal_entry, 4],
    ['NEW_PUT                        ',clc$nominal_entry, 3],
    ['NN                             ',clc$abbreviation_entry, 4],
    ['NP                             ',clc$abbreviation_entry, 3],
    ['NUMBER                         ',clc$nominal_entry, 2],
    ['P                              ',clc$abbreviation_entry, 1],
    ['PAGE_HEADER                    ',clc$nominal_entry, 12],
    ['PC                             ',clc$abbreviation_entry, 13],
    ['PH                             ',clc$abbreviation_entry, 12],
    ['POP_COUNT                      ',clc$nominal_entry, 13],
    ['PUT                            ',clc$nominal_entry, 1],
    ['REPORT_INTERVAL                ',clc$nominal_entry, 10],
    ['RI                             ',clc$abbreviation_entry, 10],
    ['RL                             ',clc$abbreviation_entry, 8],
    ['RLF                            ',clc$abbreviation_entry, 9],
    ['ROW_LABEL                      ',clc$nominal_entry, 8],
    ['ROW_LABEL_FORMAT               ',clc$nominal_entry, 9],
    ['S                              ',clc$abbreviation_entry, 15],
    ['SC                             ',clc$abbreviation_entry, 6],
    ['SELECTION                      ',clc$nominal_entry, 15],
    ['STATUS                         ',clc$nominal_entry, 18],
    ['STR                            ',clc$abbreviation_entry, 11],
    ['STRING                         ',clc$nominal_entry, 11],
    ['STRINGS                        ',clc$alias_entry, 11],
    ['SUMMARY_CALCULATION            ',clc$alias_entry, 6],
    ['UPH                            ',clc$abbreviation_entry, 14],
    ['USE_PAGE_HEADER                ',clc$alias_entry, 14],
    ['USE_PAGE_HEADERS               ',clc$nominal_entry, 14]],
    [
{ PARAMETER 1
    [24, 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$optional_parameter, 0
  , 0],
{ PARAMETER 2
    [18, 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, 121,
  clc$optional_parameter, 0, 0],
{ PARAMETER 3
    [15, 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$extended_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 4
    [14, 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, 121,
  clc$optional_parameter, 0, 0],
{ PARAMETER 5
    [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, 1582,
  clc$optional_parameter, 0, 0],
{ PARAMETER 6
    [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, 992,
  clc$optional_parameter, 0, 0],
{ PARAMETER 7
    [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_default_parameter, 0, 5],
{ PARAMETER 8
    [29, 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, 530,
  clc$optional_default_parameter, 0, 23],
{ PARAMETER 9
    [30, 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, 119,
  clc$optional_parameter, 0, 0],
{ PARAMETER 10
    [25, 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_parameter,
  0, 0],
{ PARAMETER 11
    [36, 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, 24, clc$optional_parameter,
  0, 0],
{ PARAMETER 12
    [20, 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$extended_parameter_checking, 243,
  clc$optional_parameter, 0, 0],
{ PARAMETER 13
    [23, 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, 84, clc$optional_parameter,
  0, 0],
{ PARAMETER 14
    [41, 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 15
    [33, 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, 21, clc$optional_parameter,
  0, 0],
{ PARAMETER 16
    [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, 627,
  clc$optional_parameter, 0, 0],
{ PARAMETER 17
    [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, 375,
  clc$optional_parameter, 0, 0],
{ PARAMETER 18
    [34, 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, osc$max_name_size]],
{ PARAMETER 2
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['L                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['LAST                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [1, clc$max_integer, 10]]
    ],
{ PARAMETER 3
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 4
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['L                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['LAST                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [1, clc$max_integer, 10]]
    ],
{ PARAMETER 5
    [[1, 0, clc$union_type], [[clc$list_type],
    FALSE, 2],
    108, [[1, 0, clc$list_type], [92, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$record_type], [2],
        ['FIELD_NAME                     ', clc$required_field, 5], [[1, 0, clc$name_type], [1,
  osc$max_name_size]],
        ['ROW_LABEL                      ', clc$optional_field, 8], [[1, 0, clc$string_type], [0,
  clc$max_string_size, FALSE]]
        ]
      ],
    1454, [[1, 0, clc$list_type], [1438, 1, ptc$field_vector_size, FALSE],
        [[1, 0, clc$record_type], [6],
        ['FIELD_NAME                     ', clc$required_field, 5], [[1, 0, clc$name_type], [1,
  osc$max_name_size]],
        ['DISPLAY_OPTION                 ', clc$optional_field, 1154], [[1, 0, clc$keyword_type], [31], [
          ['ALL_OCCURRENCE                 ', clc$alias_entry, clc$normal_usage_entry, 1],
          ['ALL_OCCURRENCES                ', clc$nominal_entry, clc$normal_usage_entry, 1],
          ['AO                             ', clc$alias_entry, clc$normal_usage_entry, 1],
          ['AVERAGE                        ', clc$alias_entry, clc$normal_usage_entry, 6],
          ['AVG                            ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
          ['C                              ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
          ['COUNT                          ', clc$nominal_entry, clc$normal_usage_entry, 4],
          ['COUNT_PER_SECOND               ', clc$nominal_entry, clc$normal_usage_entry, 10],
          ['CPS                            ', clc$abbreviation_entry, clc$normal_usage_entry, 10],
          ['D                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
          ['DETAIL                         ', clc$alias_entry, clc$normal_usage_entry, 1],
          ['ELAPSED_TIME_SINCE_PREDECESSOR ', clc$nominal_entry, clc$hidden_entry, 13],
          ['ETSP                           ', clc$abbreviation_entry, clc$hidden_entry, 13],
          ['FIRST_OCCURRENCE               ', clc$nominal_entry, clc$normal_usage_entry, 2],
          ['FO                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
          ['I                              ', clc$abbreviation_entry, clc$hidden_entry, 12],
          ['INTERVAL                       ', clc$nominal_entry, clc$hidden_entry, 12],
          ['LAST_OCCURRENCE                ', clc$nominal_entry, clc$normal_usage_entry, 3],
          ['LO                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
          ['M                              ', clc$alias_entry, clc$normal_usage_entry, 6],
          ['MAX                            ', clc$abbreviation_entry, clc$normal_usage_entry, 9],
          ['MAXIMUM                        ', clc$nominal_entry, clc$normal_usage_entry, 9],
          ['MEAN                           ', clc$nominal_entry, clc$normal_usage_entry, 6],
          ['MIN                            ', clc$abbreviation_entry, clc$normal_usage_entry, 8],
          ['MINIMUM                        ', clc$nominal_entry, clc$normal_usage_entry, 8],
          ['S                              ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
          ['SD                             ', clc$abbreviation_entry, clc$normal_usage_entry, 7],
          ['SPS                            ', clc$abbreviation_entry, clc$normal_usage_entry, 11],
          ['STANDARD_DEVIATION             ', clc$nominal_entry, clc$normal_usage_entry, 7],
          ['SUM                            ', clc$nominal_entry, clc$normal_usage_entry, 5],
          ['SUM_PER_SECOND                 ', clc$nominal_entry, clc$normal_usage_entry, 11]]
          ],
        ['START_COLUMN                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]],
        ['COLUMN_WIDTH                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]],
        ['HEADER_1                       ', clc$optional_field, 8], [[1, 0, clc$string_type], [1,
  ptc$max_page_width, FALSE]],
        ['HEADER_2                       ', clc$optional_field, 8], [[1, 0, clc$string_type], [1,
  ptc$max_page_width, FALSE]]
        ]
      ]
    ],
{ PARAMETER 6
    [[1, 0, clc$list_type], [976, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$record_type], [3],
      ['CALCULATION                    ', clc$required_field, 821], [[1, 0, clc$keyword_type], [22], [
        ['AVERAGE                        ', clc$alias_entry, clc$normal_usage_entry, 3],
        ['AVG                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['C                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['COUNT                          ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['COUNT_PER_SECOND               ', clc$nominal_entry, clc$normal_usage_entry, 7],
        ['CPS                            ', clc$abbreviation_entry, clc$normal_usage_entry, 7],
        ['ELAPSED_TIME_SINCE_PREDECESSOR ', clc$nominal_entry, clc$hidden_entry, 10],
        ['ETSP                           ', clc$abbreviation_entry, clc$hidden_entry, 10],
        ['I                              ', clc$abbreviation_entry, clc$hidden_entry, 9],
        ['INTERVAL                       ', clc$nominal_entry, clc$hidden_entry, 9],
        ['M                              ', clc$alias_entry, clc$normal_usage_entry, 3],
        ['MAX                            ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
        ['MAXIMUM                        ', clc$nominal_entry, clc$normal_usage_entry, 6],
        ['MEAN                           ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['MIN                            ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
        ['MINIMUM                        ', clc$nominal_entry, clc$normal_usage_entry, 5],
        ['S                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['SD                             ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
        ['SPS                            ', clc$abbreviation_entry, clc$normal_usage_entry, 8],
        ['STANDARD_DEVIATION             ', clc$nominal_entry, clc$normal_usage_entry, 4],
        ['SUM                            ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['SUM_PER_SECOND                 ', clc$nominal_entry, clc$normal_usage_entry, 8]]
        ],
      ['START_COLUMN                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]],
      ['COLUMN_WIDTH                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]]
      ]
    ],
{ PARAMETER 7
    [[1, 0, clc$boolean_type],
    'false'],
{ PARAMETER 8
    [[1, 0, clc$record_type], [4],
    ['LABEL                          ', clc$optional_field, 331], [[1, 0, clc$union_type], [[
      clc$keyword_type, clc$string_type],
      FALSE, 2],
      303, [[1, 0, clc$keyword_type], [8], [
        ['END_TIME                       ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['ET                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
        ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 4],
        ['ST                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['START_TIME                     ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['TIME_RANGE                     ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['TR                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3]]
        ],
      8, [[1, 0, clc$string_type], [0, clc$max_string_size, FALSE]]
      ],
    ['START_COLUMN                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]],
    ['COLUMN_WIDTH                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]],
    ['DATE_TIME_FORMAT               ', clc$optional_field, 8], [[1, 0, clc$string_type], [0,
  clc$max_string_size, FALSE]]
    ,
    '(time_range 1 21 ''HMS'')'],
{ PARAMETER 9
    [[1, 0, clc$record_type], [2],
    ['START_COLUMN                   ', clc$required_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]],
    ['COLUMN_WIDTH                   ', clc$required_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]]
    ],
{ PARAMETER 10
    [[1, 0, clc$integer_type], [1, 10000, 10]],
{ PARAMETER 11
    [[1, 0, clc$list_type], [8, 1, 11, FALSE],
      [[1, 0, clc$string_type], [0, clc$max_string_size, FALSE]]
    ],
{ PARAMETER 12
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['DEFAULT                        ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    179, [[1, 0, clc$list_type], [163, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$record_type], [3],
        ['STRING                         ', clc$required_field, 8], [[1, 0, clc$string_type], [0,
  clc$max_string_size, FALSE]],
        ['START_COLUMN                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]],
        ['COLUMN_WIDTH                   ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  ptc$max_page_width, 10]]
        ]
      ]
    ],
{ PARAMETER 13
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [1, clc$max_integer, 10]]
    ],
{ PARAMETER 14
    [[1, 0, clc$boolean_type]],
{ PARAMETER 15
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 16
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    563, [[1, 0, clc$list_type], [547, 1, sfc$max_number_of_counters, FALSE],
        [[1, 0, clc$record_type], [2],
        ['COUNTER_NUMBER                 ', clc$required_field, 91], [[1, 0, clc$union_type], [[
          clc$keyword_type, clc$range_type],
          FALSE, 2],
          44, [[1, 0, clc$keyword_type], [1], [
            ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
            ],
          27, [[1, 0, clc$range_type], [20],
              [[1, 0, clc$integer_type], [1, sfc$max_number_of_counters, 10]]
            ]
          ],
        ['BASE                           ', clc$required_field, 377], [[1, 0, clc$keyword_type], [10], [
          ['B10                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
          ['B16                            ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
          ['B16G                           ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
          ['B2                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
          ['B8                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
          ['BASE_10                        ', clc$nominal_entry, clc$normal_usage_entry, 3],
          ['BASE_16                        ', clc$nominal_entry, clc$normal_usage_entry, 4],
          ['BASE_16_GROUP                  ', clc$nominal_entry, clc$normal_usage_entry, 5],
          ['BASE_2                         ', clc$nominal_entry, clc$normal_usage_entry, 1],
          ['BASE_8                         ', clc$nominal_entry, clc$normal_usage_entry, 2]]
          ]
        ]
      ]
    ],
{ PARAMETER 17
    [[1, 0, clc$union_type], [[clc$record_type, clc$string_type],
    FALSE, 2],
    8, [[1, 0, clc$string_type], [0, sfc$max_descriptive_data_size, FALSE]],
    347, [[1, 0, clc$record_type], [4],
      ['POSITION                       ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1,
  sfc$max_descriptive_data_size, 10]],
      ['LENGTH                         ', clc$optional_field, 84], [[1, 0, clc$union_type], [[
        clc$integer_type, clc$keyword_type],
        FALSE, 2],
        44, [[1, 0, clc$keyword_type], [1], [
          ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
          ],
        20, [[1, 0, clc$integer_type], [1, sfc$max_descriptive_data_size, 10]]
        ],
      ['FIELD_NUMBER                   ', clc$optional_field, 84], [[1, 0, clc$union_type], [[
        clc$integer_type, clc$keyword_type],
        FALSE, 2],
        44, [[1, 0, clc$keyword_type], [1], [
          ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
          ],
        20, [[1, 0, clc$integer_type], [1, sfc$max_descriptive_data_size, 10]]
        ],
      ['FIELD_DELIMITER                ', clc$optional_field, 8], [[1, 0, clc$string_type], [1, 1, FALSE]]
      ]
    ],
{ PARAMETER 18
    [[1, 0, clc$status_type]]];

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

    CONST
      p$put = 1,
      p$number = 2,
      p$new_put = 3,
      p$new_number = 4,
      p$field = 5,
      p$display_option = 6,
      p$display_headers = 7,
      p$row_label = 8,
      p$row_label_format = 9,
      p$report_interval = 10,
      p$string = 11,
      p$page_header = 12,
      p$pop_count = 13,
      p$use_page_headers = 14,
      p$selection = 15,
      p$counter = 16,
      p$descriptive_data = 17,
      p$status = 18;

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

    VAR
      all_occurrences: boolean,
      index: integer,
      number: integer,
      put_entry_chain_head: ^put_entry,
      put_number: string (15),
      put_entry_p: ^put_entry,
      put_entry_1_p: ^put_entry,
      temp_put_entry: ^put_entry;

?? NEWTITLE := 'check_change_put', EJECT ??

    PROCEDURE check_change_put
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$new_put =
          IF pvt [p$new_put].specified THEN
            put_entry_p := put_entry_chain_head;
            WHILE (put_entry_p <> NIL) AND (put_entry_p^.name <> pvt [p$new_put].value^.name_value) DO
              put_entry_p := put_entry_p^.put_chain_link_p;
            WHILEND;
            IF put_entry_p <> NIL THEN
              osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$redefined_put,
                    pvt [p$new_put].value^.name_value, status);
              RETURN; {----->
            IFEND;
          IFEND;
        ELSE
        CASEND;
      ELSE

        IF pvt [p$put].specified AND pvt [p$number].specified THEN
          osp$set_status_condition (pte$put_and_number, status);
          RETURN; {----->
        IFEND;

        IF (NOT pvt [p$put].specified) AND (NOT pvt [p$number].specified) THEN
          osp$set_status_condition (pte$not_put_and_number, status);
          RETURN; {----->
        IFEND;

{ p$put, p$number

        put_entry_p := put_entry_chain_head;
        IF pvt [p$put].specified THEN
          number := 1;
          WHILE (put_entry_p <> NIL) AND (put_entry_p^.name <> pvt [p$put].value^.name_value) DO
            put_entry_p := put_entry_p^.put_chain_link_p;
            number := number + 1;
          WHILEND;
          IF put_entry_p = NIL THEN
            osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$undefined_put_for_change,
                  pvt [p$put].value^.name_value, status);
            RETURN; {----->
          IFEND;
        ELSE
          number := 1;
          WHILE (put_entry_p <> NIL) AND (number < pvt [p$number].value^.integer_value.value) DO
            put_entry_p := put_entry_p^.put_chain_link_p;
            number := number + 1;
          WHILEND;
          IF put_entry_p = NIL THEN
            put_number := 'number ';
            STRINGREP (put_number (8, * ), ptv$output_line_length, pvt [p$number].value^.integer_value.value);
            osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$undefined_put_for_change, put_number,
                  status);
            RETURN; {----->
          IFEND;
        IFEND;

        temp_put_entry^ := put_entry_p^;

        CASE put_entry_p^.put OF

        = put_field_summary =

          IF pvt [p$report_interval].specified OR pvt [p$string].specified OR pvt [p$selection].
                specified OR pvt [p$counter].specified OR pvt [p$descriptive_data].
                specified OR pvt [p$row_label].specified OR pvt [p$page_header].specified
                 OR pvt [p$pop_count].specified OR pvt [p$use_page_headers].specified THEN
            osp$set_status_condition (pte$change_put_parameters_putfs, status);
            RETURN; {----->
          IFEND;

          IF pvt [p$field].specified THEN
            report_undefined_counters (pvt [p$field].value, status);
          IFEND;

          IF pvt [p$display_option].specified OR pvt [p$row_label_format].specified THEN

{ summary_calculation & row_label_format

            process_summary_calculation (pvt [p$display_option], pvt [p$row_label_format],
                  temp_put_entry, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            process_headers_putfs (temp_put_entry);
          IFEND;

        = put_interval_field =

          IF pvt [p$display_headers].specified OR pvt [p$string].specified OR pvt [p$selection].
                specified OR pvt [p$counter].specified OR pvt [p$descriptive_data].
                specified OR pvt [p$row_label_format].specified OR pvt [p$page_header].specified
                OR pvt [p$pop_count].specified OR pvt [p$use_page_headers].specified THEN
            osp$set_status_condition (pte$change_put_parameters_putif, status);
            RETURN; {----->
          IFEND;

          IF pvt [p$field].specified THEN
            report_undefined_fields (pvt [p$field].value, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          IFEND;

          IF pvt [p$field].specified OR pvt [p$row_label].specified THEN

{ field (field_name, summary_calculation, position_description and headers).

            process_field_position (pvt [p$field], pvt [p$row_label], temp_put_entry, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          IFEND;

        = put_field =

          IF pvt [p$display_headers].specified OR pvt [p$string].specified OR pvt [p$selection].
                specified OR pvt [p$counter].specified OR pvt [p$descriptive_data].
                specified OR pvt [p$row_label_format].specified OR pvt [p$page_header].specified
                OR pvt [p$pop_count].specified OR pvt [p$use_page_headers].specified THEN
            osp$set_status_condition (pte$change_put_parameters_putf, status);
            RETURN; {----->
          IFEND;

          IF pvt [p$field].specified THEN
            report_undefined_fields (pvt [p$field].value, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

            check_display_option (pvt [p$field].value, all_occurrences, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

{ field (field_name, summary_calculation and position_description and headers).

            temp_put_entry^.all_occurrences := all_occurrences;
            process_field_position (pvt [p$field], pvt [p$field], temp_put_entry, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          IFEND;

        = put_string =

          IF pvt [p$display_headers].specified OR pvt [p$field].specified OR pvt [p$report_interval].
                specified OR pvt [p$row_label_format].specified OR pvt [p$selection].
                specified OR pvt [p$counter].specified OR pvt [p$descriptive_data].
                specified OR pvt [p$row_label].specified OR pvt [p$page_header].specified
                OR pvt [p$pop_count].specified OR pvt [p$use_page_headers].specified THEN
            osp$set_status_condition (pte$change_put_parameters_puts, status);
            RETURN; {----->
          IFEND;

          IF pvt [p$string].specified THEN
            process_string (pvt [p$string], temp_put_entry, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          IFEND;

        = push_page_header =

          IF pvt [p$display_headers].specified OR pvt [p$field].specified OR pvt [p$report_interval].
                specified OR pvt [p$row_label_format].specified OR pvt [p$selection].
                specified OR pvt [p$counter].specified OR pvt [p$descriptive_data].
                specified OR pvt [p$row_label].specified OR pvt [p$string].specified
                OR  pvt [p$pop_count].specified OR  pvt [p$use_page_headers].specified THEN
            osp$set_status_condition (pte$change_put_parameters_pusph, status);
            RETURN; {----->
          IFEND;

          IF pvt [p$page_header].specified THEN
            IF (pvt [p$page_header].value^.kind = clc$keyword) THEN

  { The only keyword is DEFAULT.
              temp_put_entry^.default_header := TRUE;
            ELSE {header string specified
              temp_put_entry^.default_header := FALSE;
              process_string (pvt [p$page_header], temp_put_entry, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;
            IFEND;
          IFEND;

        = pop_page_header =

          IF pvt [p$display_headers].specified OR pvt [p$field].specified OR pvt [p$report_interval].
                specified OR pvt [p$row_label_format].specified OR pvt [p$selection].
                specified OR pvt [p$counter].specified OR pvt [p$descriptive_data].
                specified OR pvt [p$row_label].specified OR pvt [p$string].specified
                OR  pvt [p$page_header].specified OR  pvt [p$use_page_headers].specified THEN
            osp$set_status_condition (pte$change_put_parameters_popph, status);
            RETURN; {----->
          IFEND;

        = put_new_page =

          IF pvt [p$display_headers].specified OR pvt [p$field].specified OR pvt [p$report_interval].
                specified OR pvt [p$row_label_format].specified OR pvt [p$selection].
                specified OR pvt [p$counter].specified OR pvt [p$descriptive_data].
                specified OR pvt [p$row_label].specified OR pvt [p$string].specified
                OR  pvt [p$page_header].specified OR  pvt [p$pop_count].specified THEN
            osp$set_status_condition (pte$change_put_parameters_putnp, status);
            RETURN; {----->
          IFEND;

        = put_record =

          IF pvt [p$display_headers].specified OR pvt [p$string].specified OR
                pvt [p$report_interval].specified OR pvt [p$row_label_format].specified OR
                pvt [p$field].specified OR pvt [p$row_label].specified OR pvt [p$page_header].specified
                OR pvt [p$pop_count].specified OR pvt [p$use_page_headers].specified THEN
            osp$set_status_condition (pte$change_put_parameters_putr, status);
            RETURN; {----->
          IFEND;

          IF pvt [p$selection].specified THEN
            report_duplicate_name (pvt [p$selection].value, 'SELECTION', status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

            report_undefined_selections (pvt [p$selection].value, put_entry_p, status);
          IFEND;

          IF pvt [p$counter].specified THEN
            check_counter_parameter (pvt [p$counter], temp_put_entry, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          IFEND;

        ELSE
        CASEND;

      IFEND;

    PROCEND check_change_put;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

    clp$get_reason_for_call (ptv$information_request, ptv$display_file, ptv$prompting_activted, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    IF NOT ptv$information_request THEN

      CASE ptv$generate OF
      = report =
        put_entry_chain_head := ptv$report_entry_chain_head_p;
      = log =
        put_entry_chain_head := ptv$log_entry_chain_head_p;
      = none =
        clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
        osp$set_status_condition (pte$generate_none_mode, status);
        RETURN; {----->
      ELSE
      CASEND;

      ALLOCATE temp_put_entry;

    IFEND;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), ^check_change_put, ^pvt, status);
    IF NOT status.normal THEN
      IF NOT ptv$information_request THEN
        FREE temp_put_entry;
      IFEND;
      RETURN; {----->
    IFEND;

{ new_number

    IF pvt [p$new_number].specified THEN
      IF put_entry_p <> put_entry_chain_head THEN
        put_entry_1_p := put_entry_chain_head;
        FOR index := 1 TO (number - 2) DO
          put_entry_1_p := put_entry_1_p^.put_chain_link_p;
        FOREND;
        put_entry_1_p^.put_chain_link_p := put_entry_p^.put_chain_link_p;
      ELSE
        put_entry_chain_head := put_entry_p^.put_chain_link_p;
      IFEND;
      put_entry_p^.put_chain_link_p := NIL;
      process_number_parameter (pvt [p$new_number].value^, put_entry_p, ptv$report_entry_chain_head_p);
    IFEND;

{ new_put

    IF pvt [p$new_put].specified THEN
      temp_put_entry^.name := pvt [p$new_put].value^.name_value;
    IFEND;

{ display_headers

    IF pvt [p$display_headers].specified THEN
      temp_put_entry^.display_headers := pvt [p$display_headers].value^.boolean_value.value;
      IF temp_put_entry^.display_headers THEN
        process_headers_putfs (temp_put_entry);
      IFEND;
    IFEND;

{ report_interval

    IF pvt [p$report_interval].specified THEN
      temp_put_entry^.report_interval := pvt [p$report_interval].value^.integer_value.value;
    IFEND;

{ descriptive_data

    IF pvt [p$descriptive_data].specified THEN
      IF pvt [p$descriptive_data].value^.kind = clc$record THEN

        IF temp_put_entry^.descriptive_text_p <> NIL THEN
          FREE temp_put_entry^.descriptive_text_p;
          temp_put_entry^.subfield_position := 1;
          temp_put_entry^.subfield_length := sfc$max_descriptive_data_size;
          temp_put_entry^.subfield_number := 0;
          temp_put_entry^.subfield_delimiter := ',';
        IFEND;

        IF pvt [p$descriptive_data].value^.field_values^ [1].value <> NIL THEN
          temp_put_entry^.subfield_position := pvt [p$descriptive_data].value^.field_values^ [1].
                value^.integer_value.value;
        IFEND;

        IF pvt [p$descriptive_data].value^.field_values^ [2].value <> NIL THEN
          IF pvt [p$descriptive_data].value^.field_values^ [2].value^.kind <> clc$keyword THEN
            temp_put_entry^.subfield_length := pvt [p$descriptive_data].value^.field_values^ [2].
                  value^.integer_value.value;
          ELSE
            temp_put_entry^.subfield_length := sfc$max_descriptive_data_size;
          IFEND;
        IFEND;

        IF pvt [p$descriptive_data].value^.field_values^ [3].value <> NIL THEN
          IF pvt [p$descriptive_data].value^.field_values^ [3].value^.kind <> clc$keyword THEN
            temp_put_entry^.subfield_number := pvt [p$descriptive_data].value^.field_values^ [3].
                  value^.integer_value.value;
          ELSE
            temp_put_entry^.subfield_number := 0;
          IFEND;
        IFEND;

        IF pvt [p$descriptive_data].value^.field_values^ [4].value <> NIL THEN
          temp_put_entry^.subfield_delimiter := pvt [p$descriptive_data].value^.field_values^ [4].
                value^.string_value^ (1);
        IFEND;

      ELSE

        IF temp_put_entry^.descriptive_text_p <> NIL THEN
          FREE temp_put_entry^.descriptive_text_p;
        IFEND;

        ALLOCATE temp_put_entry^.descriptive_text_p: [#SIZE (pvt [p$descriptive_data].value^.string_value^)];
        temp_put_entry^.descriptive_text_p^ := pvt [p$descriptive_data].value^.string_value^;

      IFEND;
    IFEND;

{ Page format control

    IF pvt [p$pop_count].specified THEN
      temp_put_entry^.pop_count := pvt [p$pop_count].value^.integer_value.value;
    ELSEIF pvt [p$use_page_headers].specified THEN
      temp_put_entry^.use_page_headers := pvt [p$use_page_headers].value^.boolean_value.value;
    IFEND;

{ field & records

    IF pvt [p$field].specified OR pvt [p$selection].specified THEN
      CASE put_entry_p^.put OF

      = put_field_summary =
        free_field_list (put_entry_p);
        put_entry_p^ := temp_put_entry^;
        put_entry_p^.fields_p := NIL;
        process_field_parameter_putfs (pvt [p$field].value, put_entry_p);

      = put_interval_field, put_field =
        IF put_entry_p^.put = put_interval_field THEN
          FREE put_entry_p^.date_time_format_p;
        IFEND;
        free_field_vector (put_entry_p);
        put_entry_p^ := temp_put_entry^;
        process_field_parameter_putif (put_entry_p);

      = put_record =
        free_selection_list (put_entry_p^.selection_p);
        put_entry_p^ := temp_put_entry^;
        put_entry_p^.selection_p := NIL;
        process_selection_parameter (pvt [p$selection].value, put_entry_p);

      ELSE
      CASEND;
    ELSE
      put_entry_p^ := temp_put_entry^;
    IFEND;

    FREE temp_put_entry;

  PROCEND change_put_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'delete_put_cmd', EJECT ??

{ This procedure processes the delete_put command.

*copyc pth$anabl_delete_put

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

{  PROCEDURE (ptm$anabl_delp) delete_put, delp (
{  put, p: (CHECK) any of
{      key
{        all
{      keyend
{      list of name
{    anyend = $optional
{  number, n: (CHECK) any of
{      key
{        all
{        (last, l)
{      keyend
{      list of range of integer 1..clc$max_integer
{    anyend = $optional
{    status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 5] of clt$pdt_parameter_name,
      parameters: array [1 .. 3] 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        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,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
      recend,
      type2: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 3] of clt$keyword_specification,
        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,
            qualifier: clt$range_type_qualifier,
            element_type_spec: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
          recend,
        recend,
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 28, 11, 20, 9, 409],
    clc$command, 5, 3, 0, 0, 0, 0, 3, 'PTM$ANABL_DELP'], [
    ['N                              ',clc$abbreviation_entry, 2],
    ['NUMBER                         ',clc$nominal_entry, 2],
    ['P                              ',clc$abbreviation_entry, 1],
    ['PUT                            ',clc$nominal_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 3]],
    [
{ 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$extended_parameter_checking, 85, clc$optional_parameter,
  0, 0],
{ PARAMETER 2
    [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$extended_parameter_checking, 181,
  clc$optional_parameter, 0, 0],
{ PARAMETER 3
    [5, 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$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$name_type], [1, osc$max_name_size]]
      ]
    ],
{ PARAMETER 2
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    118, [[1, 0, clc$keyword_type], [3], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['L                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['LAST                           ', clc$nominal_entry, clc$normal_usage_entry, 2]]
      ],
    43, [[1, 0, clc$list_type], [27, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$range_type], [20],
          [[1, 0, clc$integer_type], [1, clc$max_integer, 10]]
        ]
      ]
    ],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];

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

    CONST
      p$put = 1,
      p$number = 2,
      p$status = 3;

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

    VAR
      delete_more: boolean,
      delete_status: boolean,
      errors_detected: boolean,
      failing_status: ost$status,
      number: integer,
      numbers: ^numbers_set,
      put_entry_chain_head: ^put_entry,
      put_entry_1_p: ^put_entry,
      put_entry_2_p: ^put_entry,
      selection_p: ^selection,
      value_p: ^clt$data_value;

?? NEWTITLE := 'check_delete_put', EJECT ??

    PROCEDURE check_delete_put
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$put =
          IF pvt [p$put].value^.kind = clc$list THEN
            report_duplicate_name (pvt [p$put].value, 'PUT', status);
          IFEND;
        = p$number =
          IF pvt [p$number].value^.kind = clc$list THEN
            ALLOCATE numbers;
            report_duplicate_number (pvt [p$number].value, 'NUMBER', numbers, status);
          IFEND;
        ELSE
        CASEND;
      ELSE
        IF pvt [p$put].specified AND pvt [p$number].specified THEN
          osp$set_status_condition (pte$put_and_number, status);
        IFEND;
        IF (NOT pvt [p$put].specified) AND (NOT pvt [p$number].specified) THEN
          osp$set_status_condition (pte$not_put_and_number, status);
        IFEND;
      IFEND;

    PROCEND check_delete_put;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

    clp$get_reason_for_call (ptv$information_request, ptv$display_file, ptv$prompting_activted, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    IF NOT ptv$information_request THEN
      CASE ptv$generate OF
      = report =
        put_entry_chain_head := ptv$report_entry_chain_head_p;
      = log =
        put_entry_chain_head := ptv$log_entry_chain_head_p;
      = none =
        clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
        osp$set_status_condition (pte$generate_none_mode, status);
        RETURN; {----->
      ELSE
      CASEND;

      numbers := NIL;
    IFEND;

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

    errors_detected := FALSE;
    IF pvt [p$put].specified THEN

{ PUT

      IF pvt [p$put].value^.kind = clc$keyword THEN

{ ALL

        put_entry_1_p := put_entry_chain_head;
        WHILE put_entry_1_p <> NIL DO
          put_entry_2_p := put_entry_1_p^.put_chain_link_p;
          delete_put (put_entry_1_p);
          put_entry_1_p := put_entry_2_p;
        WHILEND;
        put_entry_chain_head := NIL;
      ELSE

{ LIST

        value_p := pvt [p$put].value;
        WHILE value_p <> NIL DO
          put_entry_1_p := put_entry_chain_head;
          put_entry_2_p := put_entry_chain_head;
          WHILE (put_entry_1_p <> NIL) AND (value_p^.element_value^.name_value <> put_entry_1_p^.name) DO
            put_entry_2_p := put_entry_1_p;
            put_entry_1_p := put_entry_1_p^.put_chain_link_p;
          WHILEND;
          IF put_entry_1_p <> NIL THEN
            IF put_entry_1_p = put_entry_chain_head THEN
              put_entry_chain_head := put_entry_1_p^.put_chain_link_p;
              delete_put (put_entry_1_p);
            ELSE
              put_entry_2_p^.put_chain_link_p := put_entry_1_p^.put_chain_link_p;
              delete_put (put_entry_1_p);
            IFEND;
          ELSE
            errors_detected := TRUE;
            osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$undefined_put_for_delete,
                  value_p^.element_value^.name_value, failing_status);
            report_intermediate_error (failing_status, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            errors_detected := TRUE;
          IFEND;
          value_p := value_p^.link;
        WHILEND;
      IFEND;
      IF errors_detected THEN
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$error_processing_parameter, 'PUT', status);
      IFEND;
    ELSE

{ NUMBER

      IF pvt [p$number].value^.kind = clc$keyword THEN
        IF pvt [p$number].value^.name_value = 'LAST' THEN
          put_entry_1_p := put_entry_chain_head;
          put_entry_2_p := put_entry_chain_head;
          WHILE put_entry_1_p^.put_chain_link_p <> NIL DO
            put_entry_2_p := put_entry_1_p;
            put_entry_1_p := put_entry_1_p^.put_chain_link_p;
          WHILEND;
          IF put_entry_1_p = put_entry_chain_head THEN
            put_entry_chain_head := NIL;
          ELSE
            put_entry_2_p^.put_chain_link_p := NIL;
          IFEND;
          delete_put (put_entry_1_p);
        ELSE

{ ALL

          put_entry_1_p := put_entry_chain_head;
          WHILE put_entry_1_p <> NIL DO
            put_entry_2_p := put_entry_1_p^.put_chain_link_p;
            delete_put (put_entry_1_p);
            put_entry_1_p := put_entry_2_p;
          WHILEND;
          put_entry_chain_head := NIL;
        IFEND;
      ELSE

{ LIST

        number := 1;
        put_entry_1_p := put_entry_chain_head;
        put_entry_2_p := put_entry_chain_head;
        WHILE put_entry_1_p <> NIL DO
          IF number IN numbers^ THEN
            IF put_entry_1_p = put_entry_chain_head THEN
              put_entry_chain_head := put_entry_1_p^.put_chain_link_p;
              delete_put (put_entry_1_p);
              put_entry_1_p := put_entry_chain_head;
              put_entry_2_p := put_entry_chain_head;
            ELSE
              put_entry_2_p^.put_chain_link_p := put_entry_1_p^.put_chain_link_p;
              delete_put (put_entry_1_p);
              put_entry_1_p := put_entry_2_p^.put_chain_link_p;
            IFEND;
            numbers^ := numbers^ -$numbers_set [number];
          ELSE
            put_entry_2_p := put_entry_1_p;
            put_entry_1_p := put_entry_1_p^.put_chain_link_p;
          IFEND;
          number := number + 1;
        WHILEND;
        IF numbers^ <> $numbers_set [] THEN
          osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$error_processing_parameter, 'NUMBER',
                status);
        IFEND;
      IFEND;
      IF errors_detected THEN
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$error_processing_parameter, 'NUMBER', status);
      IFEND;
    IFEND;

{ If delete_put deletes any put block the procedure most not bypass this code before exit. That way there is
{ no RETURN after osp$set_status_abnormal.

    CASE ptv$generate OF
    = report =
      ptv$report_entry_chain_head_p := put_entry_chain_head;
    = log =
      ptv$log_entry_chain_head_p := put_entry_chain_head;
    ELSE
    CASEND;

    IF put_entry_chain_head = NIL THEN
      ptv$generate := none;
      ptv$headers_specified := FALSE;
    IFEND;

    IF numbers <> NIL THEN
      FREE numbers;
    IFEND;

  PROCEND delete_put_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'display_put_cmd', EJECT ??

{ This procedure processes the display_put command.

*copyc pth$anabl_display_put

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

{  PROCEDURE (ptm$anabl_disp) display_put, disp (
{    put, p    : (check) any of
{                  key
{                    all
{                  keyend
{                  list of name
{                anyend = $optional
{    number, n : (check) any of
{                  key
{                    all
{                    (last, l)
{                  keyend
{                  list of range of integer 1..clc$max_integer
{                anyend = $optional
{    display_option, do : list of key
{                           all
{                           (entries e)
{                           (name names n)
{                           (type t)
{                         keyend = name
{    output ,o : file = $output
{    status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 9] 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        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,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
      recend,
      type2: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 3] of clt$keyword_specification,
        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,
            qualifier: clt$range_type_qualifier,
            element_type_spec: record
              header: clt$type_specification_header,
              qualifier: clt$integer_type_qualifier,
            recend,
          recend,
        recend,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 8] of clt$keyword_specification,
        recend,
        default_value: string (4),
      recend,
      type4: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type5: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 28, 11, 43, 15, 828],
    clc$command, 9, 5, 0, 0, 0, 0, 5, 'PTM$ANABL_DISP'], [
    ['DISPLAY_OPTION                 ',clc$nominal_entry, 3],
    ['DO                             ',clc$abbreviation_entry, 3],
    ['N                              ',clc$abbreviation_entry, 2],
    ['NUMBER                         ',clc$nominal_entry, 2],
    ['O                              ',clc$abbreviation_entry, 4],
    ['OUTPUT                         ',clc$nominal_entry, 4],
    ['P                              ',clc$abbreviation_entry, 1],
    ['PUT                            ',clc$nominal_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 5]],
    [
{ 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$extended_parameter_checking, 85, clc$optional_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$extended_parameter_checking, 181,
  clc$optional_parameter, 0, 0],
{ PARAMETER 3
    [1, 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, 319,
  clc$optional_default_parameter, 0, 4],
{ 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, 3,
  clc$optional_default_parameter, 0, 7],
{ PARAMETER 5
    [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$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$name_type], [1, osc$max_name_size]]
      ]
    ],
{ PARAMETER 2
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    118, [[1, 0, clc$keyword_type], [3], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['L                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['LAST                           ', clc$nominal_entry, clc$normal_usage_entry, 2]]
      ],
    43, [[1, 0, clc$list_type], [27, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$range_type], [20],
          [[1, 0, clc$integer_type], [1, clc$max_integer, 10]]
        ]
      ]
    ],
{ PARAMETER 3
    [[1, 0, clc$list_type], [303, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$keyword_type], [8], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['E                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['ENTRIES                        ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['NAME                           ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['NAMES                          ', clc$alias_entry, clc$normal_usage_entry, 3],
      ['T                              ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['TYPE                           ', clc$nominal_entry, clc$normal_usage_entry, 4]]
      ]
    ,
    'name'],
{ PARAMETER 4
    [[1, 0, clc$file_type],
    '$output'],
{ PARAMETER 5
    [[1, 0, clc$status_type]]];

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

    CONST
      p$put = 1,
      p$number = 2,
      p$display_option = 3,
      p$output = 4,
      p$status = 5;

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

    TYPE
      display_option_type = set of (ptc$name, ptc$type, ptc$entries, ptc$all);

    VAR
      base: radix,
      display_option: display_option_type,
      errors_detected: boolean,
      failing_status: ost$status,
      index: integer,
      low_index: integer,
      number: integer,
      numbers: ^numbers_set,
      put_entry_chain_head: ^put_entry,
      put_entry_p: ^put_entry,
      selection_list_p: ^selection_list,
      value_p: ^clt$data_value;

?? NEWTITLE := 'check_display_put', EJECT ??

    PROCEDURE check_display_put
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$put =
          IF pvt [p$put].value^.kind = clc$list THEN
            report_duplicate_name (pvt [p$put].value, 'PUT', status);
          IFEND;
        = p$number =
          IF pvt [p$number].value^.kind = clc$list THEN
            ALLOCATE numbers;
            report_duplicate_number (pvt [p$number].value, 'NUMBER', numbers, status);
          IFEND;
        ELSE
        CASEND;
      ELSE
        IF pvt [p$put].specified AND pvt [p$number].specified THEN
          osp$set_status_condition (pte$put_and_number, status);
        IFEND;
        IF (NOT pvt [p$put].specified) AND (NOT pvt [p$number].specified) THEN
          osp$set_status_condition (pte$not_put_and_number, status);
        IFEND;
      IFEND;

    PROCEND check_display_put;

?? OLDTITLE ??
?? NEWTITLE := 'format_put_display', EJECT ??

    PROCEDURE format_put_display
      (VAR status: ost$status);

      VAR
        base_string: string (20),
        base_string_length: integer,
        field_list_p: ^field_list,
        index: integer,
        length_string: ost$string,
        subfield_number_string: ost$string,
        summary_string: ost$name;

?? NEWTITLE := 'format_put_field_summary', EJECT ??

      PROCEDURE format_put_field_summary
        (VAR status: ost$status);


        status.normal := TRUE;

        IF ptc$entries IN display_option THEN
          cyp$put_next_line (ptv$output_file, '   Field(s)', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          cyp$put_next_line (ptv$output_file, '     Counter Name                      Row Label', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          field_list_p := put_entry_p^.fields_p;
          WHILE field_list_p <> NIL DO
            STRINGREP (ptv$output_line, ptv$output_line_length, '     ', field_list_p^.field_p^.field_name,
                  '   ', field_list_p^.row_label (1, put_entry_p^.row_label_column_width));
            cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            field_list_p := field_list_p^.link_p;
          WHILEND;
        IFEND;

        IF ptc$type IN display_option THEN
          cyp$put_next_line (ptv$output_file, '   Put Type : Put Field Summary', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          cyp$put_next_line (ptv$output_file, '     Summary Calculation & Position Description', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          cyp$put_next_line (ptv$output_file, '       Summary                          Column  Length',
                status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          cyp$put_next_line (ptv$output_file, '       -------                          ------  ------',
                status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          FOR index := LOWERBOUND (summary_vector_type) TO UPPERBOUND (summary_vector_type) DO
            CASE put_entry_p^.summary_vector [index].summary OF
            = count =
              summary_string := 'Count';
            = sum =
              summary_string := 'Sum';
            = mean =
              summary_string := 'Mean';
            = standard_deviation =
              summary_string := 'Standard Deviation';
            = minimum =
              summary_string := 'Minimum';
            = maximum =
              summary_string := 'Maximum';
            = interval =
              summary_string := 'Interval';
            = count_per_second =
              summary_string := 'Count Per Second';
            = sum_per_second =
              summary_string := 'Sum Per Second';
            = elapsed_time_since_predecessor =
              summary_string := 'Elapsed Time Since Predecessor';
            = text =
              summary_string := 'Descriptive Data';
            ELSE
            CASEND;
            IF put_entry_p^.summary_vector [index].summary <> null THEN
              STRINGREP (ptv$output_line, ptv$output_line_length, '       ', summary_string,
                    put_entry_p^.summary_vector [index].start_column: 4, ' ',
                    (put_entry_p^.summary_vector [index].start_column +
                    put_entry_p^.summary_vector [index].column_width - 1):
                    4, put_entry_p^.summary_vector [index].column_width: 4);
              ptv$output_line (43, 2) := '..';
              cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;
            IFEND;
          FOREND;

          STRINGREP (ptv$output_line, ptv$output_line_length, '     Row Label Format :  Column ',
                put_entry_p^.row_label_start_column: 4, ' ', (put_entry_p^.row_label_start_column +
                put_entry_p^.row_label_column_width - 1): 4, '  Length ',
                put_entry_p^.row_label_column_width);
          ptv$output_line (37, 2) := '..';
          cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          STRINGREP (ptv$output_line, ptv$output_line_length, '     Display Headers : ',
                put_entry_p^.display_headers);
          cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          IF put_entry_p^.display_headers THEN
            IF put_entry_p^.header_1 <> ' ' THEN
              cyp$put_next_line (ptv$output_file, '    Header 1', status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;
              cyp$put_next_line (ptv$output_file, put_entry_p^.header_1, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;
            IFEND;

            IF put_entry_p^.header_2 <> ' ' THEN
              cyp$put_next_line (ptv$output_file, '    Header 2', status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;
              cyp$put_next_line (ptv$output_file, put_entry_p^.header_2, status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;
            IFEND;
          IFEND;
        IFEND;

      PROCEND format_put_field_summary;

?? OLDTITLE ??
?? NEWTITLE := 'format_put_field', EJECT ??

      PROCEDURE format_put_field
        (VAR status: ost$status);

        VAR
          join_predecessor_status: join_predecessor_status_type,
          selection_p: ^selection;

?? NEWTITLE := 'format_put_field_headers', EJECT ??

        PROCEDURE format_put_field_headers
          (VAR status: ost$status);

          status.normal := TRUE;

          IF put_entry_p^.header_1 <> ' ' THEN
            cyp$put_next_line (ptv$output_file, '    Header 1', status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            cyp$put_next_line (ptv$output_file, put_entry_p^.header_1, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          IFEND;

          IF put_entry_p^.header_2 <> ' ' THEN
            cyp$put_next_line (ptv$output_file, '    Header 2', status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            cyp$put_next_line (ptv$output_file, put_entry_p^.header_2, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          IFEND;

        PROCEND format_put_field_headers;

?? OLDTITLE, EJECT ??

        status.normal := TRUE;

        IF ptc$entries IN display_option THEN
          IF NOT (ptc$type IN display_option) THEN
            cyp$put_next_line (ptv$output_file, '   Field(s)', status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            FOR index := LOWERBOUND (field_vector_type) TO UPPERBOUND (field_vector_type) DO
              IF (put_entry_p^.field_vector [index].summary <> null) THEN
                STRINGREP (ptv$output_line, ptv$output_line_length, '     ', put_entry_p^.
                      field_vector [index].field_p^.field_name);
                cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
                IF NOT status.normal THEN
                  RETURN; {----->
                IFEND;
              IFEND;
            FOREND;
          IFEND;
        IFEND;

        IF ptc$type IN display_option THEN
          IF put_entry_p^.put = put_interval_field THEN
            cyp$put_next_line (ptv$output_file, '   Put Type : Put Interval Field', status);
          ELSE
            cyp$put_next_line (ptv$output_file, '   Put Type : Put Field', status);
          IFEND;
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          cyp$put_next_line (ptv$output_file, '     Field, Display Option & Position Description', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          cyp$put_next_line (ptv$output_file,
                '   Field                           Display Option                   Column  Len', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          cyp$put_next_line (ptv$output_file,
                '   -----                           --------------                   ------  ---', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          FOR index := LOWERBOUND (field_vector_type) TO UPPERBOUND (field_vector_type) DO
            CASE put_entry_p^.field_vector [index].summary OF
            = count =
              summary_string := 'Count';
            = sum =
              summary_string := 'Sum';
            = mean =
              summary_string := 'Mean';
            = standard_deviation =
              summary_string := 'Standard Deviation';
            = minimum =
              summary_string := 'Minimum';
            = maximum =
              summary_string := 'Maximum';
            = interval =
              summary_string := 'Interval';
            = count_per_second =
              summary_string := 'Count Per Second';
            = sum_per_second =
              summary_string := 'Sum Per Second';
            = elapsed_time_since_predecessor =
              summary_string := 'Elapsed Time Since Predecessor';
            = text =
              summary_string := 'Text';
            = all_occurrences =
              summary_string := 'All Occurrences';
            = last_occurrence =
              summary_string := 'Last Occurrences';
            = first_occurrence =
              summary_string := 'First Occurrences';
            ELSE
            CASEND;
            IF put_entry_p^.field_vector [index].summary <> null THEN
              STRINGREP (ptv$output_line, ptv$output_line_length, '   ',
                    put_entry_p^.field_vector [index].field_p^.field_name, ' ', summary_string,
                    put_entry_p^.field_vector [index].start_column: 4, ' ',
                    (put_entry_p^.field_vector [index].start_column +
                    put_entry_p^.field_vector [index].column_width - 1): 4,
                    put_entry_p^.field_vector [index].column_width: 4);
              ptv$output_line (71, 2) := '..';
              cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;
            IFEND;
          FOREND;

          IF put_entry_p^.put = put_interval_field THEN

            CASE put_entry_p^.row_label_type OF

            = start_time =
              STRINGREP (ptv$output_line, ptv$output_line_length, '   Row Label Type : Start_Time');

            = end_time =
              cyp$put_next_line (ptv$output_file, '   Row Label Type : End_Time', status);

            = time_range =
              cyp$put_next_line (ptv$output_file, '   Row Label Type : Time_Range', status);

            = row_label_none =
              cyp$put_next_line (ptv$output_file, '   Row Label Type : None', status);

            = string_label =
              STRINGREP (ptv$output_line, ptv$output_line_length, '   Row Label Type : String   ''',
                    put_entry_p^.row_label (1, put_entry_p^.date_time_column_width), '''');
              cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);

            ELSE
            CASEND;
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

            IF put_entry_p^.row_label_type <> row_label_none THEN
              STRINGREP (ptv$output_line, ptv$output_line_length, '   Row Label Format :  Column ',
                    put_entry_p^.date_time_start_column: 4, ' ', (put_entry_p^.date_time_start_column +
                    put_entry_p^.date_time_column_width - 1): 4, '  Length ',
                    put_entry_p^.date_time_column_width);
              ptv$output_line (35, 2) := '..';
              cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;

              IF put_entry_p^.row_label_type <> string_label THEN
                STRINGREP (ptv$output_line, ptv$output_line_length, '   Date Time Format  ''',
                      put_entry_p^.date_time_format_p^, '''');
                cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
                IF NOT status.normal THEN
                  RETURN; {----->
                IFEND;
              IFEND;
            IFEND;

            STRINGREP (ptv$output_line, ptv$output_line_length, '   Report Interval :',
                  put_entry_p^.report_interval);
            cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

            format_put_field_headers (status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

          IFEND;

          IF (put_entry_p^.put = put_field) AND put_entry_p^.all_occurrences THEN

            format_put_field_headers (status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

            check_predecessor_path (put_entry_p, join_predecessor_status, selection_p);

            CASE join_predecessor_status OF
            = one_selection =

            = no_predecessor_path = { The fields are from more than one selection.
              cyp$put_next_line (ptv$output_file, '    The field in the put entry belong to more than one' CAT
                    ' selection but join predecessor was not active.', status);

            = predecessor_path =
              cyp$put_next_line (ptv$output_file, '    The field in the put entry belong to more than one' CAT
                    ' selection and join predecessor is active.', status);

            ELSE
            CASEND;
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;

          IFEND;

        IFEND;

      PROCEND format_put_field;

?? OLDTITLE ??
?? NEWTITLE := 'format_put_string', EJECT ??

      PROCEDURE format_put_string
        (VAR status: ost$status);

        status.normal := TRUE;

        IF ptc$type IN display_option THEN
          cyp$put_next_line (ptv$output_file, '   Put Type : Put String', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          cyp$put_next_line (ptv$output_file, '    string :', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          cyp$put_next_line (ptv$output_file, put_entry_p^.header_1, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        IFEND;

      PROCEND format_put_string;

?? OLDTITLE ??
?? NEWTITLE := 'format_push_page_header', EJECT ??

      PROCEDURE format_push_page_header
        (VAR status: ost$status);

        status.normal := TRUE;

        IF ptc$type IN display_option THEN
          cyp$put_next_line (ptv$output_file, '   Put Type : Push Page Header', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          cyp$put_next_line (ptv$output_file, '     Header :', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          IF put_entry_p^.default_header THEN
            cyp$put_next_line (ptv$output_file, '  DEFAULT HEADER', status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          ELSE
            cyp$put_next_line (ptv$output_file, put_entry_p^.header_1, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          IFEND;
        IFEND;

      PROCEND format_push_page_header;

?? OLDTITLE ??
?? NEWTITLE := 'format_pop_page_header', EJECT ??

      PROCEDURE format_pop_page_header
        (VAR status: ost$status);

        VAR
          pop_count_string: string(3);

        status.normal := TRUE;

        IF ptc$type IN display_option THEN
          cyp$put_next_line (ptv$output_file, '   Put Type : Pop Page Header', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          cyp$put_next_line (ptv$output_file, '    Pop Count :', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          IF put_entry_p^.pop_all_headers THEN
            cyp$put_next_line (ptv$output_file, '  ALL HEADERS', status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          ELSE
            clp$convert_integer_to_rjstring (put_entry_p^.pop_count, 10, FALSE, ' ', pop_count_string,
                  status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            cyp$put_next_line (ptv$output_file, pop_count_string, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          IFEND;
        IFEND;

      PROCEND format_pop_page_header;

?? OLDTITLE ??
?? NEWTITLE := 'format_put_new_page', EJECT ??

      PROCEDURE format_put_new_page
        (VAR status: ost$status);

        VAR
          use_page_headers_string: string(5);

        status.normal := TRUE;

        IF ptc$type IN display_option THEN
          cyp$put_next_line (ptv$output_file, '   Put Type : Put New Page', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          cyp$put_next_line (ptv$output_file, '    Use Page Headers:', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          IF put_entry_p^.use_page_headers THEN
            cyp$put_next_line (ptv$output_file, ' TRUE', status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          ELSE
            cyp$put_next_line (ptv$output_file, 'FALSE', status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          IFEND;
        IFEND;

      PROCEND format_put_new_page;

?? OLDTITLE ??
?? NEWTITLE := 'format_put_record', EJECT ??

      PROCEDURE format_put_record
        (VAR status: ost$status);

        status.normal := TRUE;

        IF ptc$entries IN display_option THEN
          cyp$put_next_line (ptv$output_file, '   Record(s)', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          selection_list_p := put_entry_p^.selection_p;
          WHILE selection_list_p <> NIL DO
            STRINGREP (ptv$output_line, ptv$output_line_length, '     ', selection_list_p^.selection_p^.name);
            cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            selection_list_p := selection_list_p^.link_p;
          WHILEND;
        IFEND;

        IF ptc$type IN display_option THEN
          cyp$put_next_line (ptv$output_file, '   Put Type : Put Record', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

{ Counter parameter

          cyp$put_next_line (ptv$output_file, '     Counters and base', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

          cyp$put_next_line (ptv$output_file, '       -- Counters --   Base', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          STRINGREP (ptv$output_line, ptv$output_line_length, '       --------      ----');
          cyp$put_next_line (ptv$output_file, '       --------------   ----', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

{ Put_record allows users to specify different bases for ranges of counters.  The following loop detects
{   when the base changes in the counter array.  If the base changes, then the old base is output
{   together with the range of counters that base was applied to.  The counter range is given by the
{   variables low_index..(index-1).

          low_index := 1;
          base := put_entry_p^.counter_base [1];
          FOR index := 1 TO sfc$max_number_of_counters DO
            IF base <> put_entry_p^.counter_base [index] THEN
              CASE base OF
              = base_0 =
                base_string := '  none';
                base_string_length := 6;
              = base_2 =
                base_string := '  base_2';
                base_string_length := 8;
              = base_8 =
                base_string := '  base_8';
                base_string_length := 8;
              = base_10 =
                base_string := '  base_10';
                base_string_length := 9;
              = base_16 =
                base_string := '  base_16';
                base_string_length := 9;
              = base_16_group =
                base_string := '  base_16_group';
                base_string_length := 15;
              ELSE
              CASEND;
              STRINGREP (ptv$output_line, ptv$output_line_length, '        ', low_index: 5, ' ..',
                    index - 1: 5, ' ', base_string (1, base_string_length));
              cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;
              base := put_entry_p^.counter_base [index];
              low_index := index;
            IFEND;
          FOREND;

{ Output the final base and counter range, since the loop will not detect a change for the last
{   counter range.

          CASE base OF
          = base_0 =
            base_string := '  none';
            base_string_length := 6;
          = base_2 =
            base_string := '  base_2';
            base_string_length := 8;
          = base_8 =
            base_string := '  base_8';
            base_string_length := 8;
          = base_10 =
            base_string := '  base_10';
            base_string_length := 9;
          = base_16 =
            base_string := '  base_16';
            base_string_length := 9;
          = base_16_group =
            base_string := '  base_16_group';
            base_string_length := 15;
          ELSE
          CASEND;
          STRINGREP (ptv$output_line, ptv$output_line_length, '        ', low_index: 5, ' ..',
                sfc$max_number_of_counters: 5, ' ', base_string (1, base_string_length));
          cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

{ Descriptive_data parameter

          IF put_entry_p^.descriptive_text_p <> NIL THEN
            STRINGREP (ptv$output_line, ptv$output_line_length, '     Descriptive Text     : ',
                  put_entry_p^.descriptive_text_p^);
            cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          ELSE

            IF put_entry_p^.subfield_length = sfc$max_descriptive_data_size THEN
              length_string.value := 'ALL';
              length_string.size := 3;
            ELSE
              clp$convert_integer_to_string (put_entry_p^.subfield_length, 10, FALSE, length_string, status);
            IFEND;

            IF put_entry_p^.subfield_number = 0 THEN
              subfield_number_string.value := 'ALL';
              subfield_number_string.size := 3;
            ELSE
              clp$convert_integer_to_string (put_entry_p^.subfield_number, 10, FALSE, subfield_number_string,
                    status);
            IFEND;

            STRINGREP (ptv$output_line, ptv$output_line_length, '     Position : ',
                  put_entry_p^.subfield_position, '  Length : ', length_string.value (1, length_string.size),
                  '  Field Number : ', subfield_number_string.value (1, subfield_number_string.size),
                  '  Field Delimiter : ''', put_entry_p^.subfield_delimiter, '''');
            cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          IFEND;
        IFEND;

      PROCEND format_put_record;

?? OLDTITLE, EJECT ??

      status.normal := TRUE;

      STRINGREP (ptv$output_line, ptv$output_line_length, ' Number :', number);
      cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

      IF (ptc$name IN display_option) AND (put_entry_p^.name <> ' ') THEN
        STRINGREP (ptv$output_line, ptv$output_line_length, '   Put : ', put_entry_p^.name);
        cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
      IFEND;

      IF (ptc$entries IN display_option) OR (ptc$type IN display_option) THEN
        CASE put_entry_p^.put OF

        = put_field_summary =
          format_put_field_summary (status);

        = put_interval_field, put_field =
          format_put_field (status);

        = put_string =
          format_put_string (status);

        = put_record =
          format_put_record (status);

        = push_page_header =
          format_push_page_header (status);

        = pop_page_header =
          format_pop_page_header (status);

        = put_new_page =
          format_put_new_page (status);

        ELSE
        CASEND;
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
      IFEND;

      cyp$put_next_line (ptv$output_file, ' ', status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

    PROCEND format_put_display;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

    clp$get_reason_for_call (ptv$information_request, ptv$display_file, ptv$prompting_activted, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    IF NOT ptv$information_request THEN
      CASE ptv$generate OF
      = report =
        put_entry_chain_head := ptv$report_entry_chain_head_p;
      = log =
        put_entry_chain_head := ptv$log_entry_chain_head_p;
      = none =
        clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
        osp$set_status_condition (pte$generate_none_mode, status);
        RETURN; {----->
      ELSE
      CASEND;

      numbers := NIL;
    IFEND;

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

{ display_option

    display_option := $display_option_type [];
    value_p := pvt [p$display_option].value;
    WHILE value_p <> NIL DO
      IF value_p^.element_value^.keyword_value = 'NAME' THEN
        display_option := display_option + $display_option_type [ptc$name];
      ELSEIF value_p^.element_value^.keyword_value = 'TYPE' THEN
        display_option := display_option + $display_option_type [ptc$type];
      ELSEIF value_p^.element_value^.keyword_value = 'ENTRIES' THEN
        display_option := display_option + $display_option_type [ptc$entries];
      ELSEIF value_p^.element_value^.keyword_value = 'ALL' THEN
        display_option := $display_option_type [ptc$entries, ptc$type, ptc$name];
      IFEND;
      value_p := value_p^.link;
    WHILEND;

{ Opens output file.

    cyp$open_file (pvt [p$output].value^.file_value^, ^ptv$display_file_specifications, ptv$output_file,
          status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    errors_detected := FALSE;
    IF pvt [p$put].specified THEN

{ PUT

      IF pvt [p$put].value^.kind = clc$keyword THEN
        IF pvt [p$put].value^.keyword_value = 'ALL' THEN

{ ALL

          put_entry_p := put_entry_chain_head;
          number := 1;
          WHILE put_entry_p <> NIL DO
            format_put_display (status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            put_entry_p := put_entry_p^.put_chain_link_p;
            number := number + 1;
          WHILEND;
        IFEND;
      ELSE

{ LIST

        value_p := pvt [p$put].value;
        WHILE value_p <> NIL DO
          put_entry_p := put_entry_chain_head;
          number := 1;
          WHILE (put_entry_p <> NIL) AND (value_p^.element_value^.name_value <> put_entry_p^.name) DO
            put_entry_p := put_entry_p^.put_chain_link_p;
            number := number + 1;
          WHILEND;
          IF put_entry_p <> NIL THEN
            format_put_display (status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          ELSE
            errors_detected := TRUE;
            osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$undefined_put_for_dis,
                  value_p^.element_value^.name_value, failing_status);
            report_intermediate_error (failing_status, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            errors_detected := TRUE;
          IFEND;
          value_p := value_p^.link;
        WHILEND;
      IFEND;
      IF errors_detected THEN
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$error_processing_parameter, 'PUT', status);
      IFEND;
    ELSE

{ NUMBER

      IF pvt [p$number].value^.kind = clc$keyword THEN
        IF pvt [p$number].value^.name_value = 'LAST' THEN
          put_entry_p := put_entry_chain_head;
          WHILE put_entry_p^.put_chain_link_p <> NIL DO
            put_entry_p := put_entry_p^.put_chain_link_p;
          WHILEND;
          format_put_display (status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        ELSE

{ ALL

          put_entry_p := put_entry_chain_head;
          number := 1;
          WHILE put_entry_p <> NIL DO
            format_put_display (status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            put_entry_p := put_entry_p^.put_chain_link_p;
            number := number + 1;
          WHILEND;
        IFEND;
      ELSE

{ range

        number := 1;
        put_entry_p := put_entry_chain_head;
        WHILE put_entry_p <> NIL DO
          IF number IN numbers^ THEN
            format_put_display (status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            numbers^ := numbers^ -$numbers_set [number];
          IFEND;
          put_entry_p := put_entry_p^.put_chain_link_p;
          number := number + 1;
        WHILEND;
        IF numbers^ <> $numbers_set [] THEN
          osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$error_processing_parameter, 'NUMBER',
                status);
        IFEND;
      IFEND;
      IF errors_detected THEN
        osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$error_processing_parameter, 'NUMBER', status);
      IFEND;
    IFEND;

    cyp$close_file (ptv$output_file, cyc$default_open_position, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF numbers <> NIL THEN
      FREE numbers;
    IFEND;

  PROCEND display_put_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'generate_report_cmd', EJECT ??

{ This procedure processes the generate_report command.

*copyc pth$anabl_generate_report

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

{    PROCEDURE (ptm$anabl_genr) generate_report, genr (
{    input, i: (CHECK) list of file = $optional
{    output, o: file = $output
{    display_format, df: (CHECK) key
{        (list, l)
{        (legible_data, ld)
{        (excel, e)
{      keyend = list
{    summarize_defined_data, sdd: (HIDDEN) boolean = false
{    display_report_header, drh: (HIDDEN) boolean = true
{    status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 11] of clt$pdt_parameter_name,
      parameters: array [1 .. 6] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
        default_value: string (7),
      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 (4),
      recend,
      type4: record
        header: clt$type_specification_header,
        default_value: string (5),
      recend,
      type5: record
        header: clt$type_specification_header,
        default_value: string (4),
      recend,
      type6: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 27, 13, 0, 48, 888],
    clc$command, 11, 6, 0, 0, 2, 0, 6, 'PTM$ANABL_GENR'], [
    ['DF                             ',clc$abbreviation_entry, 3],
    ['DISPLAY_FORMAT                 ',clc$nominal_entry, 3],
    ['DISPLAY_REPORT_HEADER          ',clc$nominal_entry, 5],
    ['DRH                            ',clc$abbreviation_entry, 5],
    ['I                              ',clc$abbreviation_entry, 1],
    ['INPUT                          ',clc$nominal_entry, 1],
    ['O                              ',clc$abbreviation_entry, 2],
    ['OUTPUT                         ',clc$nominal_entry, 2],
    ['SDD                            ',clc$abbreviation_entry, 4],
    ['STATUS                         ',clc$nominal_entry, 6],
    ['SUMMARIZE_DEFINED_DATA         ',clc$nominal_entry, 4]],
    [
{ 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$extended_parameter_checking, 19, clc$optional_parameter,
  0, 0],
{ PARAMETER 2
    [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, 3,
  clc$optional_default_parameter, 0, 7],
{ PARAMETER 3
    [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$extended_parameter_checking, 229,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 4
    [11, clc$hidden_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 5],
{ PARAMETER 5
    [3, clc$hidden_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 6
    [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$list_type], [3, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$file_type]]
    ],
{ PARAMETER 2
    [[1, 0, clc$file_type],
    '$output'],
{ PARAMETER 3
    [[1, 0, clc$keyword_type], [6], [
    ['E                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['EXCEL                          ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['L                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['LD                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['LEGIBLE_DATA                   ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['LIST                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
    ,
    'list'],
{ PARAMETER 4
    [[1, 0, clc$boolean_type],
    'false'],
{ PARAMETER 5
    [[1, 0, clc$boolean_type],
    'true'],
{ PARAMETER 6
    [[1, 0, clc$status_type]]];

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

    CONST
      p$input = 1,
      p$output = 2,
      p$display_format = 3,
      p$summarize_defined_data = 4,
      p$display_report_header = 5,
      p$status = 6;

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

    VAR
      input_log_p: ^log_file,
      length_errors: boolean,
      put_entry_p: ^put_entry,
      put_number: 1..clc$max_integer;

?? NEWTITLE := 'check_generate_report', EJECT ??

    PROCEDURE check_generate_report
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      VAR
        input_file_list: ^clt$data_value,
        input_log_list_p: ^clt$data_value;

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$input =
          report_duplicate_name (pvt [p$input].value, 'INPUT', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
{ A  variable 'input_file_list' is assigned the value of pvt [p$input].value
{ and passed as first parameter to the 'process_input_parameter' procedure
{ instead of 'pvt [p$input].value', because the 'process_input_parameter'
{ modifies the value of the first parameter.
          input_file_list := pvt [p$input].value;
          process_input_parameter (input_file_list, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;

        = p$display_format =
          IF ptv$headers_specified AND NOT (pvt[p$display_format].value^.keyword_value = 'LIST') THEN
            osp$set_status_condition (pte$headers_and_not_list, status);
          IFEND;

        ELSE
        CASEND;

      ELSEIF NOT pvt [p$input].specified THEN
        IF ptv$default_input_log_list_p = NIL THEN
          osp$set_status_condition (pte$no_input_logs, status);
        ELSE
          input_log_list_p := ptv$default_input_log_list_p;
          process_input_parameter (input_log_list_p, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        IFEND;
      IFEND;

    PROCEND check_generate_report;

?? OLDTITLE ??
?? NEWTITLE := 'condition_handler', EJECT ??

{ PURPOSE
{   This procedure handles interactive conditions.

{ DESIGN
{   This procedure will close the ptv$output_file

    PROCEDURE condition_handler
      (    condition: pmt$condition;
           condition_descriptor: ^pmt$condition_information;
           save_area: ^ost$stack_frame_save_area;
       VAR handler_status: ost$status);

      VAR
        ignore_status: ost$status;

      IF condition.selector = pmc$block_exit_processing THEN
        cyp$close_file (ptv$output_file, cyc$default_open_position, ignore_status);
      ELSE
        osp$set_status_from_condition ('PT', condition, save_area, status, ignore_status);
        pmp$continue_to_cause (pmc$execute_standard_procedure, handler_status);
        status.normal := TRUE;
      IFEND;

    PROCEND condition_handler;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

    clp$get_reason_for_call (ptv$information_request, ptv$display_file, ptv$prompting_activted, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    IF NOT ptv$information_request THEN
      CASE ptv$generate OF
      = report =
      = log =
        clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
        osp$set_status_condition (pte$generate_log_mode, status);
        RETURN; {----->
      = none =
        clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
        osp$set_status_condition (pte$generate_none_mode, status);
        RETURN; {----->
      ELSE
      CASEND;
    IFEND;

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

    ptv$display_report_header := pvt [p$display_report_header].value^.boolean_value.value;

    ptv$excel := FALSE;
    IF pvt [p$display_format].value^.keyword_value = 'LEGIBLE_DATA' THEN
      ptv$display_format := legible_data;
    ELSEIF pvt [p$display_format].value^.keyword_value = 'EXCEL' THEN
      ptv$display_format := legible_data;
      ptv$excel := TRUE;
    ELSE
      ptv$display_format := list;
    IFEND;

    open_report_file (pvt [p$output].value^.file_value^, ptv$display_format, ptv$output_file,
          ptv$maximum_line_length, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    put_number := 1;
    length_errors := FALSE;
    put_entry_p := ptv$report_entry_chain_head_p;
    WHILE put_entry_p <> NIL DO
      IF put_entry_p^.max_used_column > ptv$maximum_line_length THEN
        IF length_errors THEN
          osp$append_status_integer (osc$status_parameter_delimiter, put_number, 10, FALSE, status);
        ELSE
          length_errors := TRUE;
          osp$set_status_abnormal (ptc$analyze_binary_log_id, pte$put_length_gt_page_width, '', status);
        IFEND;
      IFEND;
      put_entry_p := put_entry_p^.put_chain_link_p;
      put_number := put_number + 1;
    WHILEND;
    IF length_errors THEN
      RETURN; {----->
    IFEND;

    osp$establish_condition_handler (^condition_handler, TRUE);

    reset_data_collection;
    set_shadow_fields (status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    set_report_information;
    initialize_selection_values;

    IF ptv$display_format = list THEN
{ Sequence pointer reset by reset_data_collection.
      NEXT ptv$page_header_list_head_p IN ptv$data_segment_p.sequence_pointer;
      ptv$page_header_list_tail_p := ptv$page_header_list_head_p;
      ptv$page_header_list_tail_p^.fwd_p := NIL;
      ptv$page_header_list_tail_p^.bkw_p := NIL;
      ptv$page_header_list_tail_p^.default_header := TRUE;
      ptv$page_header_list_tail_p^.header_string := '';

    IFEND;

    input_log_p := ptv$input_log_chain_head_p;
    WHILE input_log_p <> NIL DO
      scan_log_genr (input_log_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      input_log_p := input_log_p^.log_chain_link_p;
    WHILEND;

    compute_summary (status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    print_report (status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    cyp$close_file (ptv$output_file, cyc$default_open_position, status);
    osp$disestablish_cond_handler;

  PROCEND generate_report_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'generate_log_cmd', EJECT ??

{ This procedure processes the generate_log command.

*copyc pth$anabl_generate_log

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

{   PROCEDURE (ptm$anabl_genl) generate_log, genl (
{   input, i: (CHECK) list of file = $optional
{   output, o: file = $required
{   display_format, df: key
{       (list, l)
{       (legible_data, ld)
{       (binary, b)
{     keyend = legible_data
{   counter_format, cf: key
{       (fixed, f)
{       (variable, unfixed, uf, v)
{     keyend = variable
{   number_of_counters, noc: any of
{       key
{         all
{       keyend
{       integer 0..sfc$max_number_of_counters
{     anyend = all
{   descriptive_data_length, ddl: any of
{       key
{         all
{       keyend
{       integer 0..sfc$max_descriptive_data_size
{     anyend = all
{   sort_key, sk: (HIDDEN) key
{       (statistic, s)
{       (time, t)
{     keyend = time
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 15] of clt$pdt_parameter_name,
      parameters: array [1 .. 8] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
        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 (12),
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 6] of clt$keyword_specification,
        default_value: string (8),
      recend,
      type5: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (3),
      recend,
      type6: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (3),
      recend,
      type7: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
        default_value: string (4),
      recend,
      type8: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 28, 12, 34, 49, 18],
    clc$command, 15, 8, 1, 0, 1, 0, 8, 'PTM$ANABL_GENL'], [
    ['CF                             ',clc$abbreviation_entry, 4],
    ['COUNTER_FORMAT                 ',clc$nominal_entry, 4],
    ['DDL                            ',clc$abbreviation_entry, 6],
    ['DESCRIPTIVE_DATA_LENGTH        ',clc$nominal_entry, 6],
    ['DF                             ',clc$abbreviation_entry, 3],
    ['DISPLAY_FORMAT                 ',clc$nominal_entry, 3],
    ['I                              ',clc$abbreviation_entry, 1],
    ['INPUT                          ',clc$nominal_entry, 1],
    ['NOC                            ',clc$abbreviation_entry, 5],
    ['NUMBER_OF_COUNTERS             ',clc$nominal_entry, 5],
    ['O                              ',clc$abbreviation_entry, 2],
    ['OUTPUT                         ',clc$nominal_entry, 2],
    ['SK                             ',clc$abbreviation_entry, 7],
    ['SORT_KEY                       ',clc$nominal_entry, 7],
    ['STATUS                         ',clc$nominal_entry, 8]],
    [
{ 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$extended_parameter_checking, 19, clc$optional_parameter,
  0, 0],
{ PARAMETER 2
    [12, 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
    [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, 229,
  clc$optional_default_parameter, 0, 12],
{ 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, 229,
  clc$optional_default_parameter, 0, 8],
{ PARAMETER 5
    [10, 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, 84,
  clc$optional_default_parameter, 0, 3],
{ PARAMETER 6
    [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, 84,
  clc$optional_default_parameter, 0, 3],
{ PARAMETER 7
    [14, clc$hidden_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 8
    [15, 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$list_type], [3, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$file_type]]
    ],
{ PARAMETER 2
    [[1, 0, clc$file_type]],
{ PARAMETER 3
    [[1, 0, clc$keyword_type], [6], [
    ['B                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['BINARY                         ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['L                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['LD                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['LEGIBLE_DATA                   ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['LIST                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
    ,
    'legible_data'],
{ PARAMETER 4
    [[1, 0, clc$keyword_type], [6], [
    ['F                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['FIXED                          ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['UF                             ', clc$alias_entry, clc$normal_usage_entry, 2],
    ['UNFIXED                        ', clc$alias_entry, clc$normal_usage_entry, 2],
    ['V                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['VARIABLE                       ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ,
    'variable'],
{ PARAMETER 5
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [0, sfc$max_number_of_counters, 10]]
    ,
    'all'],
{ PARAMETER 6
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [0, sfc$max_descriptive_data_size, 10]]
    ,
    'all'],
{ PARAMETER 7
    [[1, 0, clc$keyword_type], [4], [
    ['S                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['STATISTIC                      ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['T                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['TIME                           ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ,
    'time'],
{ PARAMETER 8
    [[1, 0, clc$status_type]]];

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

    CONST
      p$input = 1,
      p$output = 2,
      p$display_format = 3,
      p$counter_format = 4,
      p$number_of_counters = 5,
      p$descriptive_data_length = 6,
      p$sort_key = 7,
      p$status = 8;

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

    VAR
      access_information: [STATIC] array [1 .. 1] of amt$access_info := [
            {} [ * { item_returned } , amc$previous_record_address { key } , * { previous_record_address } ]],
      file_attributes: array [1 .. 1] of amt$get_item,
      local_file: boolean,
      contains_data: boolean,
      old_file: boolean,
      ignore_status: ost$status,
      input_log_p: ^log_file,
      sort_key: (statistic, time);

?? NEWTITLE := 'check_generate_log', EJECT ??

    PROCEDURE check_generate_log
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      VAR
        input_file_list: ^clt$data_value,
        input_log_list_p: ^clt$data_value;

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$input =
          report_duplicate_name (pvt [p$input].value, 'INPUT', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
{ A  variable 'input_file_list' is assigned the value of pvt [p$input].value
{ and passed as first parameter to the 'process_input_parameter' procedure
{ instead of 'pvt [p$input].value', because the 'process_input_parameter'
{ modifies the value of the first parameter.
          input_file_list := pvt [p$input].value;
          process_input_parameter (input_file_list, status);
        ELSE
        CASEND;
      ELSEIF NOT pvt [p$input].specified THEN
        IF ptv$default_input_log_list_p = NIL THEN
          osp$set_status_condition (pte$no_input_logs, status);
        ELSE
          input_log_list_p := ptv$default_input_log_list_p;
          process_input_parameter (input_log_list_p, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        IFEND;
      IFEND;

    PROCEND check_generate_log;

?? OLDTITLE ??
?? NEWTITLE := 'condition_handler', EJECT ??

{ PURPOSE
{   This procedure handles interactive conditions.

{ DESIGN
{   This procedure will close the ptv$output_file

    PROCEDURE condition_handler
      (    condition: pmt$condition;
           condition_descriptor: ^pmt$condition_information;
           save_area: ^ost$stack_frame_save_area;
       VAR handler_status: ost$status);

      VAR
        ignore_status: ost$status;

      IF condition.selector = pmc$block_exit_processing THEN
        CASE ptv$display_format OF
        = legible_data, list =
          cyp$close_file (ptv$output_file, cyc$default_open_position, ignore_status);
        = binary =
          amp$set_segment_eoi (ptv$output_log_p^.file_identifier, ptv$end_of_segment, ignore_status);
          fsp$close_file (ptv$output_log_p^.file_identifier, ignore_status);
        ELSE
        CASEND;
        osp$set_status_from_condition ('PT', condition, save_area, status, ignore_status);
      ELSE
        osp$set_status_from_condition ('PT', condition, save_area, status, ignore_status);
        pmp$continue_to_cause (pmc$execute_standard_procedure, handler_status);
        status.normal := TRUE;
      IFEND;

    PROCEND condition_handler;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

    clp$get_reason_for_call (ptv$information_request, ptv$display_file, ptv$prompting_activted, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    IF NOT ptv$information_request THEN
      CASE ptv$generate OF
      = report =
        clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
        osp$set_status_condition (pte$generate_report_mode, status);
        RETURN; {----->
      = log =
      = none =
        clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
        osp$set_status_condition (pte$generate_none_mode, status);
        RETURN; {----->
      ELSE
      CASEND;
    IFEND;

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

{ counter_format

    IF pvt [p$counter_format].value^.keyword_value = 'FIXED' THEN
      ptv$number_of_counters.fixed_format := TRUE;
    ELSE
      ptv$number_of_counters.fixed_format := FALSE;
    IFEND;

{ number_of_counters

    IF pvt [p$number_of_counters].value^.kind = clc$integer THEN
      ptv$number_of_counters.float := FALSE;
      ptv$number_of_counters.number := pvt [p$number_of_counters].value^.integer_value.value;
    ELSE { clc$keyword }
      ptv$number_of_counters.float := TRUE;
    IFEND;

{ descriptive_data_length

    IF pvt [p$descriptive_data_length].value^.kind = clc$integer THEN
      ptv$descriptive_data_size.float := FALSE;
      ptv$descriptive_data_size.number := pvt [p$descriptive_data_length].value^.integer_value.value;
    ELSE { clc$keyword }
      ptv$descriptive_data_size.float := TRUE;
    IFEND;

{ sort_key

    IF pvt [p$sort_key].value^.keyword_value = 'STATISTIC' THEN
      sort_key := statistic;
    ELSE
      sort_key := time;
    IFEND;

{ The following calls get the output format, output file name and opens the output file.

{ display_format

    IF pvt [p$display_format].value^.keyword_value = 'LEGIBLE_DATA' THEN
      ptv$display_format := legible_data;
    ELSEIF pvt [p$display_format].value^.keyword_value = 'LIST' THEN
      ptv$display_format := list;
    ELSE
      ptv$display_format := binary;
    IFEND;

    CASE ptv$display_format OF
    = legible_data, list =

      open_report_file (pvt [p$output].value^.file_value^, ptv$display_format, ptv$output_file,
            ptv$maximum_line_length, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      IF ptv$display_format = list THEN
        set_counter_length;
{ Sequence pointer reset by reset_data_collection.
        NEXT ptv$page_header_list_head_p IN ptv$data_segment_p.sequence_pointer;
        ptv$page_header_list_tail_p := ptv$page_header_list_head_p;
        ptv$page_header_list_tail_p^.fwd_p := NIL;
        ptv$page_header_list_tail_p^.bkw_p := NIL;
        ptv$page_header_list_tail_p^.default_header := TRUE;
        ptv$page_header_list_tail_p^.header_string := '';
      IFEND;

    = binary =
      ALLOCATE ptv$output_log_p: [#SIZE (pvt [p$output].value^.file_value^)];
      ptv$output_log_p^.log_file_name := pvt [p$output].value^.file_value^;
      open_log_file (ptv$output_log_p, TRUE, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      ptv$end_of_segment := ptv$output_log_p^.segment_pointer;
      amp$fetch_access_information (ptv$output_log_p^.file_identifier, access_information, status);
      IF NOT status.normal THEN
        fsp$close_file (ptv$output_log_p^.file_identifier, ignore_status);
        RETURN; {----->
      IFEND;
      ptv$previous_header_fba := access_information [1].previous_record_address;
    ELSE
    CASEND;
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    osp$establish_condition_handler (^condition_handler, TRUE);

    input_log_p := ptv$input_log_chain_head_p;
    WHILE input_log_p <> NIL DO

      CASE ptv$display_format OF

      = legible_data =
        scan_log_genl (input_log_p, ^write_statistic_to_legible_log, status);

      = list =
        cyp$put_next_line (ptv$output_file, ' ', status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        STRINGREP (ptv$output_line, ptv$output_line_length, 'Log scanned: ', input_log_p^.log_file_name);
        cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        scan_log_genl (input_log_p, ^write_statistic_to_list_log, status);

      = binary =
        scan_log_genl (input_log_p, ^write_statistic_to_binary_log, status);

      ELSE
      CASEND;
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      input_log_p := input_log_p^.log_chain_link_p;
    WHILEND;

    CASE ptv$display_format OF
    = legible_data, list =
      cyp$close_file (ptv$output_file, cyc$default_open_position, status);
    = binary =
      amp$set_segment_eoi (ptv$output_log_p^.file_identifier, ptv$output_log_p^.segment_pointer, status);
      fsp$close_file (ptv$output_log_p^.file_identifier, status);
    ELSE
    CASEND;
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    osp$disestablish_cond_handler;

  PROCEND generate_log_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'change_defaults_cmd', EJECT ??

{ This procedure processes the change_defaults command.

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

{      PROCEDURE (ptm$anabl_chad) change_defaults, chad (
{      counter_fraction, cf: any of
{          key
{            default
{          keyend
{          integer 0..clc$max_integer
{        anyend = $optional
{      date_time_format, dtf: any of
{          key
{            default
{          keyend
{          string
{        anyend = $optional
{      input_log, log, il, l: (CHECK) any of
{          key
{            unspecified
{          keyend
{          list of file
{        anyend = $optional
{      legible_data_max_page_width, ldmpw: any of
{          key
{            default
{          keyend
{          integer 1..ptc$max_page_width
{        anyend = $optional
{      list_max_page_width, lmpw: any of
{          key
{            default
{          keyend
{          integer 1..ptc$max_page_width
{        anyend = $optional
{      time_increment_format, tif: key
{          (seconds s)
{          (time_increment, ti)
{          default
{        keyend = $optional
{      status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 15] of clt$pdt_parameter_name,
      parameters: array [1 .. 7] 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      type2: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
      recend,
      type3: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        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,
      type4: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      type5: 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,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      type6: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 5] of clt$keyword_specification,
      recend,
      type7: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 27, 13, 2, 27, 522],
    clc$command, 15, 7, 0, 0, 0, 0, 7, 'PTM$ANABL_CHAD'], [
    ['CF                             ',clc$abbreviation_entry, 1],
    ['COUNTER_FRACTION               ',clc$nominal_entry, 1],
    ['DATE_TIME_FORMAT               ',clc$nominal_entry, 2],
    ['DTF                            ',clc$abbreviation_entry, 2],
    ['IL                             ',clc$alias_entry, 3],
    ['INPUT_LOG                      ',clc$nominal_entry, 3],
    ['L                              ',clc$abbreviation_entry, 3],
    ['LDMPW                          ',clc$abbreviation_entry, 4],
    ['LEGIBLE_DATA_MAX_PAGE_WIDTH    ',clc$nominal_entry, 4],
    ['LIST_MAX_PAGE_WIDTH            ',clc$nominal_entry, 5],
    ['LMPW                           ',clc$abbreviation_entry, 5],
    ['LOG                            ',clc$alias_entry, 3],
    ['STATUS                         ',clc$nominal_entry, 7],
    ['TIF                            ',clc$abbreviation_entry, 6],
    ['TIME_INCREMENT_FORMAT          ',clc$nominal_entry, 6]],
    [
{ 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, 84, clc$optional_parameter,
  0, 0],
{ PARAMETER 2
    [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, 72, clc$optional_parameter,
  0, 0],
{ PARAMETER 3
    [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$extended_parameter_checking, 83, clc$optional_parameter,
  0, 0],
{ PARAMETER 4
    [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, 84, clc$optional_parameter,
  0, 0],
{ PARAMETER 5
    [10, 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, 84, clc$optional_parameter,
  0, 0],
{ PARAMETER 6
    [15, 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, 192,
  clc$optional_parameter, 0, 0],
{ PARAMETER 7
    [13, 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$integer_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['DEFAULT                        ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [0, clc$max_integer, 10]]
    ],
{ PARAMETER 2
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$string_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['DEFAULT                        ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    8, [[1, 0, clc$string_type], [0, clc$max_string_size, FALSE]]
    ],
{ PARAMETER 3
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['UNSPECIFIED                    ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    19, [[1, 0, clc$list_type], [3, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$file_type]]
      ]
    ],
{ PARAMETER 4
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['DEFAULT                        ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [1, ptc$max_page_width, 10]]
    ],
{ PARAMETER 5
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['DEFAULT                        ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [1, ptc$max_page_width, 10]]
    ],
{ PARAMETER 6
    [[1, 0, clc$keyword_type], [5], [
    ['DEFAULT                        ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['S                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['SECONDS                        ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['TI                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['TIME_INCREMENT                 ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ],
{ PARAMETER 7
    [[1, 0, clc$status_type]]];

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

    CONST
      p$counter_fraction = 1,
      p$date_time_format = 2,
      p$input_log = 3,
      p$legible_data_max_page_width = 4,
      p$list_max_page_width = 5,
      p$time_increment_format = 6,
      p$status = 7;

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

    VAR
      input_data_value_p: ^clt$data_value,
      save_data_value_p: ^clt$data_value,
      input_log_p: ^clt$data_value,
      next_input_log_p: ^clt$data_value;

?? NEWTITLE := 'check_change_defaults', EJECT ??

    PROCEDURE check_change_defaults
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$input_log =
          IF pvt [p$input_log].value^.kind <> clc$keyword THEN
{  Must be a list of files.
            report_duplicate_name (pvt [p$input_log].value, 'INPUT', status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
          IFEND;
        ELSE
        CASEND;
      IFEND;

    PROCEND check_change_defaults;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;

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

{  Counter fraction

   IF pvt [p$counter_fraction].specified THEN
     IF pvt [p$counter_fraction].value^.kind = clc$keyword THEN
{  Only keyword is default
       ptv$counter_fraction := ptc$default_counter_fraction;
     ELSE
       ptv$counter_fraction := pvt [p$counter_fraction].value^.integer_value.value;
     IFEND;
   IFEND;

{  Date time format

   IF pvt [p$date_time_format].specified THEN
     IF pvt [p$date_time_format].value^.kind = clc$keyword THEN
{  Only keyword is default
       ptv$date_time_format := ptc$default_date_time_format;
     ELSE
       ptv$date_time_format := pvt [p$date_time_format].value^.string_value^;
     IFEND;
   IFEND;

{  Input Log

   IF pvt [p$input_log].specified THEN

{    FREE all input logs in list for all specified values of input_log

     input_log_p := ptv$default_input_log_list_p;
     ptv$default_input_log_list_p := NIL;
     WHILE input_log_p <> NIL DO
       next_input_log_p := input_log_p^.link;
       FREE input_log_p^.element_value^.file_value;
       FREE input_log_p^.element_value;
       FREE input_log_p;
       input_log_p := next_input_log_p;
     WHILEND;

     IF pvt [p$input_log].value^.kind <> clc$keyword THEN

{  Only keyword is 'UNSPECIFIED'.
{  If not 'UNSPECIFIED', then copy input list of logs to saved list of logs.

       IF pvt [p$input_log].value <> NIL THEN
{  ALLOCATE first input_log file entry
         ALLOCATE ptv$default_input_log_list_p;
         ptv$default_input_log_list_p^ := pvt [p$input_log].value^;
         ptv$default_input_log_list_p^.link := NIL;
         ALLOCATE ptv$default_input_log_list_p^.element_value;
         ptv$default_input_log_list_p^.element_value^ := pvt [p$input_log].value^.element_value^;
         ALLOCATE ptv$default_input_log_list_p^.element_value^.file_value:
             [#SIZE (pvt [p$input_log].value^.element_value^.file_value^)];
         ptv$default_input_log_list_p^.element_value^.file_value^ :=
               pvt [p$input_log].value^.element_value^.file_value^;
       IFEND;
{  Point to second input_log file entry, if there is one
       input_data_value_p := pvt [p$input_log].value^.link;
{  Point to first saved input_log file entry
       save_data_value_p := ptv$default_input_log_list_p;
       WHILE input_data_value_p <> NIL DO
{  ALLOCATE next saved input_log file entry
         ALLOCATE save_data_value_p^.link;
         save_data_value_p := save_data_value_p^.link;
         save_data_value_p^ := input_data_value_p^;
         ALLOCATE save_data_value_p^.element_value;
         save_data_value_p^.element_value^ := input_data_value_p^.element_value^;
         ALLOCATE save_data_value_p^.element_value^.file_value:
             [#SIZE (input_data_value_p^.element_value^.file_value^)];
         save_data_value_p^.element_value^.file_value^ :=
               input_data_value_p^.element_value^.file_value^;
         input_data_value_p := input_data_value_p^.link;
       WHILEND;

     IFEND;
   IFEND;

{  Legible Data Max Page Width

   IF pvt [p$legible_data_max_page_width].specified THEN
     IF pvt [p$legible_data_max_page_width].value^.kind = clc$keyword THEN
{  Only keyword is default
       ptv$legible_data_max_page_width := ptc$max_page_width;
     ELSE
       ptv$legible_data_max_page_width := pvt [p$legible_data_max_page_width].value^.integer_value.value;
     IFEND;
   IFEND;

{  List Max Page Width

   IF pvt [p$list_max_page_width].specified THEN
     IF pvt [p$list_max_page_width].value^.kind = clc$keyword THEN
{  Only keyword is default
       ptv$list_max_page_width := cyc$wide_page_width;
     ELSE
       ptv$list_max_page_width := pvt [p$list_max_page_width].value^.integer_value.value;
     IFEND;
   IFEND;

{  Time Increment format

   IF pvt [p$time_increment_format].specified THEN
     IF pvt [p$time_increment_format].value^.keyword_value = ptc$key_default THEN
       ptv$time_increment_format := ptc$default_time_inc_format;
     ELSE
       ptv$time_increment_format := pvt [p$time_increment_format].value^.keyword_value;
     IFEND;
   IFEND;

  PROCEND change_defaults_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'display_defaults_cmd', EJECT ??

{ This procedure processes the display_defaults command.

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

{      PROCEDURE (ptm$anabl_disd) display_defaults, disd (
{      display_option, do: list of key
{        (counter_fraction, cf)
{        (date_time_format, dtf)
{        (input_log, log, il, l)
{        (legible_data_max_page_width, ldmpw)
{        (list_max_page_width, lmpw)
{        (time_increment_format, tif)
{        all
{      keyend = all
{      output, o: file = $output
{      status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 5] of clt$pdt_parameter_name,
      parameters: array [1 .. 3] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 15] of clt$keyword_specification,
        recend,
        default_value: string (3),
      recend,
      type2: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 27, 13, 3, 21, 910],
    clc$command, 5, 3, 0, 0, 0, 0, 3, 'PTM$ANABL_DISD'], [
    ['DISPLAY_OPTION                 ',clc$nominal_entry, 1],
    ['DO                             ',clc$abbreviation_entry, 1],
    ['O                              ',clc$abbreviation_entry, 2],
    ['OUTPUT                         ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 3]],
    [
{ PARAMETER 1
    [1, 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, 578,
  clc$optional_default_parameter, 0, 3],
{ 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$optional_default_parameter, 0, 7],
{ PARAMETER 3
    [5, 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$list_type], [562, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$keyword_type], [15], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 7],
      ['CF                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['COUNTER_FRACTION               ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['DATE_TIME_FORMAT               ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['DTF                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['IL                             ', clc$alias_entry, clc$normal_usage_entry, 3],
      ['INPUT_LOG                      ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['L                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['LDMPW                          ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['LEGIBLE_DATA_MAX_PAGE_WIDTH    ', clc$nominal_entry, clc$normal_usage_entry, 4],
      ['LIST_MAX_PAGE_WIDTH            ', clc$nominal_entry, clc$normal_usage_entry, 5],
      ['LMPW                           ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
      ['LOG                            ', clc$alias_entry, clc$normal_usage_entry, 3],
      ['TIF                            ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
      ['TIME_INCREMENT_FORMAT          ', clc$nominal_entry, clc$normal_usage_entry, 6]]
      ]
    ,
    'all'],
{ PARAMETER 2
    [[1, 0, clc$file_type],
    '$output'],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];

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

    CONST
      p$display_option = 1,
      p$output = 2,
      p$status = 3;

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

      VAR
        date_time_string_length: integer,
        input_log_p: ^clt$data_value,
        value_p: ^clt$data_value;

    status.normal := TRUE;


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

{ Open output file.

    cyp$open_file (pvt [p$output].value^.file_value^, ^ptv$display_file_specifications, ptv$output_file,
          status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;
    ptv$maximum_line_length := cyp$page_width (ptv$output_file);
    IF ptv$maximum_line_length > 132 THEN
      ptv$maximum_line_length := 132;
    IFEND;

{  Put Label

    cyp$put_next_line (ptv$output_file, ' ANABL Default Values: ', status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    value_p := pvt [p$display_option].value;
    WHILE value_p <> NIL DO

{  Counter Fraction
      IF (value_p^.element_value^.keyword_value = 'ALL') OR
         (value_p^.element_value^.keyword_value = 'COUNTER_FRACTION') THEN
        STRINGREP (ptv$output_line, ptv$output_line_length, '         Counter Fraction : ',
              ptv$counter_fraction);
        cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
      IFEND;

{  Date Time Format
      IF (value_p^.element_value^.keyword_value = 'ALL') OR
         (value_p^.element_value^.keyword_value = 'DATE_TIME_FORMAT') THEN
        date_time_string_length := clp$trimmed_string_size (ptv$date_time_format);
        STRINGREP (ptv$output_line, ptv$output_line_length, '         Date Time Format : ',
              ptv$date_time_format(1, date_time_string_length));
        cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
      IFEND;

{  Legible Data Max Page Width
      IF (value_p^.element_value^.keyword_value = 'ALL') OR
         (value_p^.element_value^.keyword_value = 'LEGIBLE_DATA_MAX_PAGE_WIDTH') THEN
        STRINGREP (ptv$output_line, ptv$output_line_length, '    Legible data max page width : ',
              ptv$legible_data_max_page_width);
        cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
      IFEND;

{  List Max Page Width
      IF (value_p^.element_value^.keyword_value = 'ALL') OR
         (value_p^.element_value^.keyword_value = 'LIST_MAX_PAGE_WIDTH') THEN
        STRINGREP (ptv$output_line, ptv$output_line_length, '    List max page width : ',
              ptv$list_max_page_width);
        cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
      IFEND;

{  Time Increment Format
      IF (value_p^.element_value^.keyword_value = 'ALL') OR
         (value_p^.element_value^.keyword_value = 'TIME_INCREMENT_FORMAT') THEN
        STRINGREP (ptv$output_line, ptv$output_line_length, '    Time Increment Format : ',
              ptv$time_increment_format);
        cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
      IFEND;

{  Input Log list
      IF (value_p^.element_value^.keyword_value = 'ALL') OR
         (value_p^.element_value^.keyword_value = 'INPUT_LOG') THEN
        IF ptv$default_input_log_list_p = NIL THEN
          cyp$put_next_line (ptv$output_file,'    Input Log List        : UNSPECIFIED' , status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        ELSE
          cyp$put_next_line (ptv$output_file,'    Input Log List        : ' , status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          input_log_p := ptv$default_input_log_list_p;
          WHILE input_log_p <> NIL DO
            cyp$put_next_line (ptv$output_file, input_log_p^.element_value^.file_value^, status);
            IF NOT status.normal THEN
              RETURN; {----->
            IFEND;
            input_log_p := input_log_p^.link;
          WHILEND;
        IFEND;
      IFEND;

{  Max Report Page Width
{     IF (value_p^.element_value^.keyword_value = 'ALL') OR
{        (value_p^.element_value^.keyword_value = 'MAX_REPORT_PAGE_WIDTH') THEN
{       STRINGREP (ptv$output_line, ptv$output_line_length, '    Max Report Page Width : ',
{             ptv$max_report_page_width);
{       cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
{       IF NOT status.normal THEN
{         RETURN; {----->
{       IFEND;
{     IFEND;

      value_p := value_p^.link;
    WHILEND;

{  Close output file

    cyp$close_file (ptv$output_file, cyc$default_open_position, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

  PROCEND display_defaults_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'display_logged_statistics_cmd', EJECT ??

{ This procedure processes the  DISPLAY_LOGGED_STATISTICS  command.

*copyc pth$anabl_display_logged_stat

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

{   PROCEDURE (ptm$anabl_disls) display_logged_statistics, disls (
{   input, i: (CHECK) list of file = $optional
{   output, o: file = $output
{   display_option, do: key
{       (name, names, n)
{       all
{     keyend = names
{   status)

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

  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,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
        default_value: string (5),
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 28, 12, 39, 23, 74],
    clc$command, 7, 4, 0, 0, 0, 0, 4, 'PTM$ANABL_DISLS'], [
    ['DISPLAY_OPTION                 ',clc$nominal_entry, 3],
    ['DO                             ',clc$abbreviation_entry, 3],
    ['I                              ',clc$abbreviation_entry, 1],
    ['INPUT                          ',clc$nominal_entry, 1],
    ['O                              ',clc$abbreviation_entry, 2],
    ['OUTPUT                         ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 4]],
    [
{ 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$extended_parameter_checking, 19, clc$optional_parameter,
  0, 0],
{ PARAMETER 2
    [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, 3,
  clc$optional_default_parameter, 0, 7],
{ PARAMETER 3
    [1, 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, 5],
{ 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$list_type], [3, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$file_type]]
    ],
{ PARAMETER 2
    [[1, 0, clc$file_type],
    '$output'],
{ PARAMETER 3
    [[1, 0, clc$keyword_type], [4], [
    ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['NAME                           ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['NAMES                          ', clc$alias_entry, clc$normal_usage_entry, 1]]
    ,
    'names'],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

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

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

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

    CONST
      full_header_1 = 'statistic    number of    first occurrence      last occurrence',
      full_header_2 = '  code      occurrences    date       time      date       time',
      header_1 = 'statistic',
      header_2 = '  code';

    VAR
      date_time_string_1: ost$string,
      date_time_string_2: ost$string,
      found: boolean,
      full: boolean,
      input_log_p: ^log_file,
      logged_statistic_chain_tail: ^logged_statistic,
      logged_statistic_1_p: ^logged_statistic,
      logged_statistic_2_p: ^logged_statistic,
      page_length: integer,
      statistic_name: ost$name;

?? NEWTITLE := 'check_display_logged_stat', EJECT ??

    PROCEDURE check_display_logged_stat
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      VAR
        input_file_list: ^clt$data_value,
        input_log_list_p: ^clt$data_value;

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$input =
          report_duplicate_name (pvt [p$input].value, 'INPUT', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
{ A  variable 'input_file_list' is assigned the value of pvt [p$input].value
{ and passed as first parameter to the 'process_input_parameter' procedure
{ instead of 'pvt [p$input].value', because the 'process_input_parameter'
{ modifies the value of the first parameter.
          input_file_list := pvt [p$input].value;
          process_input_parameter (input_file_list, status);
        ELSE
        CASEND;
      ELSEIF NOT pvt [p$input].specified THEN
        IF ptv$default_input_log_list_p = NIL THEN
          osp$set_status_condition (pte$no_input_logs, status);
        ELSE
          input_log_list_p := ptv$default_input_log_list_p;
          process_input_parameter (input_log_list_p, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        IFEND;
      IFEND;

    PROCEND check_display_logged_stat;

?? OLDTITLE ??
?? NEWTITLE := 'condition_handler', EJECT ??

{ PURPOSE
{   This procedure handles interactive conditions.

{ DESIGN
{   This procedure will close the ptv$output_file

    PROCEDURE condition_handler
      (    condition: pmt$condition;
           condition_descriptor: ^pmt$condition_information;
           save_area: ^ost$stack_frame_save_area;
       VAR handler_status: ost$status);

      VAR
        ignore_status: ost$status;

      IF condition.selector = pmc$block_exit_processing THEN
        cyp$close_file (ptv$output_file, cyc$default_open_position, ignore_status);
      ELSE
        osp$set_status_from_condition ('PT', condition, save_area, status, ignore_status);
        pmp$continue_to_cause (pmc$execute_standard_procedure, handler_status);
        status.normal := TRUE;
      IFEND;

    PROCEND condition_handler;

?? OLDTITLE ??
?? NEWTITLE := 'display_new_page_header', EJECT ??

    PROCEDURE display_new_page_header
      (VAR status: ost$status);

      status.normal := TRUE;

      IF full THEN
        cyp$put_next_line (ptv$output_file, full_header_1, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        cyp$put_next_line (ptv$output_file, full_header_2, status);
      ELSE
        cyp$put_next_line (ptv$output_file, header_1, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        cyp$put_next_line (ptv$output_file, header_2, status);
      IFEND;
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

    PROCEND display_new_page_header;


?? OLDTITLE, EJECT ??

    status.normal := TRUE;
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), ^check_display_logged_stat, ^pvt, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

{ Opens output file.

    cyp$open_file (pvt [p$output].value^.file_value^, ^ptv$display_file_specifications, ptv$output_file,
          status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    osp$establish_condition_handler (^condition_handler, TRUE);

{ cyp$put_next_line (ptv$output_file, pvt [p$output].value^.file_value^, status);

    page_length := cyp$display_page_length (ptv$output_file);

    full := pvt [p$display_option].value^.keyword_value = 'ALL';

    IF ptv$logged_statistic_chain_head = NIL THEN
      input_log_p := ptv$input_log_chain_head_p;
      WHILE input_log_p <> NIL DO
        IF input_log_p^.statistics_list_p = NIL THEN
          scan_log_disls (input_log_p, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        IFEND;
        logged_statistic_1_p := input_log_p^.statistics_list_p;
        WHILE logged_statistic_1_p <> NIL DO
          logged_statistic_2_p := ptv$logged_statistic_chain_head;
          found := FALSE;
          WHILE (logged_statistic_2_p <> NIL) AND NOT found DO
            IF logged_statistic_1_p^.statistic_code = logged_statistic_2_p^.statistic_code THEN
              logged_statistic_2_p^.number_of_occurrences := logged_statistic_2_p^.number_of_occurrences +
                    logged_statistic_1_p^.number_of_occurrences;

              IF date_time_1_gt_date_time_2 (logged_statistic_2_p^.time_of_first_occurrences,
                    logged_statistic_1_p^.time_of_first_occurrences) THEN
                logged_statistic_2_p^.time_of_first_occurrences :=
                      logged_statistic_1_p^.time_of_first_occurrences;
              IFEND;
              IF date_time_1_gt_date_time_2 (logged_statistic_1_p^.time_of_last_occurrences,
                    logged_statistic_2_p^.time_of_last_occurrences) THEN
                logged_statistic_2_p^.time_of_last_occurrences :=
                      logged_statistic_1_p^.time_of_last_occurrences;
              IFEND;
              found := TRUE;
            IFEND;
            logged_statistic_2_p := logged_statistic_2_p^.link_p;
          WHILEND;
          IF NOT found THEN
            IF ptv$logged_statistic_chain_head = NIL THEN
              ALLOCATE ptv$logged_statistic_chain_head;
              logged_statistic_chain_tail := ptv$logged_statistic_chain_head;
            ELSE
              ALLOCATE logged_statistic_chain_tail^.link_p;
              logged_statistic_chain_tail := logged_statistic_chain_tail^.link_p;
            IFEND;
            logged_statistic_chain_tail^ := logged_statistic_1_p^;
            logged_statistic_chain_tail^.link_p := NIL;
          IFEND;
          logged_statistic_1_p := logged_statistic_1_p^.link_p;
        WHILEND;
        input_log_p := input_log_p^.log_chain_link_p;
      WHILEND;
    IFEND;

    IF ptv$logged_statistic_chain_head <> NIL THEN
      sort_list_by_statistic_code (ptv$logged_statistic_chain_head);
    IFEND;

    display_new_page_header (status);

{ STRINGREP (ptv$output_line, ptv$output_line_length,' ', cyp$file_connected_to_terminal(ptv$output_file));
{ cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);

    logged_statistic_1_p := ptv$logged_statistic_chain_head;
    WHILE logged_statistic_1_p <> NIL DO

{     IF not cyp$file_connected_to_terminal(ptv$output_file) THEN

      IF pvt [p$output].value^.file_value^ <> ':$LOCAL.$OUTPUT.1' THEN
        IF cyp$current_display_line (ptv$output_file) >= page_length THEN
          display_new_page_header (status);
        IFEND;
      IFEND;
      sfp$convert_stat_code_to_name (logged_statistic_1_p^.statistic_code, statistic_name, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      IF full THEN
        ptv$clt_date_time.value := logged_statistic_1_p^.time_of_first_occurrences;
        clp$convert_date_time_to_string (ptv$clt_date_time, ptv$date_time_format, date_time_string_1, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        ptv$clt_date_time.value := logged_statistic_1_p^.time_of_last_occurrences;
        clp$convert_date_time_to_string (ptv$clt_date_time, ptv$date_time_format, date_time_string_2, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        STRINGREP (ptv$output_line, ptv$output_line_length, ' ', statistic_name (1, 7), '    ',
              logged_statistic_1_p^.number_of_occurrences: 11, '  ', date_time_string_1.
              value (1, date_time_string_1.size): date_time_string_1.size, '  ', date_time_string_2.
              value (1, date_time_string_2.size): date_time_string_2.size);
      ELSE
        STRINGREP (ptv$output_line, ptv$output_line_length, ' ', statistic_name (1, 7));
      IFEND;
      cyp$put_next_line (ptv$output_file, ptv$output_line (1, ptv$output_line_length), status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      logged_statistic_1_p := logged_statistic_1_p^.link_p;
    WHILEND;

    cyp$close_file (ptv$output_file, cyc$default_open_position, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    osp$disestablish_cond_handler;

  PROCEND display_logged_statistics_cmd;

?? OLDTITLE ??
?? NEWTITLE := 'quit_cmd', EJECT ??

{ This procedure processes the QUIT command.  It ends the command file scan by the SCL interpreter and causes
{ ANALYZE_BINARY_LOG to terminate.

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

{ PROCEDURE (ptm$anabl_qui) quit, qui (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, 9, 29, 11, 25, 30, 154], clc$command, 1, 1, 0, 0, 0, 0, 1, 'PTM$ANABL_QUI'],
            [['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;

    status.normal := TRUE;
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    clp$end_include (ptc$utility_name, status);

  PROCEND quit_cmd;

?? OLDTITLE ??
?? OLDTITLE ??
?? NEWTITLE := 'P$$LOGGED_STATISTICS', EJECT ??

  PROCEDURE p$$logged_statistics
    (    parameter_list: clt$parameter_list;
     VAR work_area: ^clt$work_area;
     VAR result_p: ^clt$data_value;
     VAR status: ost$status);

{ FUNCTION $logged_statistics (
{   input: (CHECK) list of file = $optional
{   display_option: key
{       (code, codes, c)
{       all
{     keyend = code
{   )

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 2] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
        recend,
      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 (4),
      recend,
    recend := [
    [1,
    [103, 3, 5, 14, 20, 39, 535],
    clc$function, 2, 2, 0, 0, 0, 0, 0, ''], [
    ['DISPLAY_OPTION                 ',clc$nominal_entry, 2],
    ['INPUT                          ',clc$nominal_entry, 1]],
    [
{ PARAMETER 1
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$extended_parameter_checking, 19, clc$optional_parameter,
  0, 0],
{ PARAMETER 2
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,
  clc$optional_default_parameter, 0, 4]],
{ PARAMETER 1
    [[1, 0, clc$list_type], [3, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$file_type]]
    ],
{ PARAMETER 2
    [[1, 0, clc$keyword_type], [4], [
    ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['C                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['CODE                           ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['CODES                          ', clc$alias_entry, clc$normal_usage_entry, 1]]
    ,
    'code']];

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

    CONST
      p$input = 1,
      p$display_option = 2;

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

    VAR
      found: boolean,
      full: boolean,
      input_log_p: ^log_file,
      logged_statistic_chain_tail: ^logged_statistic,
      logged_statistic_1_p: ^logged_statistic,
      logged_statistic_2_p: ^logged_statistic,
      scl_list_p: ^clt$data_value,
      scl_list_pp: ^^clt$data_value,
      statistic_name: ost$name;

?? NEWTITLE := 'check_$logged_stat', EJECT ??

    PROCEDURE check_$logged_stat
      (    parameter_value_table: ^clt$parameter_value_table;
           which_parameter: clt$which_parameter;
       VAR status: ost$status);

      VAR
        input_file_list: ^clt$data_value,
        input_log_list_p: ^clt$data_value;

      status.normal := TRUE;

      IF which_parameter.specific THEN
        CASE which_parameter.number OF
        = p$input =
          report_duplicate_name (pvt [p$input].value, 'INPUT', status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
{ A  variable 'input_file_list' is assigned the value of pvt [p$input].value
{ and passed as first parameter to the 'process_input_parameter' procedure
{ instead of 'pvt [p$input].value', because the 'process_input_parameter'
{ modifies the value of the first parameter.
          input_file_list := pvt [p$input].value;
          process_input_parameter (input_file_list, status);
        ELSE
        CASEND;
      ELSEIF NOT pvt [p$input].specified THEN
        IF ptv$default_input_log_list_p = NIL THEN
          osp$set_status_condition (pte$no_input_logs, status);
        ELSE
          input_log_list_p := ptv$default_input_log_list_p;
          process_input_parameter (input_log_list_p, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        IFEND;
      IFEND;

    PROCEND check_$logged_stat;

?? OLDTITLE ??
?? NEWTITLE := '[inline, unsafe] F$MAKE_RANGE_VALUE', EJECT ??

    FUNCTION [INLINE, UNSAFE] f$make_range_value
      (    low_value_p:  ^clt$data_value;
           high_value_p:  ^clt$data_value;
       VAR work_area: ^clt$work_area): ^clt$data_value;

      VAR
        data_value: ^clt$data_value;

      NEXT data_value IN work_area;
      data_value^.kind := clc$range;
      data_value^.low_value := low_value_p;
      data_value^.high_value := high_value_p;
      f$make_range_value := data_value;

    FUNCEND f$make_range_value;
?? OLDTITLE ??
?? NEWTITLE := '[inline, unsafe] F$MAKE_STATISTIC_CODE_VALUE', EJECT ??

    FUNCTION [INLINE, UNSAFE] f$make_statistic_code_value
      (    statistic_code: sft$statistic_code;
       VAR work_area: ^clt$work_area): ^clt$data_value;

      VAR
        data_value: ^clt$data_value;

      NEXT data_value IN work_area;
      data_value^.kind := clc$statistic_code;
      data_value^.statistic_code_value := statistic_code;
      f$make_statistic_code_value := data_value;

    FUNCEND f$make_statistic_code_value;

?? OLDTITLE ??
?? NEWTITLE := '[inline, unsafe] F$MAKE_STATISTIC_ENTRY', EJECT ??

    FUNCTION [INLINE, UNSAFE] f$make_statistic_entry
      (    logged_statistic_value: logged_statistic;
       VAR work_area: ^clt$work_area): ^clt$data_value;

      VAR
        record_p: ^clt$data_value,
        record_index: 0 .. clc$max_fields;

      record_p := clf#make_record_header_value (3, work_area);
      record_index := 0;
      clp#add_record_field ('code',
          f$make_statistic_code_value (logged_statistic_value.statistic_code, work_area),
          record_index, record_p);

      clp#add_record_field ('count', clf#make_integer_value (logged_statistic_value.
            number_of_occurrences, work_area), record_index, record_p);

      clp#add_record_field ('occurence', f$make_range_value (
            clf#make_date_time_value (logged_statistic_value.time_of_first_occurrences, work_area),
            clf#make_date_time_value (logged_statistic_value.time_of_last_occurrences, work_area),
            work_area), record_index, record_p);

      f$make_statistic_entry := record_p;

    FUNCEND f$make_statistic_entry;

?? OLDTITLE ??
?? EJECT ??
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), ^check_$logged_stat, ^pvt, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    full := pvt [p$display_option].value^.keyword_value = 'ALL';
    scl_list_pp := ^scl_list_p;

    IF ptv$logged_statistic_chain_head = NIL THEN
      input_log_p := ptv$input_log_chain_head_p;
      WHILE input_log_p <> NIL DO
        IF input_log_p^.statistics_list_p = NIL THEN
          scan_log_disls (input_log_p, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
        IFEND;
        logged_statistic_1_p := input_log_p^.statistics_list_p;
        WHILE logged_statistic_1_p <> NIL DO
          logged_statistic_2_p := ptv$logged_statistic_chain_head;
          found := FALSE;
          WHILE (logged_statistic_2_p <> NIL) AND NOT found DO
            IF logged_statistic_1_p^.statistic_code = logged_statistic_2_p^.statistic_code THEN
              logged_statistic_2_p^.number_of_occurrences := logged_statistic_2_p^.number_of_occurrences +
                    logged_statistic_1_p^.number_of_occurrences;

              IF date_time_1_gt_date_time_2 (logged_statistic_2_p^.time_of_first_occurrences,
                    logged_statistic_1_p^.time_of_first_occurrences) THEN
                logged_statistic_2_p^.time_of_first_occurrences :=
                      logged_statistic_1_p^.time_of_first_occurrences;
              IFEND;
              IF date_time_1_gt_date_time_2 (logged_statistic_1_p^.time_of_last_occurrences,
                    logged_statistic_2_p^.time_of_last_occurrences) THEN
                logged_statistic_2_p^.time_of_last_occurrences :=
                      logged_statistic_1_p^.time_of_last_occurrences;
              IFEND;
              found := TRUE;
            IFEND;
            logged_statistic_2_p := logged_statistic_2_p^.link_p;
          WHILEND;
          IF NOT found THEN
            IF ptv$logged_statistic_chain_head = NIL THEN
              ALLOCATE ptv$logged_statistic_chain_head;
              logged_statistic_chain_tail := ptv$logged_statistic_chain_head;
            ELSE
              ALLOCATE logged_statistic_chain_tail^.link_p;
              logged_statistic_chain_tail := logged_statistic_chain_tail^.link_p;
            IFEND;
            logged_statistic_chain_tail^ := logged_statistic_1_p^;
            logged_statistic_chain_tail^.link_p := NIL;
          IFEND;
          logged_statistic_1_p := logged_statistic_1_p^.link_p;
        WHILEND;
        input_log_p := input_log_p^.log_chain_link_p;
      WHILEND;
    IFEND;

    IF ptv$logged_statistic_chain_head <> NIL THEN
      sort_list_by_statistic_code (ptv$logged_statistic_chain_head);
    IFEND;

    logged_statistic_1_p := ptv$logged_statistic_chain_head;

    WHILE logged_statistic_1_p <> NIL DO
      IF full THEN
        scl_list_pp^ := clf#make_list_value (f$make_statistic_entry (logged_statistic_1_p^, work_area),
              work_area);
        scl_list_pp := ^scl_list_pp^^.link;
      ELSE
        scl_list_pp^ := clf#make_list_value (f$make_statistic_code_value(logged_statistic_1_p^.
              statistic_code, work_area), work_area);
        scl_list_pp := ^scl_list_pp^^.link;
      IFEND;

      logged_statistic_1_p := logged_statistic_1_p^.link_p;
    WHILEND;

    IF scl_list_pp = ^scl_list_p THEN
      result_p := clf#make_list_value (NIL, work_area);
    ELSE
      result_p := scl_list_p;
    IFEND;

  PROCEND p$$logged_statistics;
?? OLDTITLE ??
?? NEWTITLE := 'analyze_binary_log Main Program', EJECT ??

{ Main program

  PROGRAM ptp$_analyze_binary_log
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

    VAR
      utility_attributes: array [1 .. 3] of clt$utility_attribute;

{  PROCEDURE (ptm$anabl) analyze_binary_log, anabl (status)

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

  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,
    [89, 6, 28, 12, 45, 0, 241],
    clc$command, 1, 1, 0, 0, 0, 0, 1, 'PTM$ANABL'], [
    ['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]]];

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

    CONST
      p$status = 1;

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

    VAR
      unique_name: ost$name;

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

    get_date_time_format;
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    get_time_increment_format (status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    mmp$create_scratch_segment (amc$sequence_pointer, mmc$as_none, ptv$predecessor_log_p, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    mmp$create_scratch_segment (amc$sequence_pointer, mmc$as_none, ptv$data_segment_p, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

{ The following call adds the utility command table to the SCL command list.
    utility_attributes [1].key := clc$utility_command_table;
    utility_attributes [1].command_table := anabl_cmd_table;
    utility_attributes [2].key := clc$utility_function_proc_table;
    utility_attributes [2].function_processor_table := anabl_func_table;
    utility_attributes [3].key := clc$utility_prompt;
    utility_attributes [3].prompt.size := 3;
    utility_attributes [3].prompt.value := 'ABL';

    clp$begin_utility (ptc$utility_name, utility_attributes, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    clp$include_file (clc$current_command_input, '', ptc$utility_name, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    clp$end_utility (ptc$utility_name, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    mmp$delete_scratch_segment (ptv$predecessor_log_p, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    mmp$delete_scratch_segment (ptv$data_segment_p, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

  PROCEND ptp$_analyze_binary_log;

MODEND ptm$analyze_binary_log;
