?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Job Management : Manage Output Utility' ??
MODULE jmm$manage_output_utility;

{ PURPOSE:
{   This module contains the command and subcommands for the NOS/VE Manage
{ Output Utility.  The utility is used to manage output files in NOS/VE.
{
{ DESIGN:
{   This utility is a standalone utility outside of the operating system.  It is
{ available to all users.  Some commands may be restricted to a certain class of
{ users, e.g. system operators.  This restriction will be noted with any affected
{ commands.
{
{   This utility runs in the caller's ring.
{
{   Commands in this utility are designed to process an entire list of arguments
{ and report errors as they occur.  (This is intended for future sub-commands).

?? NEWTITLE := 'Global Declarations Referenced By This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc clt$parameter_list
*copyc jmc$job_management_id
*copyc jmc$system_family
*copyc jme$job_history_conditions
*copyc jme$queued_file_conditions
*copyc jmt$attribute_keys
*copyc jmt$attribute_values
*copyc jmt$error_status_list
*copyc osd$integer_limits
*copyc ost$status
?? POP ??
*copyc avp$system_administrator
*copyc avp$system_operator
*copyc clp$begin_utility
*copyc clp$build_standard_title
*copyc clp$change_variable
*copyc clp$close_display
*copyc clp$convert_integer_to_string
*copyc clp$count_list_elements
*copyc clp$create_environment_variable
*copyc clp$end_include
*copyc clp$end_utility
*copyc clp$evaluate_parameters
*copyc clp$include_file
*copyc clp$make_file_value
*copyc clp$make_list_value
*copyc clp$make_name_value
*copyc clp$new_display_line
*copyc clp$open_display_reference
*copyc clp$put_display
*copyc clp$reset_for_next_display_page
*copyc fsp$build_file_ref_from_elems
*copyc jmp$activate_output
*copyc jmp$combine_offline_output
*copyc jmp$determine_name_kind
*copyc jmp$display_attributes
*copyc jmp$get_output_attributes
*copyc jmp$get_output_counts
*copyc jmp$get_output_path_elements
*copyc jmp$get_output_status
*copyc jmp$log_restored_output
*copyc jmp$system_job
*copyc jmp$validate_name
*copyc mmp$create_scratch_segment
*copyc mmp$delete_scratch_segment
*copyc osp$append_status_parameter
*copyc osp$disestablish_cond_handler
*copyc osp$establish_block_exit_hndlr
*copyc osp$format_message
*copyc osp$generate_log_message
*copyc osp$set_status_abnormal
*copyc pfp$find_directory_array
*copyc pfp$find_next_info_record
*copyc pfp$get_multi_item_info
*copyc pmp$get_legible_date_time
*copyc osv$lower_to_upper
?? OLDTITLE ??
?? NEWTITLE := 'Global Declarations Declared By This Module', EJECT ??

*copy clv$display_variables

  SECTION
    read_only: READ;

  CONST
    utility_prompt_length = 2,
    utility_prompt = 'MO';

  VAR
    display_control: [STATIC] clt$display_control,
    error_file: [STATIC] fst$path := ':$LOCAL.$ERRORS',
    error_file_open: [STATIC] boolean := FALSE,
    output_file: [STATIC] fst$path := ':$LOCAL.$OUTPUT',
    system_administrator: boolean,
    system_operator: boolean;

  VAR
    data_mode_names: [STATIC, READ, read_only] array [jmt$data_mode] of string (13) := ['CODED',
          'RHF_STRUCTURE', 'TRANSPARENT'],
    output_state_names: [STATIC, READ, read_only] array [jmt$output_state] of string (10) := ['DEFERRED',
          'QUEUED', 'INITIATED', 'TERMINATED', 'COMPLETED'],
    utility_name: [STATIC, READ, read_only] clt$utility_name := 'manage_output',
    work_area: amt$segment_pointer;

?? OLDTITLE ??
?? NEWTITLE := 'Commands for the Manage_Output Utility', EJECT ??

{ table name=manage_output_commands type=command section_name=read_only scope=local
{ command (change_list_options            , change_list_option, chalo) p=change_list_options cm=local
{ command (quit                           , qui) p=quit cm=local
{ command (select_output                  , selo) p=select_output cm=local
{ tablend

?? PUSH (LISTEXT := ON) ??

  VAR
    manage_output_commands: [STATIC, READ, read_only] ^clt$command_table := ^manage_output_commands_entries,

    manage_output_commands_entries: [STATIC, READ, read_only] array [1 .. 7] of clt$command_table_entry := [
          {} ['CHALO                          ', clc$abbreviation_entry, clc$normal_usage_entry, 1,
          clc$automatically_log, clc$linked_call, ^change_list_options],
          {} ['CHANGE_LIST_OPTION             ', clc$alias_entry, clc$normal_usage_entry, 1,
          clc$automatically_log, clc$linked_call, ^change_list_options],
          {} ['CHANGE_LIST_OPTIONS            ', clc$nominal_entry, clc$normal_usage_entry, 1,
          clc$automatically_log, clc$linked_call, ^change_list_options],
          {} ['QUI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2,
          clc$automatically_log, clc$linked_call, ^quit],
          {} ['QUIT                           ', clc$nominal_entry, clc$normal_usage_entry, 2,
          clc$automatically_log, clc$linked_call, ^quit],
          {} ['SELECT_OUTPUT                  ', clc$nominal_entry, clc$normal_usage_entry, 3,
          clc$automatically_log, clc$linked_call, ^select_output],
          {} ['SELO                           ', clc$abbreviation_entry, clc$normal_usage_entry, 3,
          clc$automatically_log, clc$linked_call, ^select_output]];

?? POP ??

{ table name=operator_mano_commands type=command section_name=read_only scope=local
{ command activate_output_files p=activate_output_files cm=local
{ command (change_list_options            , change_list_option, chalo) p=change_list_options cm=local
{ command (combine_offline_output         , comoo) p=combine_offline_output cm=local
{ command (forward_offline_output         , foroo) p=jmm$forward_offline_output cm=procedure
{ command log_restored_output_files p=log_restored_output_files cm=local
{ command (quit                           , qui) p=quit cm=local
{ command (select_output                  , selo) p=select_output cm=local
{ tablend

?? PUSH (LISTEXT := ON) ??

  VAR
    operator_mano_commands: [STATIC, READ, read_only] ^clt$command_table := ^operator_mano_commands_entries,

    operator_mano_commands_entries: [STATIC, READ, read_only] array [1 .. 13] of clt$command_table_entry := [
          {} ['ACTIVATE_OUTPUT_FILES          ', clc$nominal_entry, clc$normal_usage_entry, 1,
          clc$automatically_log, clc$linked_call, ^activate_output_files],
          {} ['CHALO                          ', clc$abbreviation_entry, clc$normal_usage_entry, 2,
          clc$automatically_log, clc$linked_call, ^change_list_options],
          {} ['CHANGE_LIST_OPTION             ', clc$alias_entry, clc$normal_usage_entry, 2,
          clc$automatically_log, clc$linked_call, ^change_list_options],
          {} ['CHANGE_LIST_OPTIONS            ', clc$nominal_entry, clc$normal_usage_entry, 2,
          clc$automatically_log, clc$linked_call, ^change_list_options],
          {} ['COMBINE_OFFLINE_OUTPUT         ', clc$nominal_entry, clc$normal_usage_entry, 3,
          clc$automatically_log, clc$linked_call, ^combine_offline_output],
          {} ['COMOO                          ', clc$abbreviation_entry, clc$normal_usage_entry, 3,
          clc$automatically_log, clc$linked_call, ^combine_offline_output],
          {} ['FOROO                          ', clc$abbreviation_entry, clc$normal_usage_entry, 4,
          clc$automatically_log, clc$proc_call, 'JMM$FORWARD_OFFLINE_OUTPUT'],
          {} ['FORWARD_OFFLINE_OUTPUT         ', clc$nominal_entry, clc$normal_usage_entry, 4,
          clc$automatically_log, clc$proc_call, 'JMM$FORWARD_OFFLINE_OUTPUT'],
          {} ['LOG_RESTORED_OUTPUT_FILES      ', clc$nominal_entry, clc$normal_usage_entry, 5,
          clc$automatically_log, clc$linked_call, ^log_restored_output_files],
          {} ['QUI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 6,
          clc$automatically_log, clc$linked_call, ^quit],
          {} ['QUIT                           ', clc$nominal_entry, clc$normal_usage_entry, 6,
          clc$automatically_log, clc$linked_call, ^quit],
          {} ['SELECT_OUTPUT                  ', clc$nominal_entry, clc$normal_usage_entry, 7,
          clc$automatically_log, clc$linked_call, ^select_output],
          {} ['SELO                           ', clc$abbreviation_entry, clc$normal_usage_entry, 7,
          clc$automatically_log, clc$linked_call, ^select_output]];

?? POP ??

{ table name=sys_admin_functions type=function section_name=read_only scope=local
{ function $queued_output_path p=queued_output_path cm=local
{ tablend

?? PUSH (LISTEXT := ON) ??

  VAR
    sys_admin_functions: [STATIC, READ, read_only] ^clt$function_processor_table :=
          ^sys_admin_functions_entries,

    sys_admin_functions_entries: [STATIC, READ, read_only] array [1 .. 1] of
          clt$function_proc_table_entry := [
          {} ['$QUEUED_OUTPUT_PATH            ', clc$nominal_entry, clc$normal_usage_entry, 1,
          clc$linked_call, ^queued_output_path]];

?? POP ??
?? OLDTITLE ??
?? NEWTITLE := '[XDCL, #GATE] jmp$manage_output_utility', EJECT ??

{ PURPOSE:
{   This is the entry point that begins the manage output utility.

  PROGRAM jmp$manage_output_utility
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (jmm$mano) manage_output, mano (
{   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, 1, 27, 12, 47, 15, 159], clc$command, 1, 1, 0, 0, 0, 0, 1, 'JMM$MANO'],
            [['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;

{ TYPE
{   selected_output_type: list 0 .. clc$max_list_size of name
{ TYPEND;

?? PUSH (LISTEXT := ON) ??

    VAR
      type_specification: [STATIC, READ, cls$declaration_section] record
        header: clt$type_specification_header,
        name: string (20),
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend := [[1, 20, clc$list_type], 'SELECTED_OUTPUT_TYPE',
            [5, 0, clc$max_list_size, FALSE], [[1, 0, clc$name_type], [1, osc$max_name_size]]];

?? POP ??

    VAR
      utility_attributes_p: ^clt$utility_attributes;

    status.normal := TRUE;

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

    system_administrator := avp$system_administrator ();
    system_operator := avp$system_operator ();

    IF system_administrator THEN
      PUSH utility_attributes_p: [1 .. 5];
    ELSE
      PUSH utility_attributes_p: [1 .. 4];
    IFEND;
    utility_attributes_p^ [1].key := clc$utility_command_search_mode;
    utility_attributes_p^ [1].command_search_mode := clc$global_command_search;
    utility_attributes_p^ [2].key := clc$utility_command_table;
    IF system_administrator OR system_operator THEN
      utility_attributes_p^ [2].command_table := operator_mano_commands;
    ELSE
      utility_attributes_p^ [2].command_table := manage_output_commands;
    IFEND;
    utility_attributes_p^ [3].key := clc$utility_prompt;
    utility_attributes_p^ [3].prompt.value := utility_prompt;
    utility_attributes_p^ [3].prompt.size := utility_prompt_length;
    utility_attributes_p^ [4].key := clc$utility_termination_command;
    utility_attributes_p^ [4].termination_command := 'quit';
    IF system_administrator THEN
      utility_attributes_p^ [5].key := clc$utility_function_proc_table;
      utility_attributes_p^ [5].function_processor_table := sys_admin_functions;
    IFEND;

    mmp$create_scratch_segment (amc$sequence_pointer, mmc$as_sequential, work_area, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

{ Begin the utility environment.  Establish the command list, and scan the
{ command file for commands.

    clp$begin_utility (utility_name, utility_attributes_p^, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$create_environment_variable ('JMV$SELECTED_OUTPUT', clc$utility_scope, clc$read_write,
          clc$immediate_evaluation, #SEQ (type_specification), NIL, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$include_file (clc$current_command_input, utility_prompt, utility_name, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

{ End the utility environment and exit the utility.

    clp$end_utility (utility_name, status);

  PROCEND jmp$manage_output_utility;
?? NEWTITLE := 'activate_output_files', EJECT ??

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

{ procedure (jmm$mano_actof) activate_output_files (
{   files_activated, fa: (var) list 0..clc$max_list_size of name = $optional
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 3] 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,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 10, 14, 14, 14, 17, 114],
    clc$command, 3, 2, 0, 0, 0, 1, 2, 'JMM$MANO_ACTOF'], [
    ['FA                             ',clc$abbreviation_entry, 1],
    ['FILES_ACTIVATED                ',clc$nominal_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_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 21,
  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$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$list_type], [5, 0, 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$files_activated = 1,
      p$status = 2;

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

    CONST
      maximum_result_item_count = 2,
      ri_system_file_name = 1,
      ri_output_destination_usage = 2;

    VAR
      catalog_segment_pointer: amt$segment_pointer,
      file_count: 0 .. clc$max_list_size,
      file_list: ^clt$data_value,
      file_number: 1 .. clc$max_list_size,
      files_activated: ^clt$data_value,
      ignore_status: ost$status,
      known_output_count: jmt$output_count_range,
      known_output_p: ^jmt$output_status_results,
      list_value: ^clt$data_value,
      local_status: ost$status,
      status_result_keys_p: ^jmt$results_keys;

?? NEWTITLE := 'read_directory', EJECT ??

{
{    The purpose of this request is to read the directory of a specified
{  catalog.   A sequence is used as a placeholder for the directory.
{  The directory is returned as a pointer to an adaptable array of names.
{
{        READ_DIRECTORY (CATALOG_PATH, CATALOG_SEQUENCE_P, DIRECTORY_ARRAY_P, STATUS);
{
{ CATALOG_PATH: (input) This is the path of the catalog to read.
{
{ CATALOG_SEQUENCE_P: (input/output) This is a sequence used by the permanent file
{        interfaces for storing the raw catalog data.
{
{ DIRECTORY_ARRAY_P: (output) This is a pointer to an adaptable array of the
{        names in the catalog's directory.
{
{ STATUS: (output) This is the status of the request.
{

    PROCEDURE read_directory
      (    catalog_path: pft$path;
       VAR catalog_sequence_p: ^SEQ ( * );
       VAR directory_array_p: pft$p_directory_array;
       VAR status: ost$status);

      VAR
        group: pft$group,
        info_record_p: pft$p_info_record;

      status.normal := TRUE;
      RESET catalog_sequence_p;
      group.group_type := pfc$public;
      directory_array_p := NIL;

{ Get the raw catalog data.

      pfp$get_multi_item_info (catalog_path, group, $pft$catalog_info_selections [],
            $pft$file_info_selections [pfc$file_description], catalog_sequence_p, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

{ Find the first info record in the sequence.

      RESET catalog_sequence_p;
      pfp$find_next_info_record (catalog_sequence_p, info_record_p, status);
      IF status.normal AND (info_record_p = NIL) THEN
        osp$set_status_abnormal ('JM', jme$unable_to_recover_catalog, catalog_path [1], status);
      IFEND;
      IF NOT status.normal THEN
        RETURN;
      IFEND;

{ Get an array of names of entities in the catalog.

      pfp$find_directory_array (info_record_p, directory_array_p, status);

    PROCEND read_directory;
?? OLDTITLE ??
?? NEWTITLE := 'recover_output_queue', EJECT ??

{ PURPOSE:
{   The purpose of this request is to recover the standard output queue catalog.
{
{ DESIGN:
{   Compare the names of the files in the catalog with the list of names in the KOL.  If there is no
{ entry in the KOL, then the output has not been queued, so attempt to recover it.

    PROCEDURE recover_output_queue
      (    subcatalog_name: ost$name;
           known_output_p: ^jmt$output_status_results;
           known_output_count: jmt$output_count_range;
       VAR node: ^clt$data_value;
       VAR work_area: ^clt$work_area;
       VAR catalog_sequence_p: ^SEQ ( * );
       VAR status: ost$status);

      VAR
        directory_array_p: pft$p_directory_array,
        ignore_status: ost$status,
        known_output_index: jmt$output_count_range,
        local_status: ost$status,
        name_index: pft$array_index,
        output_destination_usage: jmt$destination_usage,
        path_p: ^pft$path,
        system_file_name: jmt$system_supplied_name;

      status.normal := TRUE;
      PUSH path_p: [pfc$family_name_index .. pfc$subcatalog_name_index];
      path_p^ [pfc$family_name_index] := jmc$system_family;
      path_p^ [pfc$master_catalog_name_index] := jmc$system_user;
      path_p^ [pfc$subcatalog_name_index] := subcatalog_name;

{ Read the output catalog.

      read_directory (path_p^, catalog_sequence_p, directory_array_p, local_status);
      IF NOT local_status.normal THEN
        display_status_error (local_status, ignore_status);
        RETURN;
      IFEND;

{ Recover the output queue.

      IF directory_array_p <> NIL THEN

      /recover_all_files/
        FOR name_index := 1 TO UPPERBOUND (directory_array_p^) DO

          system_file_name := directory_array_p^ [name_index].name;

{ Check to see if the output file is known to the system.

          search_known_output (system_file_name, known_output_p, known_output_count, known_output_index);
          IF known_output_index <> 0 THEN
            output_destination_usage := known_output_p^ [known_output_index]^ [ri_output_destination_usage].
                  output_destination_usage;
            IF subcatalog_name = jmc$sf_job_output_catalog THEN
              IF (output_destination_usage = jmc$public_usage) OR
                    (output_destination_usage = jmc$private_usage) OR
                    (output_destination_usage = jmc$dual_state_usage) THEN

                osp$set_status_abnormal (jmc$job_management_id, jme$output_was_not_recovered,
                      system_file_name, local_status);
                display_status_error (local_status, ignore_status);

              IFEND;
            ELSEIF (output_destination_usage <> jmc$public_usage) AND
                  (output_destination_usage <> jmc$private_usage) AND
                  (output_destination_usage <> jmc$dual_state_usage) THEN

{             osp$set_status_abnormal (jmc$job_management_id, jme$output_was_not_recovered, system_file_name,
{                   local_status);
{             display_status_error (local_status, ignore_status);

            IFEND;

            CYCLE /recover_all_files/;
          IFEND;

{ The file is not in the KOL.  Try to recover the file.

          jmp$activate_output (system_file_name, subcatalog_name, local_status);
          IF local_status.normal THEN
            clp$make_list_value (work_area, node^.link);
            IF node^.link = NIL THEN
              osp$set_status_condition (cle$work_area_overflow, status);
              RETURN;
            IFEND;

            node := node^.link;
            clp$make_name_value (system_file_name, work_area, node^.element_value);
            IF node^.element_value = NIL THEN
              osp$set_status_condition (cle$work_area_overflow, status);
              RETURN;
            IFEND;
          ELSE
            osp$set_status_abnormal (jmc$job_management_id, jme$output_was_not_recovered, system_file_name,
                  status);
            display_status_error (local_status, ignore_status);
            display_status_error (status, ignore_status);
            status.normal := TRUE;
          IFEND;
        FOREND /recover_all_files/;
      IFEND;
    PROCEND recover_output_queue;
?? OLDTITLE ??
?? NEWTITLE := 'search_known_output', EJECT ??

{ PURPOSE:
{   The purpose of this request is to search a table of file names from the KOL
{ for a specific system file name.
{
{ DESIGN:
{   Search the table of file names using a binary search algorithm.  Return a
{ boolean which gives the result of the search.

    PROCEDURE search_known_output
      (    system_file_name: jmt$system_supplied_name;
           known_output_p: ^jmt$output_status_results;
           known_output_count: jmt$output_count_range;
       VAR position: jmt$output_count_range);

      VAR
        temp: integer,
        lower: jmt$output_count_range,
        upper: jmt$output_count_range;

      lower := 1;
      upper := known_output_count;

    /binary_search/
      WHILE lower <= upper DO
        temp := lower + upper;
        position := temp DIV 2;
        IF system_file_name = known_output_p^ [position]^ [1].system_file_name THEN
          RETURN;
        ELSE
          IF system_file_name > known_output_p^ [position]^ [1].system_file_name THEN
            lower := position + 1;
          ELSE
            upper := position - 1;
          IFEND;
        IFEND;
      WHILEND /binary_search/;
      position := 0;

    PROCEND search_known_output;
?? OLDTITLE ??
?? NEWTITLE := 'sort_known_outputs', EJECT ??

    PROCEDURE sort_known_outputs
      (    known_outputs_p: ^jmt$output_status_results;
           known_output_count: jmt$output_count_range);

      VAR
        gap: integer,
        start: integer,
        current: integer,
        swap: array [ri_system_file_name .. ri_output_destination_usage] of jmt$output_status_result;

{ Use shell sort technique.

      gap := known_output_count;
      WHILE gap > 1 DO
        gap := 2 * (gap DIV 4) + 1;
        FOR start := 1 TO known_output_count - gap DO
          current := start;
          WHILE (current > 0) AND (known_outputs_p^ [current]^ [1].
                system_file_name > known_outputs_p^ [current + gap]^ [1].system_file_name) DO
            swap := known_outputs_p^ [current]^;
            known_outputs_p^ [current]^ := known_outputs_p^ [current + gap]^;
            known_outputs_p^ [current + gap]^ := swap;
            current := current - gap;
          WHILEND;
        FOREND;
      WHILEND;
    PROCEND sort_known_outputs;
?? OLDTITLE ??
?? EJECT ??

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

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

{ Build a list of the known outputs on this system.

    RESET work_area.sequence_pointer;
    PUSH status_result_keys_p: [ri_system_file_name .. ri_output_destination_usage];
    status_result_keys_p^ [ri_system_file_name] := jmc$system_file_name;
    status_result_keys_p^ [ri_output_destination_usage] := jmc$output_destination_usage;
    jmp$get_output_status (NIL, status_result_keys_p, work_area.sequence_pointer, known_output_p,
          known_output_count, status);

    IF NOT status.normal THEN
      IF status.condition = jme$no_outputs_were_found THEN
        known_output_count := 0;
        status.normal := TRUE;
      ELSE
        RETURN;
      IFEND;
    IFEND;

    sort_known_outputs (known_output_p, known_output_count);

{ Create a scratch sequence to use for the permanent file interfaces.

    mmp$create_scratch_segment (amc$sequence_pointer, mmc$as_sequential, catalog_segment_pointer, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$make_list_value (work_area.sequence_pointer, files_activated);
    IF files_activated = NIL THEN
      osp$set_status_condition (cle$work_area_overflow, status);
    IFEND;

    establish_display_title ('activate_output_files');
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    list_value := files_activated;
    recover_output_queue (jmc$job_output_catalog, known_output_p, known_output_count, list_value,
          work_area.sequence_pointer, catalog_segment_pointer.sequence_pointer, status);
    IF status.normal THEN
      recover_output_queue (jmc$sf_job_output_catalog, known_output_p, known_output_count, list_value,
            work_area.sequence_pointer, catalog_segment_pointer.sequence_pointer, status);
    IFEND;

    IF error_file_open THEN
      close_error_file (ignore_status);
    IFEND;

    mmp$delete_scratch_segment (catalog_segment_pointer, ignore_status);

{ Return the activated system file names as the FILES_ACTIVATED parameter.

    IF pvt [p$files_activated].specified THEN

{ Skip the empty first list element if the list has some real names in it.

      IF files_activated^.link <> NIL THEN
        files_activated := files_activated^.link;
      IFEND;

      clp$change_variable (pvt [p$files_activated].variable^, files_activated, status);
    IFEND;

  PROCEND activate_output_files;
?? OLDTITLE ??
?? NEWTITLE := 'abort_handler', EJECT ??

{ PURPOSE:
{   Attempt to cleanup on block exit if something doesn't work.

  PROCEDURE abort_handler
    (    condition: pmt$condition;
         condition_information: ^pmt$condition_information;
         save_area: ^ost$stack_frame_save_area;
     VAR handler_status: ost$status);

    VAR
      ignore_status: ost$status;

    IF error_file_open THEN
      clp$close_display (display_control, ignore_status);
      error_file_open := FALSE;
      #SPOIL (error_file_open);
    IFEND;

  PROCEND abort_handler;
?? OLDTITLE ??
?? NEWTITLE := 'change_list_options', EJECT ??

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

{ PROCEDURE (jmm$mano_chalo) change_list_options, change_list_option, chalo (
{   errors, error, e: file = $optional
{   output, o: file = $optional
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 6] of clt$pdt_parameter_name,
      parameters: array [1 .. 3] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 10, 24, 10, 1, 20, 479],
    clc$command, 6, 3, 0, 0, 0, 0, 3, 'JMM$MANO_CHALO'], [
    ['E                              ',clc$abbreviation_entry, 1],
    ['ERROR                          ',clc$alias_entry, 1],
    ['ERRORS                         ',clc$nominal_entry, 1],
    ['O                              ',clc$abbreviation_entry, 2],
    ['OUTPUT                         ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 3]],
    [
{ PARAMETER 1
    [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, 3, clc$optional_parameter, 0
  , 0],
{ PARAMETER 2
    [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, 3, 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$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$file_type]],
{ PARAMETER 2
    [[1, 0, clc$file_type]],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];

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

    CONST
      p$errors = 1,
      p$output = 2,
      p$status = 3;

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

    status.normal := TRUE;

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

    IF pvt [p$errors].specified THEN
      error_file := pvt [p$errors].value^.file_value^;
    IFEND;

    IF pvt [p$output].specified THEN
      output_file := pvt [p$output].value^.file_value^;
    IFEND;

  PROCEND change_list_options;
?? OLDTITLE ??
?? NEWTITLE := 'close_error_file', EJECT ??

  PROCEDURE close_error_file
    (VAR status: ost$status);

    IF error_file_open THEN
      clp$close_display (display_control, status);
      IF status.normal THEN
        error_file_open := FALSE;
        #SPOIL (error_file_open);
      IFEND;
    IFEND;

  PROCEND close_error_file;
?? OLDTITLE ??
?? NEWTITLE := 'combine_offline_output', EJECT ??

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

{ PROCEDURE (jmm$mano_comoo) combine_offline_output, comoo (
{   tape_file, tf: file = $required
{   device, d: name = $required
{   number, n: any of
{       key
{         all
{       keyend
{       integer 1..jmc$maximum_output_count
{     anyend = 1
{   output, o: file = $optional
{   errors, e: file = $optional
{   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,
      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,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (1),
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
      type5: record
        header: clt$type_specification_header,
      recend,
      type6: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 10, 27, 13, 29, 3, 625],
    clc$command, 11, 6, 2, 0, 0, 0, 6, 'JMM$MANO_COMOO'], [
    ['D                              ',clc$abbreviation_entry, 2],
    ['DEVICE                         ',clc$nominal_entry, 2],
    ['E                              ',clc$abbreviation_entry, 5],
    ['ERRORS                         ',clc$nominal_entry, 5],
    ['N                              ',clc$abbreviation_entry, 3],
    ['NUMBER                         ',clc$nominal_entry, 3],
    ['O                              ',clc$abbreviation_entry, 4],
    ['OUTPUT                         ',clc$nominal_entry, 4],
    ['STATUS                         ',clc$nominal_entry, 6],
    ['TAPE_FILE                      ',clc$nominal_entry, 1],
    ['TF                             ',clc$abbreviation_entry, 1]],
    [
{ 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$standard_parameter_checking, 3, 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$standard_parameter_checking, 5, 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, 84,
  clc$optional_default_parameter, 0, 1],
{ PARAMETER 4
    [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_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, 3, 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$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$file_type]],
{ PARAMETER 2
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 3
    [[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, jmc$maximum_output_count, 10]]
    ,
    '1'],
{ PARAMETER 4
    [[1, 0, clc$file_type]],
{ PARAMETER 5
    [[1, 0, clc$file_type]],
{ PARAMETER 6
    [[1, 0, clc$status_type]]];

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

    CONST
      p$tape_file = 1,
      p$device = 2,
      p$number = 3,
      p$output = 4,
      p$errors = 5,
      p$status = 6;

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

    VAR
      attribute_index: jmt$attribute_keys,
      attribute_values_pp: ^array [1 .. * ] of ^jmt$attribute_values,
      attribute_values_seq_p: ^SEQ ( * ),
      combined_file_count: jmt$output_count_range,
      combined_file_index: jmt$output_count_range,
      combined_file_list_p: ^array [1 .. * ] of jmt$output_descriptor,
      error_file_count: jmt$output_count_range,
      error_file_index: jmt$output_count_range,
      error_file_list_p: ^jmt$error_status_list,
      error_file_path: fst$path,
      number_of_files_to_combine: jmt$output_count_range,
      output_file_path: fst$path;

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

{ Determine how many files to copy to the tape.

    IF pvt [p$number].value^.kind = clc$keyword THEN
      number_of_files_to_combine := jmc$maximum_output_count;
    ELSE
      number_of_files_to_combine := pvt [p$number].value^.integer_value.value;
    IFEND;

{ Call ring 3 to copy files to the tape.

    RESET work_area.sequence_pointer;
    NEXT combined_file_list_p: [1 .. jmc$maximum_output_count] IN work_area.sequence_pointer;
    NEXT error_file_list_p: [1 .. jmc$maximum_output_count] IN work_area.sequence_pointer;
    jmp$combine_offline_output (pvt [p$tape_file].value^.file_value^, pvt [p$device].value^.name_value,
          number_of_files_to_combine, combined_file_count, combined_file_list_p^, error_file_count,
          error_file_list_p^, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

{ Format attributes of files that were written to tape and write them to the
{ output file.

    IF pvt [p$output].specified THEN
      output_file_path := pvt [p$output].value^.file_value^;
    ELSE
      output_file_path := output_file;
    IFEND;
    IF combined_file_count > 0 THEN
      PUSH attribute_values_pp: [1 .. combined_file_count];
      FOR combined_file_index := 1 TO combined_file_count DO
        PUSH attribute_values_pp^ [combined_file_index]: [1 .. 32];

        attribute_index := 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$comment_banner;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].comment_banner :=
              combined_file_list_p^ [combined_file_index].comment_banner;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$control_family;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].control_family :=
              combined_file_list_p^ [combined_file_index].control_family;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$control_user;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].
              control_user := combined_file_list_p^ [combined_file_index].control_user;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$copies;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].
              copies := combined_file_list_p^ [combined_file_index].copies;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$data_mode;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].
              data_mode := combined_file_list_p^ [combined_file_index].data_mode;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$device;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].
              device := combined_file_list_p^ [combined_file_index].device;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$device_type;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].
              device_type := combined_file_list_p^ [combined_file_index].device_type;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$external_characteristics;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].external_characteristics :=
              combined_file_list_p^ [combined_file_index].external_characteristics;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$file_size;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].
              file_size := combined_file_list_p^ [combined_file_index].file_size;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$forms_code;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].
              forms_code := combined_file_list_p^ [combined_file_index].forms_code;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$login_account;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].
              login_account := combined_file_list_p^ [combined_file_index].login_account;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$login_family;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].
              login_family := combined_file_list_p^ [combined_file_index].login_family;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$login_project;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].
              login_project := combined_file_list_p^ [combined_file_index].login_project;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$login_user;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].
              login_user := combined_file_list_p^ [combined_file_index].login_user;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$output_destination_family;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].output_destination_family :=
              combined_file_list_p^ [combined_file_index].output_destination_family;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$station_operator;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].station_operator :=
              combined_file_list_p^ [combined_file_index].station_operator;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$origin_application_name;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].origin_application_name :=
              combined_file_list_p^ [combined_file_index].originating_application_name;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$output_class;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].
              output_class := combined_file_list_p^ [combined_file_index].output_class;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$output_destination;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].output_destination :=
              combined_file_list_p^ [combined_file_index].output_destination;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$output_priority;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].output_priority :=
              combined_file_list_p^ [combined_file_index].output_priority;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$output_submission_time;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].output_submission_time :=
              combined_file_list_p^ [combined_file_index].output_submission_time;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$remote_host_directive;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].remote_host_directive :=
              ^combined_file_list_p^ [combined_file_index].remote_host_directive;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$routing_banner;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].routing_banner :=
              combined_file_list_p^ [combined_file_index].routing_banner;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$site_information;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].site_information :=
              ^combined_file_list_p^ [combined_file_index].site_information;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$station;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].
              station := combined_file_list_p^ [combined_file_index].station;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$system_file_name;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].system_file_name :=
              combined_file_list_p^ [combined_file_index].system_file_name;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$system_job_name;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].system_job_name :=
              combined_file_list_p^ [combined_file_index].system_job_name;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$user_file_name;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].user_file_name :=
              combined_file_list_p^ [combined_file_index].user_file_name;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$user_information;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].user_information :=
              ^combined_file_list_p^ [combined_file_index].user_information;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$user_file_name;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].user_file_name :=
              combined_file_list_p^ [combined_file_index].user_file_name;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$vertical_print_density;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].vertical_print_density :=
              combined_file_list_p^ [combined_file_index].vertical_print_density;

        attribute_index := attribute_index + 1;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].key := jmc$vfu_load_procedure;
        attribute_values_pp^ [combined_file_index]^ [attribute_index].vfu_load_procedure :=
              combined_file_list_p^ [combined_file_index].vfu_load_procedure;
      FOREND;

      attribute_values_seq_p := #SEQ (attribute_values_pp);
      jmp$display_attributes (output_file_path, attribute_values_seq_p, combined_file_count, NIL, NIL, 0,
            'combine_offline_output', status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
    IFEND;

{ Format attributes and error status of files that were not written to tape and
{ write them to the error file.

    IF pvt [p$errors].specified THEN
      error_file_path := pvt [p$errors].value^.file_value^;
    ELSE
      error_file_path := error_file;
    IFEND;
    IF error_file_count > 0 THEN
      osp$establish_block_exit_hndlr (^abort_handler);
      establish_display_title ('combine_offline_output');

      FOR error_file_index := 1 TO error_file_count DO
        display_status_error (error_file_list_p^ [error_file_index].status, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
      FOREND;

      close_error_file (status);
      osp$disestablish_cond_handler;
    IFEND;

  PROCEND combine_offline_output;
?? OLDTITLE ??
?? NEWTITLE := 'display_status_error', EJECT ??

  PROCEDURE display_status_error
    (    error_status: ost$status;
     VAR status: ost$status);

    VAR
      line_count: 1 .. osc$max_status_message_lines,
      status_message_p: ^ost$status_message,
      status_message_line_count_p: ^ost$status_message_line_count,
      status_message_line_p: ^ost$status_message_line,
      status_message_line_size_p: ^ost$status_message_line_size,
      status_message: ost$status_message;

    IF error_status.normal THEN
      RETURN;
    IFEND;

    IF NOT error_file_open THEN
      open_error_file (error_file, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
    IFEND;

    osp$format_message (error_status, osc$full_message_level, display_control.page_width, status_message,
          status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    status_message_p := ^status_message;
    RESET status_message_p;
    NEXT status_message_line_count_p IN status_message_p;
    FOR line_count := 1 TO status_message_line_count_p^ DO
      NEXT status_message_line_size_p IN status_message_p;
      NEXT status_message_line_p: [status_message_line_size_p^] IN status_message_p;
      clp$put_display (display_control, status_message_line_p^, clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
    FOREND;
  PROCEND display_status_error;
?? OLDTITLE ??
?? NEWTITLE := 'establish_display_title', EJECT ??

  PROCEDURE [INLINE] establish_display_title
    (    command_title: string ( * ));

    clv$titles_built := FALSE;
    clv$command_name := command_title;

  PROCEND establish_display_title;
?? OLDTITLE ??
?? NEWTITLE := 'log_restored_output_files', EJECT ??

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

{ procedure (jmm$mano_logrof) log_restored_output_files (
{   files_restored, fr: list 0..clc$max_list_size of name = $required
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 3] 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,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 10, 14, 14, 14, 17, 521],
    clc$command, 3, 2, 1, 0, 0, 0, 2, 'JMM$MANO_LOGROF'], [
    ['FILES_RESTORED                 ',clc$nominal_entry, 1],
    ['FR                             ',clc$abbreviation_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 2]],
    [
{ 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, 21, 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$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$list_type], [5, 0, 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$files_restored = 1,
      p$status = 2;

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

    VAR
      file_count: 0 .. clc$max_list_size,
      file_list: ^clt$data_value,
      file_number: 0 .. clc$max_list_size,
      ignore_status: ost$status,
      local_status: ost$status,
      output_name: jmt$name;

    status.normal := TRUE;

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

    osp$establish_block_exit_hndlr (^abort_handler);
    establish_display_title ('log_restored_output_files');
    IF NOT status.normal THEN
      RETURN;
    IFEND;

{  Process the FILES_RESTORED parameter.

    file_count := clp$count_list_elements (pvt [p$files_restored].value);
    file_list := pvt [p$files_restored].value;

  /log_each_file/
    FOR file_number := 1 TO file_count DO

      jmp$determine_name_kind (file_list^.element_value^.name_value, output_name, local_status);
      IF NOT local_status.normal THEN
        display_status_error (local_status, ignore_status);
      ELSEIF output_name.kind <> jmc$system_supplied_name THEN
        osp$set_status_abnormal (jmc$job_management_id, jme$name_not_found, output_name.user_supplied_name,
              local_status);
        display_status_error (local_status, ignore_status);
      ELSE

        jmp$log_restored_output (output_name.system_supplied_name, local_status);
        IF NOT local_status.normal THEN
          display_status_error (local_status, ignore_status);

          IF local_status.condition = jme$jh_job_history_not_active THEN
            EXIT /log_each_file/;
          IFEND;
        IFEND;
      IFEND;

      file_list := file_list^.link;
    FOREND /log_each_file/;

    IF error_file_open THEN
      close_error_file (ignore_status);
    IFEND;
    osp$disestablish_cond_handler;

  PROCEND log_restored_output_files;
?? OLDTITLE ??
?? NEWTITLE := 'open_error_file', EJECT ??

  PROCEDURE open_error_file
    (    error_file: fst$file_reference;
     VAR status: ost$status);

    VAR
      default_ring_attributes: amt$ring_attributes;

    status.normal := TRUE;
    IF NOT error_file_open THEN

      default_ring_attributes.r1 := #RING (^default_ring_attributes);
      default_ring_attributes.r2 := #RING (^default_ring_attributes);
      default_ring_attributes.r3 := #RING (^default_ring_attributes);

      clp$open_display_reference (error_file, ^clp$new_page_procedure, fsc$list, default_ring_attributes,
            display_control, status);
      IF status.normal THEN
        error_file_open := TRUE;
        #SPOIL (error_file_open);
      IFEND;
    IFEND;

  PROCEND open_error_file;
?? OLDTITLE ??
?? NEWTITLE := 'put_subtitle', EJECT ??

  PROCEDURE [INLINE] put_subtitle
    (VAR display_control: clt$display_control;
     VAR status: ost$status);

{ These displays do not have subtitles.  This is merely a dummy routine to keep the module consistant
{ with those that do produce subtitles.

  PROCEND put_subtitle;
?? OLDTITLE ??
?? NEWTITLE := 'queued_output_path', EJECT ??

  PROCEDURE queued_output_path
    (    parameter_list: clt$parameter_list;
     VAR work_area { input, output } : ^clt$work_area;
     VAR result: ^clt$data_value;
     VAR status: ost$status);

{ function (jmm$mano_$qop) $queued_output_path (
{   names: list 0..clc$max_list_size of name = jmv$selected_output)

?? 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,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        default_value: string (19),
      recend,
    recend := [
    [1,
    [89, 10, 14, 14, 14, 17, 899],
    clc$function, 1, 1, 0, 0, 0, 0, 0, 'JMM$MANO_$QOP'], [
    ['NAMES                          ',clc$nominal_entry, 1]],
    [
{ PARAMETER 1
    [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, 21,
  clc$optional_default_parameter, 0, 19]],
{ PARAMETER 1
    [[1, 0, clc$list_type], [5, 0, clc$max_list_size, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ,
    'jmv$selected_output']];

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

    CONST
      p$names = 1;

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

    VAR
      file_reference: string (fsc$max_path_size),
      ignore_status: ost$status,
      output_name: jmt$name,
      name_count: 0 .. clc$max_list_size,
      name_list: ^clt$data_value,
      name_number: 0 .. clc$max_list_size,
      node: ^clt$data_value,
      path: jmt$queue_file_path;

    status.normal := TRUE;

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

    clp$make_list_value (work_area, result);
    IF result = NIL THEN
      osp$set_status_condition (cle$work_area_overflow, status);
      RETURN;
    IFEND;
    node := result;

{ Process the NAMES parameter.

    name_count := clp$count_list_elements (pvt [p$names].value);
    name_list := pvt [p$names].value;

  /get_each_path/
    FOR name_number := 1 TO name_count DO

      jmp$determine_name_kind (name_list^.element_value^.name_value, output_name, status);
      IF NOT status.normal THEN
        EXIT /get_each_path/;
      IFEND;
      IF output_name.kind <> jmc$system_supplied_name THEN
        osp$set_status_abnormal (jmc$job_management_id, jme$name_not_found, output_name.system_supplied_name,
              status);
        EXIT /get_each_path/;
      IFEND;

      jmp$get_output_path_elements (output_name.system_supplied_name, path, status);
      IF NOT status.normal THEN
        EXIT /get_each_path/;
      IFEND;

      fsp$build_file_ref_from_elems (^path, file_reference, status);
      IF NOT status.normal THEN
        EXIT /get_each_path/;
      IFEND;

      clp$make_list_value (work_area, node^.link);
      IF node^.link = NIL THEN
        osp$set_status_condition (cle$work_area_overflow, status);
        EXIT /get_each_path/;
      IFEND;

      node := node^.link;
      clp$make_file_value (file_reference, work_area, node^.element_value);
      IF node^.element_value = NIL THEN
        osp$set_status_condition (cle$work_area_overflow, status);
        EXIT /get_each_path/;
      IFEND;

      name_list := name_list^.link;
    FOREND /get_each_path/;

{ Skip the empty first list element if the list has some real items in it.

    IF result^.link <> NIL THEN
      result := result^.link;
    IFEND;

  PROCEND queued_output_path;
?? OLDTITLE ??
?? NEWTITLE := 'quit', EJECT ??

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

{ PROCEDURE (jmm$mano_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, 1, 29, 9, 17, 28, 807], clc$command, 1, 1, 0, 0, 0, 0, 1, 'JMM$MANO_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;

    VAR
      ignore_status: ost$status;

    status.normal := TRUE;

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

    mmp$delete_scratch_segment (work_area, ignore_status);

    clp$end_include (utility_name, status);

{ Exit the utility.

  PROCEND quit;
?? OLDTITLE ??
?? NEWTITLE := 'select_output', EJECT ??

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

{ PROCEDURE (jmm$mano_selo) select_output, selo (
{   comment_banner, comment_banners, cb: list of string 0..jmc$output_comment_banner_size = $optional
{   control_family, control_families, cf: list of name = $optional
{   control_user, control_users, cu: list of name = $optional
{   data_mode, dm: list of key
{       (coded, c)
{       (transparent, t)
{     keyend = $optional
{   device, devices, d: list of any of
{       key
{         automatic
{       keyend
{       name
{     anyend = $optional
{   external_characteristics, ec: list of any of
{       key
{         normal
{       keyend
{       string 0..jmc$ext_characteristics_size
{     anyend = $optional
{   forms_code, forms_codes, fc: list of any of
{       key
{         normal
{       keyend
{       string 0..jmc$forms_code_size
{     anyend = $optional
{   login_account, login_accounts, la: list of name = $optional
{   login_family, login_families, lf: list of name = $optional
{   login_project, login_projects, lp: list of name = $optional
{   login_user, login_users, lu: list of name = $optional
{   name, names, n: list of name = $optional
{   operator_family, operator_families, of: list of name = $optional
{   operator_user, operator_users, ou: list of name = $optional
{   output_class, output_classes, oc: list of name = $optional
{   output_deferred_by_operator, odbo: boolean = $optional
{   output_deferred_by_user, odbu: boolean = $optional
{   output_destination, output_destinations, ode: list of any of
{       name
{       string 0..osc$max_name_size
{     anyend = $optional
{   output_destination_usage, odu: list of any of
{       key
{         dual_state, ntf, private, public, qtf
{       keyend
{       name
{     anyend = $optional
{   output_priority, output_priorities, op: list of name = $optional
{   output_state, output_states, os: any of
{       key
{         all
{       keyend
{       list of key
{         (deferred, d)
{         (queued, q)
{         (initiated, i)
{         (terminated, t)
{         (completed, c)
{       keyend
{     anyend = $optional
{   remote_host_directive, remote_host_directives, rhd: list of ..
{     string 0..jmc$remote_host_directive_size = $optional
{   routing_banner, routing_banners, rb: list of string 0..jmc$output_routing_banner_size = $optional
{   site_information, si: list of string 0..jmc$site_information_size = $optional
{   station, stations, s: list of any of
{       key
{         automatic
{       keyend
{       name
{     anyend = $optional
{   system_job_name, system_job_names, sjn: list of name = $optional
{   user_information, ui: list of string 0..jmc$user_information_size = $optional
{   user_job_name, user_job_names, ujn: list of name = $optional
{   vertical_print_density, vertical_print_densities, vpd: list of key
{       six, eight, none
{     keyend = $optional
{   vfu_load_procedure, vfu_load_procedures, vlp: list of any of
{       key
{         none
{       keyend
{       name
{     anyend = $optional
{   maximum_selection, ms: any of
{       key
{         all
{       keyend
{       integer 1..jmc$maximum_output_count
{     anyend = all
{   mainframe, mainframes, m: key
{       all
{       (current, c)
{     keyend = current
{   output_selection_list, osl: (VAR) list 0..clc$max_list_size of name = jmv$selected_output
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 91] of clt$pdt_parameter_name,
      parameters: array [1 .. 34] 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,
          qualifier: clt$string_type_qualifier,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 4] of clt$keyword_specification,
        recend,
      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$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,
      recend,
      type6: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: 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,
      recend,
      type7: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: 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,
      recend,
      type8: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type9: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type10: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type11: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type12: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type13: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type14: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type15: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type16: record
        header: clt$type_specification_header,
      recend,
      type17: record
        header: clt$type_specification_header,
      recend,
      type18: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: 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$name_type_qualifier,
          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,
      recend,
      type19: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: 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 .. 5] 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,
      recend,
      type20: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type21: 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$keyword_type_qualifier,
            keyword_specs: array [1 .. 10] of clt$keyword_specification,
          recend,
        recend,
      recend,
      type22: 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,
      type23: 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,
      type24: 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,
      type25: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: 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,
      recend,
      type26: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type27: 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,
      type28: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type29: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 3] of clt$keyword_specification,
        recend,
      recend,
      type30: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: 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,
      recend,
      type31: 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,
      type32: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 3] of clt$keyword_specification,
        default_value: string (7),
      recend,
      type33: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        default_value: string (19),
      recend,
      type34: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [91, 2, 13, 20, 30, 31, 721],
    clc$command, 91, 34, 0, 0, 0, 1, 34, 'JMM$MANO_SELO'], [
    ['CB                             ',clc$abbreviation_entry, 1],
    ['CF                             ',clc$abbreviation_entry, 2],
    ['COMMENT_BANNER                 ',clc$nominal_entry, 1],
    ['COMMENT_BANNERS                ',clc$alias_entry, 1],
    ['CONTROL_FAMILIES               ',clc$alias_entry, 2],
    ['CONTROL_FAMILY                 ',clc$nominal_entry, 2],
    ['CONTROL_USER                   ',clc$nominal_entry, 3],
    ['CONTROL_USERS                  ',clc$alias_entry, 3],
    ['CU                             ',clc$abbreviation_entry, 3],
    ['D                              ',clc$abbreviation_entry, 5],
    ['DATA_MODE                      ',clc$nominal_entry, 4],
    ['DEVICE                         ',clc$nominal_entry, 5],
    ['DEVICES                        ',clc$alias_entry, 5],
    ['DM                             ',clc$abbreviation_entry, 4],
    ['EC                             ',clc$abbreviation_entry, 6],
    ['EXTERNAL_CHARACTERISTICS       ',clc$nominal_entry, 6],
    ['FC                             ',clc$abbreviation_entry, 7],
    ['FORMS_CODE                     ',clc$nominal_entry, 7],
    ['FORMS_CODES                    ',clc$alias_entry, 7],
    ['LA                             ',clc$abbreviation_entry, 8],
    ['LF                             ',clc$abbreviation_entry, 9],
    ['LOGIN_ACCOUNT                  ',clc$nominal_entry, 8],
    ['LOGIN_ACCOUNTS                 ',clc$alias_entry, 8],
    ['LOGIN_FAMILIES                 ',clc$alias_entry, 9],
    ['LOGIN_FAMILY                   ',clc$nominal_entry, 9],
    ['LOGIN_PROJECT                  ',clc$nominal_entry, 10],
    ['LOGIN_PROJECTS                 ',clc$alias_entry, 10],
    ['LOGIN_USER                     ',clc$nominal_entry, 11],
    ['LOGIN_USERS                    ',clc$alias_entry, 11],
    ['LP                             ',clc$abbreviation_entry, 10],
    ['LU                             ',clc$abbreviation_entry, 11],
    ['M                              ',clc$abbreviation_entry, 32],
    ['MAINFRAME                      ',clc$nominal_entry, 32],
    ['MAINFRAMES                     ',clc$alias_entry, 32],
    ['MAXIMUM_SELECTION              ',clc$nominal_entry, 31],
    ['MS                             ',clc$abbreviation_entry, 31],
    ['N                              ',clc$abbreviation_entry, 12],
    ['NAME                           ',clc$nominal_entry, 12],
    ['NAMES                          ',clc$alias_entry, 12],
    ['OC                             ',clc$abbreviation_entry, 15],
    ['ODBO                           ',clc$abbreviation_entry, 16],
    ['ODBU                           ',clc$abbreviation_entry, 17],
    ['ODE                            ',clc$abbreviation_entry, 18],
    ['ODU                            ',clc$abbreviation_entry, 19],
    ['OF                             ',clc$abbreviation_entry, 13],
    ['OP                             ',clc$abbreviation_entry, 20],
    ['OPERATOR_FAMILIES              ',clc$alias_entry, 13],
    ['OPERATOR_FAMILY                ',clc$nominal_entry, 13],
    ['OPERATOR_USER                  ',clc$nominal_entry, 14],
    ['OPERATOR_USERS                 ',clc$alias_entry, 14],
    ['OS                             ',clc$abbreviation_entry, 21],
    ['OSL                            ',clc$abbreviation_entry, 33],
    ['OU                             ',clc$abbreviation_entry, 14],
    ['OUTPUT_CLASS                   ',clc$nominal_entry, 15],
    ['OUTPUT_CLASSES                 ',clc$alias_entry, 15],
    ['OUTPUT_DEFERRED_BY_OPERATOR    ',clc$nominal_entry, 16],
    ['OUTPUT_DEFERRED_BY_USER        ',clc$nominal_entry, 17],
    ['OUTPUT_DESTINATION             ',clc$nominal_entry, 18],
    ['OUTPUT_DESTINATIONS            ',clc$alias_entry, 18],
    ['OUTPUT_DESTINATION_USAGE       ',clc$nominal_entry, 19],
    ['OUTPUT_PRIORITIES              ',clc$alias_entry, 20],
    ['OUTPUT_PRIORITY                ',clc$nominal_entry, 20],
    ['OUTPUT_SELECTION_LIST          ',clc$nominal_entry, 33],
    ['OUTPUT_STATE                   ',clc$nominal_entry, 21],
    ['OUTPUT_STATES                  ',clc$alias_entry, 21],
    ['RB                             ',clc$abbreviation_entry, 23],
    ['REMOTE_HOST_DIRECTIVE          ',clc$nominal_entry, 22],
    ['REMOTE_HOST_DIRECTIVES         ',clc$alias_entry, 22],
    ['RHD                            ',clc$abbreviation_entry, 22],
    ['ROUTING_BANNER                 ',clc$nominal_entry, 23],
    ['ROUTING_BANNERS                ',clc$alias_entry, 23],
    ['S                              ',clc$abbreviation_entry, 25],
    ['SI                             ',clc$abbreviation_entry, 24],
    ['SITE_INFORMATION               ',clc$nominal_entry, 24],
    ['SJN                            ',clc$abbreviation_entry, 26],
    ['STATION                        ',clc$nominal_entry, 25],
    ['STATIONS                       ',clc$alias_entry, 25],
    ['STATUS                         ',clc$nominal_entry, 34],
    ['SYSTEM_JOB_NAME                ',clc$nominal_entry, 26],
    ['SYSTEM_JOB_NAMES               ',clc$alias_entry, 26],
    ['UI                             ',clc$abbreviation_entry, 27],
    ['UJN                            ',clc$abbreviation_entry, 28],
    ['USER_INFORMATION               ',clc$nominal_entry, 27],
    ['USER_JOB_NAME                  ',clc$nominal_entry, 28],
    ['USER_JOB_NAMES                 ',clc$alias_entry, 28],
    ['VERTICAL_PRINT_DENSITIES       ',clc$alias_entry, 29],
    ['VERTICAL_PRINT_DENSITY         ',clc$nominal_entry, 29],
    ['VFU_LOAD_PROCEDURE             ',clc$nominal_entry, 30],
    ['VFU_LOAD_PROCEDURES            ',clc$alias_entry, 30],
    ['VLP                            ',clc$abbreviation_entry, 30],
    ['VPD                            ',clc$abbreviation_entry, 29]],
    [
{ PARAMETER 1
    [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, 24, 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, 21, clc$optional_parameter,
  0, 0],
{ 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, 21, clc$optional_parameter,
  0, 0],
{ PARAMETER 4
    [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, 171,
  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, 85, clc$optional_parameter,
  0, 0],
{ PARAMETER 6
    [16, 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, 88, clc$optional_parameter,
  0, 0],
{ PARAMETER 7
    [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, 88, clc$optional_parameter,
  0, 0],
{ PARAMETER 8
    [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$standard_parameter_checking, 21, clc$optional_parameter,
  0, 0],
{ PARAMETER 9
    [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, 21, clc$optional_parameter,
  0, 0],
{ PARAMETER 10
    [26, 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 11
    [28, 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 12
    [38, 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 13
    [48, 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 14
    [49, 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 15
    [54, 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
    [56, 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 17
    [57, 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 18
    [58, 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, 49, clc$optional_parameter,
  0, 0],
{ PARAMETER 19
    [60, 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, 233,
  clc$optional_parameter, 0, 0],
{ PARAMETER 20
    [62, 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 21
    [64, 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, 457,
  clc$optional_parameter, 0, 0],
{ PARAMETER 22
    [67, 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 23
    [70, 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 24
    [74, 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 25
    [76, 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, 85, clc$optional_parameter,
  0, 0],
{ PARAMETER 26
    [79, 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 27
    [83, 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 28
    [84, 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 29
    [87, 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, 134,
  clc$optional_parameter, 0, 0],
{ PARAMETER 30
    [88, 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, 85, clc$optional_parameter,
  0, 0],
{ PARAMETER 31
    [35, 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 32
    [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, 118,
  clc$optional_default_parameter, 0, 7],
{ PARAMETER 33
    [63, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 21,
  clc$optional_default_parameter, 0, 19],
{ PARAMETER 34
    [78, 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], [8, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$string_type], [0, jmc$output_comment_banner_size, FALSE]]
    ],
{ PARAMETER 2
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 3
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 4
    [[1, 0, clc$list_type], [155, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$keyword_type], [4], [
      ['C                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['CODED                          ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['T                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['TRANSPARENT                    ', clc$nominal_entry, clc$normal_usage_entry, 2]]
      ]
    ],
{ PARAMETER 5
    [[1, 0, clc$list_type], [69, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type],
      FALSE, 2],
      44, [[1, 0, clc$keyword_type], [1], [
        ['AUTOMATIC                      ', clc$nominal_entry, clc$normal_usage_entry, 1]]
        ],
      5, [[1, 0, clc$name_type], [1, osc$max_name_size]]
      ]
    ],
{ PARAMETER 6
    [[1, 0, clc$list_type], [72, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$union_type], [[clc$keyword_type, clc$string_type],
      FALSE, 2],
      44, [[1, 0, clc$keyword_type], [1], [
        ['NORMAL                         ', clc$nominal_entry, clc$normal_usage_entry, 1]]
        ],
      8, [[1, 0, clc$string_type], [0, jmc$ext_characteristics_size, FALSE]]
      ]
    ],
{ PARAMETER 7
    [[1, 0, clc$list_type], [72, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$union_type], [[clc$keyword_type, clc$string_type],
      FALSE, 2],
      44, [[1, 0, clc$keyword_type], [1], [
        ['NORMAL                         ', clc$nominal_entry, clc$normal_usage_entry, 1]]
        ],
      8, [[1, 0, clc$string_type], [0, jmc$forms_code_size, FALSE]]
      ]
    ],
{ PARAMETER 8
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 9
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 10
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 11
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 12
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 13
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 14
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 15
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 16
    [[1, 0, clc$boolean_type]],
{ PARAMETER 17
    [[1, 0, clc$boolean_type]],
{ PARAMETER 18
    [[1, 0, clc$list_type], [33, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$union_type], [[clc$name_type, clc$string_type],
      FALSE, 2],
      5, [[1, 0, clc$name_type], [1, osc$max_name_size]],
      8, [[1, 0, clc$string_type], [0, osc$max_name_size, FALSE]]
      ]
    ],
{ PARAMETER 19
    [[1, 0, clc$list_type], [217, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type],
      FALSE, 2],
      192, [[1, 0, clc$keyword_type], [5], [
        ['DUAL_STATE                     ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['NTF                            ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['PRIVATE                        ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['PUBLIC                         ', clc$nominal_entry, clc$normal_usage_entry, 4],
        ['QTF                            ', clc$nominal_entry, clc$normal_usage_entry, 5]]
        ],
      5, [[1, 0, clc$name_type], [1, osc$max_name_size]]
      ]
    ],
{ PARAMETER 20
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 21
    [[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]]
      ],
    393, [[1, 0, clc$list_type], [377, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$keyword_type], [10], [
        ['C                              ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
        ['COMPLETED                      ', clc$nominal_entry, clc$normal_usage_entry, 5],
        ['D                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['DEFERRED                       ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['I                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['INITIATED                      ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['Q                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['QUEUED                         ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['T                              ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
        ['TERMINATED                     ', clc$nominal_entry, clc$normal_usage_entry, 4]]
        ]
      ]
    ],
{ PARAMETER 22
    [[1, 0, clc$list_type], [8, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$string_type], [0, jmc$remote_host_directive_size, FALSE]]
    ],
{ PARAMETER 23
    [[1, 0, clc$list_type], [8, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$string_type], [0, jmc$output_routing_banner_size, FALSE]]
    ],
{ PARAMETER 24
    [[1, 0, clc$list_type], [8, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$string_type], [0, jmc$site_information_size, FALSE]]
    ],
{ PARAMETER 25
    [[1, 0, clc$list_type], [69, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type],
      FALSE, 2],
      44, [[1, 0, clc$keyword_type], [1], [
        ['AUTOMATIC                      ', clc$nominal_entry, clc$normal_usage_entry, 1]]
        ],
      5, [[1, 0, clc$name_type], [1, osc$max_name_size]]
      ]
    ],
{ PARAMETER 26
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 27
    [[1, 0, clc$list_type], [8, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$string_type], [0, jmc$user_information_size, FALSE]]
    ],
{ PARAMETER 28
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 29
    [[1, 0, clc$list_type], [118, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$keyword_type], [3], [
      ['EIGHT                          ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['SIX                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ]
    ],
{ PARAMETER 30
    [[1, 0, clc$list_type], [69, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[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 31
    [[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, jmc$maximum_output_count, 10]]
    ,
    'all'],
{ PARAMETER 32
    [[1, 0, clc$keyword_type], [3], [
    ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['C                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['CURRENT                        ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ,
    'current'],
{ PARAMETER 33
    [[1, 0, clc$list_type], [5, 0, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ,
    'jmv$selected_output'],
{ PARAMETER 34
    [[1, 0, clc$status_type]]];

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

    CONST
      p$comment_banner = 1,
      p$control_family = 2,
      p$control_user = 3,
      p$data_mode = 4,
      p$device = 5,
      p$external_characteristics = 6,
      p$forms_code = 7,
      p$login_account = 8,
      p$login_family = 9,
      p$login_project = 10,
      p$login_user = 11,
      p$name = 12,
      p$operator_family = 13,
      p$operator_user = 14,
      p$output_class = 15,
      p$output_deferred_by_operator = 16,
      p$output_deferred_by_user = 17,
      p$output_destination = 18,
      p$output_destination_usage = 19,
      p$output_priority = 20,
      p$output_state = 21,
      p$remote_host_directive = 22,
      p$routing_banner = 23,
      p$site_information = 24,
      p$station = 25,
      p$system_job_name = 26,
      p$user_information = 27,
      p$user_job_name = 28,
      p$vertical_print_density = 29,
      p$vfu_load_procedure = 30,
      p$maximum_selection = 31,
      p$mainframe = 32,
      p$output_selection_list = 33,
      p$status = 34;

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

    VAR
      attribute_count: clt$parameter_count,
      attribute_found: boolean,
      external_characteristics: string (jmc$ext_characteristics_size),
      forms_code: string (jmc$forms_code_size),
      i: ost$non_negative_integers,
      job_name: jmt$name,
      list_value: ^clt$data_value,
      maximum_selection: 1 .. jmc$maximum_output_count,
      name_found: boolean,
      number_of_names: ost$non_negative_integers,
      number_of_outputs_found: jmt$output_status_count,
      number_of_outputs_selected: 0 .. jmc$maximum_output_count,
      output_attribute_options_p: ^jmt$output_attribute_options,
      output_attribute_results_keys_p: ^jmt$results_keys,
      output_attribute_results_p: ^jmt$output_attribute_results,
      output_destination: ost$name,
      output_index: ost$non_negative_integers,
      output_matches_criteria: boolean,
      output_selection_list: ^clt$data_value,
      output_state: jmt$output_state,
      parameter_index: clt$parameter_count,
      valid_name: jmt$name,
      value: ^clt$data_value;

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

{ Push one attribute and one result key for each selectable attribute.  The parameter
{ maximum_selection is the first non-selectable attribute parameter.

    attribute_count := p$maximum_selection - 1;
    PUSH output_attribute_options_p: [1 .. attribute_count + 1];
    PUSH output_attribute_results_keys_p: [1 .. attribute_count];

{ Using the items specified as selection items, build a set of "search" criteria
{ for the jmp$get_output_attributes request.  Using the other specified items as
{ "requested" information, call the interface jmp$get_output_attributes.  This
{ returns an array of output file's with their attributes.
{ NOTE:
{   A subset of the select_output selection parameters is used as search criteria
{ on the jmp$get_output_attributes request as a performance measure.  This way,
{ the fewest number of files need to be attached within the request.

    RESET work_area.sequence_pointer;

    number_of_names := 0;

    FOR parameter_index := 1 TO attribute_count DO
      output_attribute_options_p^ [parameter_index].key := jmc$null_attribute;
      output_attribute_results_keys_p^ [parameter_index] := jmc$null_attribute;
      IF pvt [parameter_index].specified THEN
        CASE parameter_index OF
        = p$comment_banner =
          output_attribute_results_keys_p^ [parameter_index] := jmc$comment_banner;

        = p$control_family =
          IF clp$count_list_elements (pvt [parameter_index].value) = 1 THEN
            output_attribute_options_p^ [parameter_index].key := jmc$control_family;
            output_attribute_options_p^ [parameter_index].control_family :=
                  pvt [parameter_index].value^.element_value^.name_value;
          ELSE
            output_attribute_results_keys_p^ [parameter_index] := jmc$control_family;
          IFEND;

        = p$control_user =
          IF clp$count_list_elements (pvt [parameter_index].value) = 1 THEN
            output_attribute_options_p^ [parameter_index].key := jmc$control_user;
            output_attribute_options_p^ [parameter_index].control_user :=
                  pvt [parameter_index].value^.element_value^.name_value;
          ELSE
            output_attribute_results_keys_p^ [parameter_index] := jmc$control_user;
          IFEND;

        = p$data_mode =
          output_attribute_results_keys_p^ [parameter_index] := jmc$data_mode;

        = p$device =
          output_attribute_results_keys_p^ [parameter_index] := jmc$device;

        = p$external_characteristics =
          output_attribute_results_keys_p^ [parameter_index] := jmc$external_characteristics;

        = p$forms_code =
          output_attribute_results_keys_p^ [parameter_index] := jmc$forms_code;

        = p$login_account =
          output_attribute_results_keys_p^ [parameter_index] := jmc$login_account;

        = p$login_family =
          IF clp$count_list_elements (pvt [parameter_index].value) = 1 THEN
            output_attribute_options_p^ [parameter_index].key := jmc$login_family;
            output_attribute_options_p^ [parameter_index].login_family :=
                  pvt [parameter_index].value^.element_value^.name_value;
          ELSE
            output_attribute_results_keys_p^ [parameter_index] := jmc$login_family;
          IFEND;

        = p$login_project =
          output_attribute_results_keys_p^ [parameter_index] := jmc$login_project;

        = p$login_user =
          IF clp$count_list_elements (pvt [parameter_index].value) = 1 THEN
            output_attribute_options_p^ [parameter_index].key := jmc$login_user;
            output_attribute_options_p^ [parameter_index].login_user :=
                  pvt [parameter_index].value^.element_value^.name_value;
          ELSE
            output_attribute_results_keys_p^ [parameter_index] := jmc$login_user;
          IFEND;

        = p$name =
          number_of_names := clp$count_list_elements (pvt [p$name].value);
          output_attribute_options_p^ [parameter_index].key := jmc$name_list;
          PUSH output_attribute_options_p^ [parameter_index].name_list: [1 .. number_of_names];

          value := pvt [p$name].value;
          FOR i := 1 TO number_of_names DO
            jmp$determine_name_kind (value^.element_value^.name_value,
                  output_attribute_options_p^ [parameter_index].name_list^ [i], status);
            IF NOT status.normal THEN
              RETURN;
            IFEND;
            value := value^.link;
          FOREND;

        = p$operator_family =
          output_attribute_results_keys_p^ [parameter_index] := jmc$output_destination_family;

        = p$operator_user =
          output_attribute_results_keys_p^ [parameter_index] := jmc$station_operator;

        = p$output_class =
          output_attribute_results_keys_p^ [parameter_index] := jmc$output_class;

        = p$output_deferred_by_operator =
          output_attribute_options_p^ [parameter_index].key := jmc$output_deferred_by_operator;
          output_attribute_options_p^ [parameter_index].output_deferred_by_operator :=
                pvt [parameter_index].value^.boolean_value.value;

        = p$output_deferred_by_user =
          output_attribute_options_p^ [parameter_index].key := jmc$output_deferred_by_user;
          output_attribute_options_p^ [parameter_index].output_deferred_by_user := pvt [parameter_index].
                value^.boolean_value.value;

        = p$output_destination =
          output_attribute_results_keys_p^ [parameter_index] := jmc$output_destination;

        = p$output_destination_usage =
          IF clp$count_list_elements (pvt [parameter_index].value) = 1 THEN
            output_attribute_options_p^ [parameter_index].key := jmc$output_destination_usage;
            output_attribute_options_p^ [parameter_index].output_destination_usage :=
                  pvt [parameter_index].value^.element_value^.name_value;
          ELSE
            output_attribute_results_keys_p^ [parameter_index] := jmc$output_destination_usage;
          IFEND;

        = p$output_priority =
          output_attribute_results_keys_p^ [parameter_index] := jmc$output_priority;

        = p$output_state =

{ If the keyword ALL was specified for output_state there is no need to get the attribute value.

          IF pvt [p$output_state].value^.kind = clc$list THEN
            output_attribute_options_p^ [parameter_index].key := jmc$output_state_set;
            output_attribute_options_p^ [parameter_index].output_state_set := $jmt$output_state_set [];
            FOR output_state := LOWERVALUE (jmt$output_state) TO UPPERVALUE (jmt$output_state) DO
              value := pvt [p$output_state].value;
              WHILE (value <> NIL) AND (output_state_names [output_state] <>
                    value^.element_value^.name_value) DO
                value := value^.link;
              WHILEND;
              IF (value <> NIL) THEN
                output_attribute_options_p^ [parameter_index].output_state_set :=
                      output_attribute_options_p^ [parameter_index].output_state_set +
                      $jmt$output_state_set [output_state];
              IFEND;
            FOREND;
          IFEND;

        = p$remote_host_directive =
          output_attribute_results_keys_p^ [parameter_index] := jmc$remote_host_directive;

        = p$routing_banner =
          output_attribute_results_keys_p^ [parameter_index] := jmc$routing_banner;

        = p$site_information =
          output_attribute_results_keys_p^ [parameter_index] := jmc$site_information;

        = p$station =
          output_attribute_results_keys_p^ [parameter_index] := jmc$station;

        = p$system_job_name =
          IF clp$count_list_elements (pvt [parameter_index].value) = 1 THEN
            output_attribute_options_p^ [parameter_index].key := jmc$system_job_name;
            output_attribute_options_p^ [parameter_index].system_job_name :=
                  pvt [parameter_index].value^.element_value^.name_value;
          ELSE
            output_attribute_results_keys_p^ [parameter_index] := jmc$system_job_name;
          IFEND;

        = p$user_information =
          output_attribute_results_keys_p^ [parameter_index] := jmc$user_information;

        = p$user_job_name =
          IF clp$count_list_elements (pvt [parameter_index].value) = 1 THEN
            output_attribute_options_p^ [parameter_index].key := jmc$user_job_name;
            output_attribute_options_p^ [parameter_index].user_job_name :=
                  pvt [parameter_index].value^.element_value^.name_value;
          ELSE
            output_attribute_results_keys_p^ [parameter_index] := jmc$user_job_name;
          IFEND;

        = p$vertical_print_density =
          output_attribute_results_keys_p^ [parameter_index] := jmc$vertical_print_density;

        = p$vfu_load_procedure =
          output_attribute_results_keys_p^ [parameter_index] := jmc$vfu_load_procedure;


        ELSE
        CASEND;
      IFEND;
    FOREND;

{ The system file name must always be returned.

    output_attribute_results_keys_p^ [p$name] := jmc$system_file_name;
    output_attribute_options_p^ [attribute_count + 1].key := jmc$continue_request_to_servers;
    IF pvt [p$mainframe].value^.keyword_value = 'CURRENT' THEN
      output_attribute_options_p^ [attribute_count + 1].continue_request_to_servers := FALSE;
    ELSE
      output_attribute_options_p^ [attribute_count + 1].continue_request_to_servers := TRUE;
    IFEND;

    jmp$get_output_attributes (output_attribute_options_p, output_attribute_results_keys_p,
          work_area.sequence_pointer, output_attribute_results_p, number_of_outputs_found, status);

    IF NOT status.normal THEN
      IF status.condition = jme$no_outputs_were_found THEN
        status.normal := TRUE;
        number_of_outputs_found := 0;
      ELSE
        RETURN;
      IFEND;
    IFEND;

{ Using the results of the above request, test each "requested" information value
{ against the appropriate select_output selection parameter.  If the output file's
{ value and the parameter value(s) agree for each criteria specified, add the file
{ to the output selection list.  Otherwise, skip the file and go to the next one.

    maximum_selection := jmc$maximum_output_count;
    IF pvt [p$maximum_selection].specified AND (pvt [p$maximum_selection].value^.kind = clc$integer) THEN
      maximum_selection := pvt [p$maximum_selection].value^.integer_value.value;
    IFEND;
    number_of_outputs_selected := 0;

    NEXT output_selection_list IN work_area.sequence_pointer;
    output_selection_list^.kind := clc$list;
    output_selection_list^.element_value := NIL;
    output_selection_list^.link := NIL;
    output_selection_list^.generated_via_list_rest := FALSE;
    list_value := output_selection_list;

  /select_output_from_list/
    FOR output_index := 1 TO number_of_outputs_found DO
      output_matches_criteria := TRUE;

    /compare_output_attributes/
      FOR parameter_index := 1 TO attribute_count DO
        IF (pvt [parameter_index].specified) AND (output_attribute_results_keys_p^ [parameter_index] <>
              jmc$null_attribute) THEN
          CASE parameter_index OF
          = p$comment_banner =
            value := pvt [p$comment_banner].value;
            WHILE (value <> NIL) AND (output_attribute_results_p^ [output_index]^ [parameter_index].
                  comment_banner <> value^.element_value^.string_value^) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$control_family =
            value := pvt [p$control_family].value;
            WHILE (value <> NIL) AND (output_attribute_results_p^ [output_index]^ [parameter_index].
                  control_family <> value^.element_value^.name_value) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$control_user =
            value := pvt [p$control_user].value;
            WHILE (value <> NIL) AND (output_attribute_results_p^ [output_index]^ [parameter_index].
                  control_user <> value^.element_value^.name_value) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$data_mode =
            value := pvt [p$data_mode].value;
            WHILE (value <> NIL) AND (data_mode_names [output_attribute_results_p^ [output_index]^
                  [parameter_index].data_mode] <> value^.element_value^.keyword_value) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$device =
            value := pvt [p$device].value;
            attribute_found := FALSE;
            WHILE (value <> NIL) AND (NOT attribute_found) DO
              IF value^.element_value^.kind = clc$name THEN
                attribute_found := (output_attribute_results_p^ [output_index]^ [parameter_index].device =
                      value^.element_value^.name_value);
              ELSE {value^.element_value^.kind = clc$keyword
                attribute_found := (output_attribute_results_p^ [output_index]^ [parameter_index].device =
                      value^.element_value^.keyword_value);
              IFEND;

              value := value^.link;
            WHILEND;
            IF NOT attribute_found THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$external_characteristics =
            value := pvt [p$external_characteristics].value;
            attribute_found := FALSE;
            WHILE (value <> NIL) AND (NOT attribute_found) DO
              IF value^.element_value^.kind = clc$string THEN
                #TRANSLATE (osv$lower_to_upper, value^.element_value^.string_value^,
                      external_characteristics);
                attribute_found := (output_attribute_results_p^ [output_index]^ [parameter_index].
                      external_characteristics = external_characteristics);
              ELSE {value^.element_value^.kind = clc$keyword
                attribute_found := (output_attribute_results_p^ [output_index]^ [parameter_index].
                      external_characteristics = value^.element_value^.keyword_value);
              IFEND;

              value := value^.link;
            WHILEND;
            IF NOT attribute_found THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$forms_code =
            value := pvt [p$forms_code].value;
            attribute_found := FALSE;
            WHILE (value <> NIL) AND (NOT attribute_found) DO
              IF value^.element_value^.kind = clc$string THEN
                #TRANSLATE (osv$lower_to_upper, value^.element_value^.string_value^, forms_code);
                attribute_found := (output_attribute_results_p^ [output_index]^ [parameter_index].forms_code =
                      forms_code);
              ELSE {value^.element_value^.kind = clc$keyword
                attribute_found := (output_attribute_results_p^ [output_index]^ [parameter_index].forms_code =
                      value^.element_value^.keyword_value);
              IFEND;

              value := value^.link;
            WHILEND;
            IF NOT attribute_found THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$login_account =
            value := pvt [p$login_account].value;
            WHILE (value <> NIL) AND (output_attribute_results_p^ [output_index]^ [parameter_index].
                  login_account <> value^.element_value^.name_value) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$login_family =
            value := pvt [p$login_family].value;
            WHILE (value <> NIL) AND (output_attribute_results_p^ [output_index]^ [parameter_index].
                  login_family <> value^.element_value^.name_value) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$login_project =
            value := pvt [p$login_project].value;
            WHILE (value <> NIL) AND (output_attribute_results_p^ [output_index]^ [parameter_index].
                  login_project <> value^.element_value^.name_value) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$login_user =
            value := pvt [p$login_user].value;
            WHILE (value <> NIL) AND (output_attribute_results_p^ [output_index]^ [parameter_index].
                  login_user <> value^.element_value^.name_value) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$operator_family =
            value := pvt [p$operator_family].value;
            WHILE (value <> NIL) AND (output_attribute_results_p^ [output_index]^ [parameter_index].
                  output_destination_family <> value^.element_value^.name_value) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$operator_user =
            value := pvt [p$operator_user].value;
            WHILE (value <> NIL) AND (output_attribute_results_p^ [output_index]^ [parameter_index].
                  station_operator <> value^.element_value^.name_value) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$output_class =
            value := pvt [p$output_class].value;
            WHILE (value <> NIL) AND (output_attribute_results_p^ [output_index]^ [parameter_index].
                  output_class <> value^.element_value^.name_value) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$output_destination =
            value := pvt [p$output_destination].value;
            attribute_found := FALSE;
            WHILE (value <> NIL) AND (NOT attribute_found) DO
              IF value^.element_value^.kind = clc$string THEN
                #TRANSLATE (osv$lower_to_upper, value^.element_value^.string_value^, output_destination);
                attribute_found := (output_attribute_results_p^ [output_index]^ [parameter_index].
                      output_destination = output_destination);
              ELSE {value^.element_value^.kind = clc$name
                attribute_found := (output_attribute_results_p^ [output_index]^ [parameter_index].
                      output_destination = value^.element_value^.name_value);
              IFEND;

              value := value^.link;
            WHILEND;
            IF NOT attribute_found THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$output_destination_usage =
            value := pvt [p$output_destination_usage].value;
            attribute_found := FALSE;
            WHILE (value <> NIL) AND (NOT attribute_found) DO
              IF value^.element_value^.kind = clc$name THEN
                attribute_found := (output_attribute_results_p^ [output_index]^ [parameter_index].
                      output_destination_usage = value^.element_value^.name_value);
              ELSE {value^.element_value^.kind = clc$keyword
                attribute_found := (output_attribute_results_p^ [output_index]^ [parameter_index].
                      output_destination_usage = value^.element_value^.keyword_value);
              IFEND;

              value := value^.link;
            WHILEND;
            IF NOT attribute_found THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$output_priority =
            value := pvt [p$output_priority].value;
            WHILE (value <> NIL) AND (output_attribute_results_p^ [output_index]^ [parameter_index].
                  output_priority <> value^.element_value^.name_value) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$remote_host_directive =
            value := pvt [p$remote_host_directive].value;
            WHILE (value <> NIL) AND (output_attribute_results_p^ [output_index]^ [parameter_index].
                  remote_host_directive^.parameters <> value^.element_value^.string_value^) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$routing_banner =
            value := pvt [p$routing_banner].value;
            WHILE (value <> NIL) AND (output_attribute_results_p^ [output_index]^ [parameter_index].
                  routing_banner <> value^.element_value^.string_value^) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$site_information =
            value := pvt [p$site_information].value;
            WHILE (value <> NIL) AND (output_attribute_results_p^ [output_index]^ [parameter_index].
                  site_information^ <> value^.element_value^.string_value^) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$station =
            value := pvt [p$station].value;
            attribute_found := FALSE;
            WHILE (value <> NIL) AND (NOT attribute_found) DO
              IF value^.element_value^.kind = clc$name THEN
                attribute_found := (output_attribute_results_p^ [output_index]^ [parameter_index].station =
                      value^.element_value^.name_value);
              ELSE {value^.element_value^.kind = clc$keyword
                attribute_found := (output_attribute_results_p^ [output_index]^ [parameter_index].station =
                      value^.element_value^.keyword_value);
              IFEND;

              value := value^.link;
            WHILEND;
            IF NOT attribute_found THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$system_job_name =
            value := pvt [p$system_job_name].value;
            name_found := FALSE;
            WHILE (value <> NIL) AND (NOT name_found) DO
              job_name.kind := jmc$system_supplied_name;
              job_name.system_supplied_name := value^.element_value^.name_value;
              jmp$validate_name (job_name, valid_name, status);
              IF NOT status.normal THEN
                RETURN;
              IFEND;

              name_found := (output_attribute_results_p^ [output_index]^ [parameter_index].system_job_name =
                    valid_name.system_supplied_name);
              value := value^.link;
            WHILEND;
            IF NOT name_found THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$user_information =
            value := pvt [p$user_information].value;
            WHILE (value <> NIL) AND (output_attribute_results_p^ [output_index]^ [parameter_index].
                  user_information^ <> value^.element_value^.string_value^) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$user_job_name =
            value := pvt [p$user_job_name].value;
            name_found := FALSE;
            WHILE (value <> NIL) AND (NOT name_found) DO
              job_name.kind := jmc$user_supplied_name;
              job_name.user_supplied_name := value^.element_value^.name_value;
              jmp$validate_name (job_name, valid_name, status);
              IF NOT status.normal THEN
                RETURN;
              IFEND;

              name_found := (output_attribute_results_p^ [output_index]^ [parameter_index].user_job_name =
                    valid_name.user_supplied_name);
              value := value^.link;
            WHILEND;
            IF NOT name_found THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$vertical_print_density =
            value := pvt [p$vertical_print_density].value;
            CASE output_attribute_results_p^ [output_index]^ [parameter_index].vertical_print_density OF
            = jmc$vertical_print_density_none =
              WHILE (value <> NIL) AND (value^.element_value^.keyword_value <> 'NONE') DO
                value := value^.link;
              WHILEND;

            = jmc$vertical_print_density_6 =
              WHILE (value <> NIL) AND (value^.element_value^.keyword_value <> 'SIX') DO
                value := value^.link;
              WHILEND;

            = jmc$vertical_print_density_8 =
              WHILE (value <> NIL) AND (value^.element_value^.keyword_value <> 'EIGHT') DO
                value := value^.link;
              WHILEND;

            ELSE
              ;

            CASEND;
            IF value = NIL THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          = p$vfu_load_procedure =
            value := pvt [p$vfu_load_procedure].value;
            attribute_found := FALSE;
            WHILE (value <> NIL) AND (NOT attribute_found) DO
              IF value^.element_value^.kind = clc$name THEN
                attribute_found := (output_attribute_results_p^ [output_index]^ [parameter_index].
                      vfu_load_procedure = value^.element_value^.name_value);
              ELSE {value^.element_value^.kind = clc$keyword
                attribute_found := (output_attribute_results_p^ [output_index]^ [parameter_index].
                      vfu_load_procedure = osc$null_name);
              IFEND;

              value := value^.link;
            WHILEND;
            IF NOT attribute_found THEN
              output_matches_criteria := FALSE;
              EXIT /compare_output_attributes/;
            IFEND;

          ELSE
            ;

          CASEND;
        IFEND;
      FOREND /compare_output_attributes/;
      IF output_matches_criteria THEN
        number_of_outputs_selected := number_of_outputs_selected + 1;

        IF list_value^.element_value <> NIL THEN
          NEXT list_value^.link IN work_area.sequence_pointer;
          list_value := list_value^.link;
          list_value^.kind := clc$list;
        IFEND;

        NEXT list_value^.element_value IN work_area.sequence_pointer;
        list_value^.element_value^.kind := clc$name;
        list_value^.element_value^.name_value := output_attribute_results_p^ [output_index]^ [p$name].
              system_file_name;
        list_value^.link := NIL;
        list_value^.generated_via_list_rest := FALSE;

        IF number_of_outputs_selected = maximum_selection THEN
          EXIT /select_output_from_list/;
        IFEND;
      IFEND;
    FOREND /select_output_from_list/;

    clp$change_variable (pvt [p$output_selection_list].variable^, output_selection_list, status);
  PROCEND select_output;
*copy clp$new_page_procedure
?? OLDTITLE ??
MODEND jmm$manage_output_utility;
