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

{ PURPOSE:
{   This module contains the command and subcommands for the NOS/VE Manage
{ Job Utility.  The utility is used to manage Jobs 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 jmc$job_management_id
*copyc jmc$system_family
*copyc osd$integer_limits
*copyc jme$job_history_conditions
*copyc jme$queued_file_conditions
*copyc clt$parameter_list
*copyc ost$status
?? POP ??
*copyc avp$system_administrator
*copyc avp$system_operator
*copyc clp$begin_utility
*copyc clp$build_pattern_for_wild_card
*copyc clp$build_standard_title
*copyc clp$change_variable
*copyc clp$close_display
*copyc clp$convert_integer_to_string
*copyc clp$convert_string_to_file
*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$match_string_pattern
*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_job
*copyc jmp$determine_name_kind
*copyc jmp$get_input_attributes
*copyc jmp$get_job_counts
*copyc jmp$get_job_path_elements
*copyc jmp$get_job_status
*copyc jmp$log_restored_job
*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_family_names
*copyc pmp$get_legible_date_time
*copyc clv$value_descriptors
?? OLDTITLE ??
?? NEWTITLE := 'Global Declarations Declared By This Module', EJECT ??

*copy clv$display_variables

  SECTION
    read_only: READ;

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

  CONST
    utility_prompt_length = 2,
    utility_prompt = 'MJ';

  TYPE
    t$job_mode = (c$jm_batch, c$jm_interactive, c$jm_interactive_disconnected,
          c$jm_interactive_cmd_disconnect, c$jm_interactive_lne_disconnect, c$jm_interactive_sys_disconnect),
    t$job_mode_info = record
      name: string (30),
      values: jmt$job_mode_set,
    recend;

  CONST
    c$control_family = 1,
    c$control_user = 2,
    c$job_category_name = 3,
    c$job_class = 4,
    c$job_deferred_by_operator = 5,
    c$job_deferred_by_user = 6,
    c$job_qualifier = 7,
    c$job_mode = 8,
    c$job_state = 9,
    c$login_account = 10,
    c$login_family = 11,
    c$login_project = 12,
    c$login_user = 13,
    c$name = 14,
    c$display_message = 15,
    c$site_information = 16,
    c$user_information = 17,
    c$maximum_selection = 18,
    c$mainframe = 19;

  TYPE
    t$select_job_param_value_kind = c$control_family .. c$mainframe,
    t$select_job_parameter_values = array [t$select_job_param_value_kind] of clt$parameter_value;

  VAR
    v$job_mode_info: [STATIC, READ, read_only] array [t$job_mode] of t$job_mode_info := [
{ } ['BATCH                         ', $jmt$job_mode_set [jmc$batch]],
{ } ['INTERACTIVE_CONNECTED         ', $jmt$job_mode_set [jmc$interactive_connected]],
{ } ['INTERACTIVE_DISCONNECTED      ', -$jmt$job_mode_set [jmc$batch, jmc$interactive_connected]],
{ } ['INTERACTIVE_COMMAND_DISCONNECT', $jmt$job_mode_set [jmc$interactive_cmnd_disconnect]],
{ } ['INTERACTIVE_LINE_DISCONNECT   ', $jmt$job_mode_set [jmc$interactive_line_disconnect]],
{ } ['INTERACTIVE_SYSTEM_DISCONNECT ', $jmt$job_mode_set [jmc$interactive_sys_disconnect]]];

  VAR
    job_state_names: [STATIC, READ, read_only] array [jmt$job_state] of string (10) := ['DEFERRED', 'QUEUED',
          'INITIATED', 'TERMINATED', 'COMPLETED'],
    utility_name: [STATIC, READ, read_only] clt$utility_name := 'manage_job',
    work_area: amt$segment_pointer;

  VAR
    display_control: 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;

{ table name=manage_job_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_job                     , select_jobs, selj) p=select_job cm=local
{ tablend

?? PUSH (LISTEXT := ON) ??

  VAR
    manage_job_commands: [STATIC, READ, read_only] ^clt$command_table := ^manage_job_commands_entries,

    manage_job_commands_entries: [STATIC, READ, read_only] array [1 .. 8] 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_JOB                     ', clc$nominal_entry, clc$normal_usage_entry, 3,
          clc$automatically_log, clc$linked_call, ^select_job],
          {} ['SELECT_JOBS                    ', clc$alias_entry, clc$normal_usage_entry, 3,
          clc$automatically_log, clc$linked_call, ^select_job],
          {} ['SELJ                           ', clc$abbreviation_entry, clc$normal_usage_entry, 3,
          clc$automatically_log, clc$linked_call, ^select_job]];

?? POP ??

{ table name=operator_manj_commands type=command section_name=read_only scope=local
{ command activate_job_files p=activate_job_files cm=local
{ command (change_list_options            , change_list_option, chalo) p=change_list_options cm=local
{ command log_restored_job_files p=log_restored_job_files cm=local
{ command (quit                           , qui) p=quit cm=local
{ command (select_job                     , select_jobs, selj) p=select_job cm=local
{ tablend

?? PUSH (LISTEXT := ON) ??

  VAR
    operator_manj_commands: [STATIC, READ, read_only] ^clt$command_table := ^operator_manj_commands_entries,

    operator_manj_commands_entries: [STATIC, READ, read_only] array [1 .. 10] of clt$command_table_entry := [
          {} ['ACTIVATE_JOB_FILES             ', clc$nominal_entry, clc$normal_usage_entry, 1,
          clc$automatically_log, clc$linked_call, ^activate_job_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],
          {} ['LOG_RESTORED_JOB_FILES         ', clc$nominal_entry, clc$normal_usage_entry, 3,
          clc$automatically_log, clc$linked_call, ^log_restored_job_files],
          {} ['QUI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 4,
          clc$automatically_log, clc$linked_call, ^quit],
          {} ['QUIT                           ', clc$nominal_entry, clc$normal_usage_entry, 4,
          clc$automatically_log, clc$linked_call, ^quit],
          {} ['SELECT_JOB                     ', clc$nominal_entry, clc$normal_usage_entry, 5,
          clc$automatically_log, clc$linked_call, ^select_job],
          {} ['SELECT_JOBS                    ', clc$alias_entry, clc$normal_usage_entry, 5,
          clc$automatically_log, clc$linked_call, ^select_job],
          {} ['SELJ                           ', clc$abbreviation_entry, clc$normal_usage_entry, 5,
          clc$automatically_log, clc$linked_call, ^select_job]];

?? POP ??

{ table name=sys_admin_functions type=function section_name=read_only scope=local
{ function $queued_job_path p=queued_job_path cm=local
{ function $selected_jobs p=p$$selected_jobs 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 .. 2] of
          clt$function_proc_table_entry := [
          {} ['$QUEUED_JOB_PATH               ', clc$nominal_entry, clc$normal_usage_entry, 1,
          clc$linked_call, ^queued_job_path],
          {} ['$SELECTED_JOBS                 ', clc$nominal_entry, clc$normal_usage_entry, 2,
          clc$linked_call, ^p$$selected_jobs]];

?? POP ??

{ table name=manj_functions type=function section_name=read_only scope=local
{ function $selected_jobs p=p$$selected_jobs cm=local
{ tablend

?? PUSH (LISTEXT := ON) ??

  VAR
    manj_functions: [STATIC, READ, read_only] ^clt$function_processor_table := ^manj_functions_entries,

    manj_functions_entries: [STATIC, READ, read_only] array [1 .. 1] of clt$function_proc_table_entry := [
          {} ['$SELECTED_JOBS                 ', clc$nominal_entry, clc$normal_usage_entry, 1,
          clc$linked_call, ^p$$selected_jobs]];

?? POP ??

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

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

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

{ PROCEDURE (jmm$manj) manage_job, manage_jobs, manj (
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 1] of clt$pdt_parameter_name,
      parameters: array [1 .. 1] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [104, 9, 28, 11, 44, 6, 553],
    clc$command, 1, 1, 0, 0, 0, 0, 1, 'JMM$MANJ'], [
    ['STATUS                         ',clc$nominal_entry, 1]],
    [
{ PARAMETER 1
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$status_type]]];

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

    CONST
      p$status = 1;

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

{ TYPE
{   selected_jobs_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 (18),
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend := [[1, 18, clc$list_type], 'SELECTED_JOBS_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;

    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 ();

    PUSH utility_attributes_p: [1 .. 5];
    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_manj_commands;
    ELSE
      utility_attributes_p^ [2].command_table := manage_job_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;
    ELSE
      utility_attributes_p^ [5].key := clc$utility_function_proc_table;
      utility_attributes_p^ [5].function_processor_table := manj_functions;
    IFEND;

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

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

    clp$create_environment_variable ('JMV$SELECTED_JOBS', 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;

    clp$end_utility (utility_name, status);

  PROCEND jmp$manage_job_utility;
?? NEWTITLE := 'activate_job_files', EJECT ??

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

{ procedure (jmm$manj_actjf) activate_job_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, 15, 900],
    clc$command, 3, 2, 0, 0, 0, 1, 2, 'JMM$MANJ_ACTJF'], [
    ['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 = 3,
      ri_system_job_name = 1,
      ri_input_file_location = 2,
      ri_login_family = 3;

    VAR
      catalog_segment_pointer: amt$segment_pointer,
      cycle_selector: pft$cycle_selector,
      family_index: pmt$family_name_count,
      family_name_count: pmt$family_name_count,
      family_name_list: ^pmt$family_name_list,
      file_count: 0 .. clc$max_list_size,
      files_activated: ^clt$data_value,
      ignore_status: ost$status,
      known_job_count: jmt$job_count_range,
      known_jobs_p: ^jmt$job_status_results,
      list_value: ^clt$data_value,
      local_status: ost$status,
      path_p: ^pft$path,
      status_options_p: ^jmt$job_status_options,
      status_results_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_input_queue', EJECT ??

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

    PROCEDURE recover_input_queue
      (    family_name: ost$name;
           subcatalog_name: ost$name;
           known_jobs_p: ^jmt$job_status_results;
           known_jobs_count: jmt$job_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_job_index: jmt$job_count_range,
        local_status: ost$status,
        name_index: pft$array_index,
        path_p: ^pft$path,
        system_job_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] := family_name;
      path_p^ [pfc$master_catalog_name_index] := jmc$system_user;
      path_p^ [pfc$subcatalog_name_index] := subcatalog_name;

{ Read the job input 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 input queue.
      IF directory_array_p <> NIL THEN

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

          system_job_name := directory_array_p^ [name_index].name;

{ Check to see if the job is already known to the system.
          search_known_jobs (system_job_name, known_jobs_p, known_jobs_count, known_job_index);
          IF known_job_index <> 0 THEN
            CASE known_jobs_p^ [known_job_index]^ [ri_input_file_location].input_file_location OF

            = jmc$ifl_login_family_queue =
              IF (family_name = known_jobs_p^ [known_job_index]^ [ri_login_family].login_family) AND
                    (subcatalog_name <> jmc$sf_job_input_catalog) THEN
                CYCLE /recover_all_files/; {----->
              IFEND;

            = jmc$ifl_store_and_forward_queue =
              IF subcatalog_name = jmc$sf_job_input_catalog THEN
                CYCLE /recover_all_files/; {----->
              IFEND;

            = jmc$ifl_system_input_queue =
              IF (family_name = jmc$system_family) AND (subcatalog_name <> jmc$sf_job_input_catalog) THEN
                CYCLE /recover_all_files/; {----->
              IFEND;

            = jmc$ifl_no_input_file_exists =
              ;

            ELSE
              ;

            CASEND;

            osp$set_status_abnormal (jmc$job_management_id, jme$input_was_not_recovered, system_job_name,
                  local_status);
            display_status_error (local_status, ignore_status);
            CYCLE /recover_all_files/; {----->
          IFEND;

{ The job is not in the KJL.  Try to recover the command file.
          jmp$activate_job (system_job_name, family_name, subcatalog_name, {recover_using_abort_disposition}
                FALSE, {ignore_client_initiated_jobs} TRUE, 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_job_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$input_was_not_recovered, system_job_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_input_queue;
?? OLDTITLE ??
?? NEWTITLE := 'search_known_jobs', EJECT ??

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

    PROCEDURE search_known_jobs
      (    system_job_name: jmt$system_supplied_name;
           known_jobs_p: ^jmt$job_status_results;
           known_jobs_count: jmt$job_count_range;
       VAR position: jmt$job_count_range);

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

      lower := 1;
      upper := known_jobs_count;

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

    PROCEND search_known_jobs;
?? OLDTITLE ??
?? NEWTITLE := 'sort_known_jobs', EJECT ??

    PROCEDURE sort_known_jobs
      (    known_jobs_p: ^jmt$job_status_results;
           known_jobs_count: jmt$job_count_range);

      VAR
        gap: integer,
        start: integer,
        current: integer,
        swap: array [ri_system_job_name .. ri_login_family] of jmt$job_status_result;

{ Use shell sort technique.

      gap := known_jobs_count;
      WHILE gap > 1 DO
        gap := 2 * (gap DIV 4) + 1;
        FOR start := 1 TO known_jobs_count - gap DO
          current := start;
          WHILE (current > 0) AND (known_jobs_p^ [current]^ [ri_system_job_name].system_job_name >
                known_jobs_p^ [current + gap]^ [ri_system_job_name].system_job_name) DO
            swap := known_jobs_p^ [current]^;
            known_jobs_p^ [current]^ := known_jobs_p^ [current + gap]^;
            known_jobs_p^ [current + gap]^ := swap;
            current := current - gap;
          WHILEND;
        FOREND;
      WHILEND;
    PROCEND sort_known_jobs;
?? OLDTITLE ??
?? EJECT ??
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

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

{ Build a list of the known jobs on this system/cluster.
    PUSH status_options_p: [1 .. 1];
    status_options_p^ [1].key := jmc$continue_request_to_servers;
    status_options_p^ [1].continue_request_to_servers := TRUE;

    PUSH status_results_keys_p: [ri_system_job_name .. ri_login_family];
    status_results_keys_p^ [ri_system_job_name] := jmc$system_job_name;
    status_results_keys_p^ [ri_input_file_location] := jmc$input_file_location;
    status_results_keys_p^ [ri_login_family] := jmc$login_family;

    RESET work_area.sequence_pointer;

    jmp$get_job_status (status_options_p, status_results_keys_p, work_area.sequence_pointer, known_jobs_p,
          known_job_count, status);
    IF NOT status.normal THEN
      IF status.condition = jme$no_jobs_were_found THEN
        known_job_count := 0;
        status.normal := TRUE;
      ELSE
        RETURN; {----->
      IFEND;
    IFEND;

    sort_known_jobs (known_jobs_p, known_job_count);

{ Recover the input queues - only recover jobs that are not already in the KJL.

{ Create a scratch sequence to use with 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;

{ Find the family names on the system.
{ Each family has its own input queue catalog.  Its form is:
{   :<family_name>.$SYSTEM.$JOB_INPUT_QUEUE.

{ Make a guess at the number of family names defined.  The pmp$get_family_names request
{ only returns abnormal status if the result array is too small.

    PUSH family_name_list: [1 .. 10];
    pmp$get_family_names (family_name_list^, family_name_count, local_status);
    IF NOT local_status.normal THEN
      PUSH family_name_list: [1 .. family_name_count];
      pmp$get_family_names (family_name_list^, family_name_count, { ignore } local_status);
    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);
      RETURN; {----->
    IFEND;

    osp$establish_block_exit_hndlr (^abort_handler);
    establish_display_title ('activate_job_files');

    list_value := files_activated;

  /recover_each_family_job_queue/
    FOR family_index := 1 TO family_name_count DO
      recover_input_queue (family_name_list^ [family_index], jmc$job_input_catalog, known_jobs_p,
            known_job_count, list_value, work_area.sequence_pointer, catalog_segment_pointer.sequence_pointer,
            status);
      IF NOT status.normal THEN
        EXIT /recover_each_family_job_queue/; {----->
      IFEND;
    FOREND /recover_each_family_job_queue/;

    IF status.normal THEN
      recover_input_queue (jmc$system_family, jmc$sf_job_input_catalog, known_jobs_p, known_job_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;
    osp$disestablish_cond_handler;

    mmp$delete_scratch_segment (catalog_segment_pointer, ignore_status);

{ Return the activated system job 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_job_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;

    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 := '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_job_files', EJECT ??

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

{ procedure (jmm$manj_logrjf) log_restored_job_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, 16, 367],
    clc$command, 3, 2, 1, 0, 0, 0, 2, 'JMM$MANJ_LOGRJF'], [
    ['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
      ignore_status: ost$status,
      job_count: 0 .. clc$max_list_size,
      job_list: ^clt$data_value,
      job_name: jmt$name,
      job_number: 0 .. clc$max_list_size,
      local_status: ost$status;

    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_job_files');
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

{  Process the FILES_RESTORED parameter.
    job_count := clp$count_list_elements (pvt [p$files_restored].value);
    job_list := pvt [p$files_restored].value;

  /log_each_file/
    FOR job_number := 1 TO job_count DO
      jmp$determine_name_kind (job_list^.element_value^.name_value, job_name, local_status);
      IF NOT local_status.normal THEN
        display_status_error (local_status, ignore_status);
      ELSEIF job_name.kind <> jmc$system_supplied_name THEN
        osp$set_status_abnormal (jmc$job_management_id, jme$name_not_found, job_name.user_supplied_name,
              local_status);
        display_status_error (local_status, ignore_status);
      ELSE

        jmp$log_restored_job (job_name.system_supplied_name, local_status);
        IF NOT local_status.normal THEN
          IF local_status.condition = jme$jh_job_history_not_active THEN
            status := local_status;
            EXIT /log_each_file/; {----->
          IFEND;

          display_status_error (local_status, ignore_status);
        IFEND;
      IFEND;

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

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

  PROCEND log_restored_job_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 := 'P$SELECT_JOB', EJECT ??

  PROCEDURE p$select_job
    (    pvt: t$select_job_parameter_values;
         result_work_area_pp { input, output } : ^^clt$work_area;
         work_area_pp { input, output } : ^^clt$work_area;
     VAR job_selection_list: ^clt$data_value;
     VAR status: ost$status);

    VAR
      attribute_count: clt$parameter_count,
      i: ost$non_negative_integers,
      input_attribute_options_p: ^jmt$input_attribute_options,
      input_attribute_results_keys_p: ^jmt$results_keys,
      input_attribute_results_p: ^jmt$input_attribute_results,
      job_category_index: jmt$job_category_count,
      job_index: ost$non_negative_integers,
      job_mode: t$job_mode,
      job_matches_criteria: boolean,
      job_qualifier_index: 1 .. jmc$maximum_job_qualifiers,
      job_state: jmt$job_state,
      list_value: ^clt$data_value,
      maximum_selection: 1 .. jmc$maximum_job_count,
      match_info: clt$string_pattern_match_info,
      number_of_inputs_found: jmt$job_status_count,
      number_of_inputs_selected: 0 .. jmc$maximum_job_count,
      number_of_names: ost$non_negative_integers,
      parameter_index: clt$parameter_count,
      pattern_p: ^clt$string_value,
      string_pattern_p: ^clt$string_pattern,
      value: ^clt$data_value;

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

    attribute_count := c$maximum_selection - 1;
    PUSH input_attribute_options_p: [1 .. attribute_count + 1];
    PUSH input_attribute_results_keys_p: [1 .. attribute_count + 1];
    input_attribute_results_keys_p^ [attribute_count + 1] := jmc$null_attribute;

    RESET work_area_pp^;
    number_of_names := 0;

    FOR parameter_index := 1 TO attribute_count DO
      input_attribute_options_p^ [parameter_index].key := jmc$null_attribute;
      input_attribute_results_keys_p^ [parameter_index] := jmc$null_attribute;
      IF pvt [parameter_index].specified THEN
        CASE parameter_index OF
        = c$control_family =
          IF clp$count_list_elements (pvt [parameter_index].value) = 1 THEN
            input_attribute_options_p^ [parameter_index].key := jmc$control_family;
            input_attribute_options_p^ [parameter_index].control_family :=
                  pvt [parameter_index].value^.element_value^.name_value;
          ELSE
            input_attribute_results_keys_p^ [parameter_index] := jmc$control_family;
          IFEND;

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

        = c$display_message =
          input_attribute_results_keys_p^ [parameter_index] := jmc$display_message;

        = c$job_category_name =
          input_attribute_results_keys_p^ [parameter_index] := jmc$job_category_list;

        = c$job_class =
          input_attribute_results_keys_p^ [parameter_index] := jmc$job_class;

        = c$job_deferred_by_operator =
          input_attribute_options_p^ [parameter_index].key := jmc$job_deferred_by_operator;
          input_attribute_options_p^ [parameter_index].job_deferred_by_operator := pvt [parameter_index].
                value^.boolean_value.value;

        = c$job_deferred_by_user =
          input_attribute_options_p^ [parameter_index].key := jmc$job_deferred_by_user;
          input_attribute_options_p^ [parameter_index].job_deferred_by_user :=
                pvt [parameter_index].value^.boolean_value.value;

        = c$job_qualifier =
          input_attribute_results_keys_p^ [parameter_index] := jmc$job_qualifier_list;

        = c$job_mode =

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

          IF pvt [c$job_mode].value^.kind = clc$list THEN
            input_attribute_options_p^ [parameter_index].key := jmc$job_mode_set;
            input_attribute_options_p^ [parameter_index].job_mode_set := $jmt$job_mode_set [];
            FOR job_mode := LOWERVALUE (t$job_mode) TO UPPERVALUE (t$job_mode) DO
              value := pvt [c$job_mode].value;
              WHILE (value <> NIL) AND (v$job_mode_info [job_mode].name <>
                    value^.element_value^.name_value) DO
                value := value^.link;
              WHILEND;
              IF (value <> NIL) THEN
                input_attribute_options_p^ [parameter_index].job_mode_set :=
                      input_attribute_options_p^ [parameter_index].job_mode_set +
                      v$job_mode_info [job_mode].values;
              IFEND;
            FOREND;
          IFEND;

        = c$job_state =

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

          IF pvt [c$job_state].value^.kind = clc$list THEN
            input_attribute_options_p^ [parameter_index].key := jmc$job_state_set;
            input_attribute_options_p^ [parameter_index].job_state_set := $jmt$job_state_set [];
            FOR job_state := LOWERVALUE (jmt$job_state) TO UPPERVALUE (jmt$job_state) DO
              value := pvt [c$job_state].value;
              WHILE (value <> NIL) AND (job_state_names [job_state] <> value^.element_value^.name_value) DO
                value := value^.link;
              WHILEND;
              IF (value <> NIL) THEN
                input_attribute_options_p^ [parameter_index].job_state_set :=
                      input_attribute_options_p^ [parameter_index].job_state_set +
                      $jmt$job_state_set [job_state];
              IFEND;
            FOREND;
          IFEND;

        = c$login_account =
          input_attribute_results_keys_p^ [parameter_index] := jmc$login_account;

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

        = c$login_project =
          input_attribute_results_keys_p^ [parameter_index] := jmc$login_project;

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

        = c$name =
          value := pvt [c$name].value;
          IF (value <> NIL) AND (value^.kind = clc$list) THEN
            number_of_names := clp$count_list_elements (pvt [c$name].value);
            input_attribute_options_p^ [parameter_index].key := jmc$name_list;
            PUSH input_attribute_options_p^ [parameter_index].name_list: [1 .. number_of_names];

            FOR i := 1 TO number_of_names DO
              jmp$determine_name_kind (value^.element_value^.name_value,
                    input_attribute_options_p^ [parameter_index].name_list^ [i], status);
              IF NOT status.normal THEN
                RETURN; {----->
              IFEND;
              value := value^.link;
            FOREND;
          ELSE

{We need to return the user job name, when an application or string_pattern value was passed, to
{compare the value with the UJN.
            input_attribute_results_keys_p^ [attribute_count + 1] := jmc$user_job_name;
          IFEND;

        = c$site_information =
          input_attribute_results_keys_p^ [parameter_index] := jmc$site_information;

        = c$user_information =
          input_attribute_results_keys_p^ [parameter_index] := jmc$user_information;
        ELSE
          input_attribute_results_keys_p^ [parameter_index] := jmc$null_attribute;

        CASEND;
      IFEND;
    FOREND;

{ The system job name is always returned

    input_attribute_results_keys_p^ [c$name] := jmc$system_job_name;
    input_attribute_options_p^ [attribute_count + 1].key := jmc$continue_request_to_servers;
    IF pvt [c$mainframe].value^.keyword_value = 'CURRENT' THEN
      input_attribute_options_p^ [attribute_count + 1].continue_request_to_servers := FALSE;
    ELSE
      input_attribute_options_p^ [attribute_count + 1].continue_request_to_servers := TRUE;
    IFEND;

    jmp$get_input_attributes (input_attribute_options_p, input_attribute_results_keys_p, work_area_pp^,
          input_attribute_results_p, number_of_inputs_found, status);

    IF NOT status.normal THEN
      IF status.condition = jme$no_jobs_were_found THEN
        status.normal := TRUE;
        number_of_inputs_found := 0;
      ELSE
        RETURN; {----->
      IFEND;
    IFEND;

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

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

    NEXT job_selection_list IN result_work_area_pp^;
    job_selection_list^.kind := clc$list;
    job_selection_list^.element_value := NIL;
    job_selection_list^.link := NIL;
    job_selection_list^.generated_via_list_rest := FALSE;
    list_value := job_selection_list;

  /select_jobs_from_list/
    FOR job_index := 1 TO number_of_inputs_found DO
      job_matches_criteria := TRUE;

    /compare_job_attributes/
      FOR parameter_index := 1 TO attribute_count DO
        IF pvt [parameter_index].specified AND (input_attribute_results_keys_p^ [parameter_index] <>
              jmc$null_attribute) THEN
          CASE parameter_index OF
          = c$control_family =
            value := pvt [c$control_family].value;
            WHILE (value <> NIL) AND (input_attribute_results_p^ [job_index]^ [parameter_index].
                  control_family <> value^.element_value^.name_value) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              job_matches_criteria := FALSE;
              EXIT /compare_job_attributes/; {----->
            IFEND;

          = c$control_user =
            value := pvt [c$control_user].value;
            WHILE (value <> NIL) AND (input_attribute_results_p^ [job_index]^ [parameter_index].
                  control_user <> value^.element_value^.name_value) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              job_matches_criteria := FALSE;
              EXIT /compare_job_attributes/; {----->
            IFEND;

          = c$display_message =
            value := pvt [c$display_message].value;
            IF value <> NIL THEN
              CASE value^.kind OF
              = clc$application =
                IF (value^.application_value <> NIL) AND (input_attribute_results_p^ [job_index]^
                      [parameter_index].display_message <> NIL) THEN
                  clp$build_pattern_for_wild_card (clc$wc_extended_pattern,
                        $clt$string_pattern_build_opts [clc$sp_match_at_right,
                        clc$sp_ignore_matched_substring], value^.application_value^, work_area_pp^,
                        string_pattern_p, status);
                  IF NOT status.normal THEN
                    RETURN; {----->
                  IFEND;

                  clp$match_string_pattern (input_attribute_results_p^ [job_index]^ [parameter_index].
                        display_message^.value (1, input_attribute_results_p^ [job_index]^ [parameter_index].
                        display_message^.size), string_pattern_p, clc$sp_anchored, clc$sp_quick_scan,
                        match_info, status);
                  IF NOT status.normal THEN
                    RETURN; {----->
                  IFEND;

                  IF match_info.result <> clc$sp_success THEN
                    job_matches_criteria := FALSE;
                    EXIT /compare_job_attributes/; {----->
                  IFEND;
                IFEND;

              = clc$string =
                IF (value^.string_value <> NIL) AND (input_attribute_results_p^ [job_index]^
                      [parameter_index].display_message <> NIL) AND
                      (value^.string_value^ <> input_attribute_results_p^ [job_index]^ [parameter_index].
                      display_message^.value (input_attribute_results_p^ [job_index]^ [parameter_index].
                      display_message^.size)) THEN
                  job_matches_criteria := FALSE;
                  EXIT /compare_job_attributes/; {----->
                IFEND;


              = clc$string_pattern =
                IF input_attribute_results_p^ [job_index]^ [parameter_index].display_message <> NIL THEN
                  clp$match_string_pattern (input_attribute_results_p^ [job_index]^ [parameter_index].
                        display_message^.value (input_attribute_results_p^ [job_index]^ [parameter_index].
                        display_message^.size), value^.string_pattern_value, clc$sp_anchored,
                        clc$sp_quick_scan, match_info, status);
                  IF NOT status.normal THEN
                    RETURN; {----->
                  IFEND;

                  IF match_info.result <> clc$sp_success THEN
                    job_matches_criteria := FALSE;
                    EXIT /compare_job_attributes/; {----->
                  IFEND;
                IFEND;

              ELSE
              CASEND;
            IFEND;

          = c$job_category_name =
            value := pvt [c$job_category_name].value;

          /find_job_category/
            BEGIN
              WHILE value <> NIL DO
                FOR job_category_index := 1 TO input_attribute_results_p^ [job_index]^ [parameter_index].
                      job_category_list.category_count DO
                  IF (input_attribute_results_p^ [job_index]^ [parameter_index].job_category_list.
                        category_list^ [job_category_index] = value^.element_value^.name_value) THEN
                    EXIT /find_job_category/; {----->
                  IFEND;
                FOREND;
                value := value^.link;
              WHILEND;
              job_matches_criteria := FALSE;
              EXIT /compare_job_attributes/; {----->
            END /find_job_category/;

          = c$job_class =
            value := pvt [c$job_class].value;
            WHILE (value <> NIL) AND (input_attribute_results_p^ [job_index]^ [parameter_index].job_class <>
                  value^.element_value^.name_value) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              job_matches_criteria := FALSE;
              EXIT /compare_job_attributes/; {----->
            IFEND;

          = c$job_qualifier =
            value := pvt [c$job_qualifier].value;

          /find_job_qualifier/
            BEGIN
              WHILE value <> NIL DO
                FOR job_qualifier_index := 1 TO jmc$maximum_job_qualifiers DO
                  IF (input_attribute_results_p^ [job_index]^ [parameter_index].
                        job_qualifier_list^ [job_qualifier_index] = value^.element_value^.name_value) THEN
                    EXIT /find_job_qualifier/; {----->
                  IFEND;
                FOREND;
                value := value^.link;
              WHILEND;
              job_matches_criteria := FALSE;
              EXIT /compare_job_attributes/; {----->
            END /find_job_qualifier/;

          = c$login_account =
            value := pvt [c$login_account].value;
            WHILE (value <> NIL) AND (input_attribute_results_p^ [job_index]^ [parameter_index].
                  login_account <> value^.element_value^.name_value) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              job_matches_criteria := FALSE;
              EXIT /compare_job_attributes/; {----->
            IFEND;

          = c$login_family =
            value := pvt [c$login_family].value;
            WHILE (value <> NIL) AND (input_attribute_results_p^ [job_index]^ [parameter_index].
                  login_family <> value^.element_value^.name_value) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              job_matches_criteria := FALSE;
              EXIT /compare_job_attributes/; {----->
            IFEND;

          = c$login_project =
            value := pvt [c$login_project].value;
            WHILE (value <> NIL) AND (input_attribute_results_p^ [job_index]^ [parameter_index].
                  login_project <> value^.element_value^.name_value) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              job_matches_criteria := FALSE;
              EXIT /compare_job_attributes/; {----->
            IFEND;

          = c$login_user =
            value := pvt [c$login_user].value;
            WHILE (value <> NIL) AND (input_attribute_results_p^ [job_index]^ [parameter_index].login_user <>
                  value^.element_value^.name_value) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              job_matches_criteria := FALSE;
              EXIT /compare_job_attributes/; {----->
            IFEND;

          = c$name =
            value := pvt [c$name].value;
            IF value <> NIL THEN
              CASE value^.kind OF
              = clc$application =
                IF value^.application_value <> NIL THEN
                  NEXT pattern_p: [STRLENGTH(value^.application_value^)] in work_area_pp^;
                  #TRANSLATE (osv$lower_to_upper, value^.application_value^, pattern_p^);

                  clp$build_pattern_for_wild_card (clc$wc_extended_pattern,
                        $clt$string_pattern_build_opts [clc$sp_match_at_right,
                        clc$sp_ignore_matched_substring], pattern_p^, work_area_pp^, string_pattern_p,
                        status);
                  IF NOT status.normal THEN
                    RETURN; {----->
                  IFEND;

                  clp$match_string_pattern (input_attribute_results_p^ [job_index]^ [parameter_index].
                        system_job_name, string_pattern_p, clc$sp_anchored, clc$sp_quick_scan, match_info,
                        status);
                  IF NOT status.normal THEN
                    RETURN; {----->
                  IFEND;

                  IF match_info.result <> clc$sp_success THEN
                    clp$match_string_pattern (input_attribute_results_p^ [job_index]^ [attribute_count + 1].
                          user_job_name, string_pattern_p, clc$sp_anchored, clc$sp_quick_scan, match_info,
                          status);
                    IF NOT status.normal THEN
                      RETURN; {----->
                    IFEND;
                  IFEND;

                  IF match_info.result <> clc$sp_success THEN
                    job_matches_criteria := FALSE;
                    EXIT /compare_job_attributes/; {----->
                  IFEND;
                IFEND;

              = clc$string_pattern =
                clp$match_string_pattern (input_attribute_results_p^ [job_index]^ [parameter_index].
                      system_job_name, value^.string_pattern_value, clc$sp_anchored, clc$sp_quick_scan,
                      match_info, status);
                IF NOT status.normal THEN
                  RETURN; {----->
                IFEND;

                IF match_info.result <> clc$sp_success THEN
                  clp$match_string_pattern (input_attribute_results_p^ [job_index]^ [attribute_count +
                        1].user_job_name, value^.string_pattern_value, clc$sp_anchored, clc$sp_quick_scan,
                        match_info, status);
                  IF NOT status.normal THEN
                    RETURN; {----->
                  IFEND;
                IFEND;

                IF match_info.result <> clc$sp_success THEN
                  job_matches_criteria := FALSE;
                  EXIT /compare_job_attributes/; {----->
                IFEND;

              ELSE
              CASEND;
            IFEND;

          = c$site_information =
            value := pvt [c$site_information].value;
            WHILE (value <> NIL) AND (input_attribute_results_p^ [job_index]^ [parameter_index].
                  site_information^ <> value^.element_value^.string_value^) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              job_matches_criteria := FALSE;
              EXIT /compare_job_attributes/; {----->
            IFEND;

          = c$user_information =
            value := pvt [c$user_information].value;
            WHILE (value <> NIL) AND (input_attribute_results_p^ [job_index]^ [parameter_index].
                  user_information^ <> value^.element_value^.string_value^) DO
              value := value^.link;
            WHILEND;
            IF value = NIL THEN
              job_matches_criteria := FALSE;
              EXIT /compare_job_attributes/; {----->
            IFEND;

          ELSE
            ;
          CASEND;
        IFEND;
      FOREND /compare_job_attributes/;

      IF job_matches_criteria THEN
        number_of_inputs_selected := number_of_inputs_selected + 1;

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

        NEXT list_value^.element_value IN result_work_area_pp^;
        list_value^.element_value^.kind := clc$name;
        list_value^.element_value^.name_value := input_attribute_results_p^ [job_index]^ [c$name].
              system_job_name;
        list_value^.link := NIL;
        list_value^.generated_via_list_rest := FALSE;

        IF number_of_inputs_selected = maximum_selection THEN
          EXIT /select_jobs_from_list/; {----->
        IFEND;
      IFEND;
    FOREND /select_jobs_from_list/;

  PROCEND p$select_job;
?? OLDTITLE ??
?? NEWTITLE := 'p$$selected_jobs', EJECT ??

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

{ FUNCTION $selected_jobs (
{   control_family: list of name = $optional
{   control_user: list of name = $optional
{   job_category_name: list of name = $optional
{   job_class: list of name = $optional
{   job_deferred_by_operator: boolean = $optional
{   job_deferred_by_user: boolean = $optional
{   job_qualifier: list of name = $optional
{   job_mode: any of
{       key
{         all
{       keyend
{       list of key
{         (batch, b)
{         (interactive_connected, ic, interactive, i)
{         (interactive_disconnected, id)
{         advanced_usage
{         (interactive_command_disconnect, icd)
{         (interactive_line_disconnect, ild)
{         (interactive_system_disconnect, isd)
{       keyend
{     anyend = $optional
{   job_state: any of
{       key
{         all
{       keyend
{       list of key
{         (deferred, d)
{         (queued, q)
{         (initiated, i)
{         (terminated, t)
{         (completed, c)
{       keyend
{     anyend = $optional
{   login_account: list of name = $optional
{   login_family: list of name = $optional
{   login_project: list of name = $optional
{   login_user: list of name = $optional
{   name: any of
{       list of name
{       string_pattern
{       application
{     anyend = $optional
{   display_message: any of
{       string
{       string_pattern
{       application
{     anyend = $optional
{   site_information: list of string 0..jmc$site_information_size = $optional
{   user_information: list of string 0..jmc$user_information_size = $optional
{   maximum_selection: any of
{       key
{         all
{       keyend
{       integer 1..jmc$maximum_job_count
{     anyend = all
{   mainframe: key
{       all
{       (current, c)
{     keyend = current
{   )

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 19] of clt$pdt_parameter_name,
      parameters: array [1 .. 19] 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$name_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$name_type_qualifier,
        recend,
      recend,
      type5: record
        header: clt$type_specification_header,
      recend,
      type6: record
        header: clt$type_specification_header,
      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$name_type_qualifier,
        recend,
      recend,
      type8: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 15] of clt$keyword_specification,
          recend,
        recend,
      recend,
      type9: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$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,
      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$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$application_type_qualifier,
        recend,
      recend,
      type15: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$application_type_qualifier,
        recend,
      recend,
      type16: 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,
      type17: 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,
      type18: 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,
      type19: 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,
    recend := [
    [1,
    [104, 9, 28, 11, 33, 21, 48],
    clc$function, 19, 19, 0, 0, 0, 0, 0, ''], [
    ['CONTROL_FAMILY                 ',clc$nominal_entry, 1],
    ['CONTROL_USER                   ',clc$nominal_entry, 2],
    ['DISPLAY_MESSAGE                ',clc$nominal_entry, 15],
    ['JOB_CATEGORY_NAME              ',clc$nominal_entry, 3],
    ['JOB_CLASS                      ',clc$nominal_entry, 4],
    ['JOB_DEFERRED_BY_OPERATOR       ',clc$nominal_entry, 5],
    ['JOB_DEFERRED_BY_USER           ',clc$nominal_entry, 6],
    ['JOB_MODE                       ',clc$nominal_entry, 8],
    ['JOB_QUALIFIER                  ',clc$nominal_entry, 7],
    ['JOB_STATE                      ',clc$nominal_entry, 9],
    ['LOGIN_ACCOUNT                  ',clc$nominal_entry, 10],
    ['LOGIN_FAMILY                   ',clc$nominal_entry, 11],
    ['LOGIN_PROJECT                  ',clc$nominal_entry, 12],
    ['LOGIN_USER                     ',clc$nominal_entry, 13],
    ['MAINFRAME                      ',clc$nominal_entry, 19],
    ['MAXIMUM_SELECTION              ',clc$nominal_entry, 18],
    ['NAME                           ',clc$nominal_entry, 14],
    ['SITE_INFORMATION               ',clc$nominal_entry, 16],
    ['USER_INFORMATION               ',clc$nominal_entry, 17]],
    [
{ 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_parameter,
  0, 0],
{ PARAMETER 2
    [2, 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_parameter,
  0, 0],
{ PARAMETER 3
    [4, 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_parameter,
  0, 0],
{ PARAMETER 4
    [5, 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_parameter,
  0, 0],
{ PARAMETER 5
    [6, 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, 3, clc$optional_parameter, 0
  , 0],
{ PARAMETER 6
    [7, 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, 3, clc$optional_parameter, 0
  , 0],
{ PARAMETER 7
    [9, 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_parameter,
  0, 0],
{ PARAMETER 8
    [8, 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, 642,
  clc$optional_parameter, 0, 0],
{ PARAMETER 9
    [10, 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, 457,
  clc$optional_parameter, 0, 0],
{ PARAMETER 10
    [11, 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_parameter,
  0, 0],
{ PARAMETER 11
    [12, 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_parameter,
  0, 0],
{ PARAMETER 12
    [13, 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_parameter,
  0, 0],
{ PARAMETER 13
    [14, 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_parameter,
  0, 0],
{ PARAMETER 14
    [17, 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, 52, clc$optional_parameter,
  0, 0],
{ PARAMETER 15
    [3, 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, 39, clc$optional_parameter,
  0, 0],
{ PARAMETER 16
    [18, 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, 24, clc$optional_parameter,
  0, 0],
{ PARAMETER 17
    [19, 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, 24, clc$optional_parameter,
  0, 0],
{ PARAMETER 18
    [16, 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, 84,
  clc$optional_default_parameter, 0, 3],
{ PARAMETER 19
    [15, 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, 118,
  clc$optional_default_parameter, 0, 7]],
{ PARAMETER 1
    [[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 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], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 5
    [[1, 0, clc$boolean_type]],
{ PARAMETER 6
    [[1, 0, clc$boolean_type]],
{ PARAMETER 7
    [[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 8
    [[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]]
      ],
    578, [[1, 0, clc$list_type], [562, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$keyword_type], [15], [
        ['ADVANCED_USAGE                 ', clc$nominal_entry, clc$normal_usage_entry, 4],
        ['B                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['BATCH                          ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['I                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['IC                             ', clc$alias_entry, clc$normal_usage_entry, 2],
        ['ICD                            ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
        ['ID                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['ILD                            ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
        ['INTERACTIVE                    ', clc$alias_entry, clc$normal_usage_entry, 2],
        ['INTERACTIVE_COMMAND_DISCONNECT ', clc$nominal_entry, clc$normal_usage_entry, 5],
        ['INTERACTIVE_CONNECTED          ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['INTERACTIVE_DISCONNECTED       ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['INTERACTIVE_LINE_DISCONNECT    ', clc$nominal_entry, clc$normal_usage_entry, 6],
        ['INTERACTIVE_SYSTEM_DISCONNECT  ', clc$nominal_entry, clc$normal_usage_entry, 7],
        ['ISD                            ', clc$abbreviation_entry, clc$normal_usage_entry, 7]]
        ]
      ]
    ],
{ PARAMETER 9
    [[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 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$union_type], [[clc$application_type, clc$list_type, clc$string_pattern_type],
    FALSE, 3],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$name_type], [1, osc$max_name_size]]
      ],
    3, [[1, 0, clc$string_pattern_type]],
    4, [[1, 0, clc$application_type], [FALSE]]
    ],
{ PARAMETER 15
    [[1, 0, clc$union_type], [[clc$application_type, clc$string_type, clc$string_pattern_type],
    FALSE, 3],
    8, [[1, 0, clc$string_type], [0, clc$max_string_size, FALSE]],
    3, [[1, 0, clc$string_pattern_type]],
    4, [[1, 0, clc$application_type], [FALSE]]
    ],
{ PARAMETER 16
    [[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 17
    [[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 18
    [[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_job_count, 10]]
    ,
    'all'],
{ PARAMETER 19
    [[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']];

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

    CONST
      p$control_family = 1,
      p$control_user = 2,
      p$job_category_name = 3,
      p$job_class = 4,
      p$job_deferred_by_operator = 5,
      p$job_deferred_by_user = 6,
      p$job_qualifier = 7,
      p$job_mode = 8,
      p$job_state = 9,
      p$login_account = 10,
      p$login_family = 11,
      p$login_project = 12,
      p$login_user = 13,
      p$name = 14,
      p$display_message = 15,
      p$site_information = 16,
      p$user_information = 17,
      p$maximum_selection = 18,
      p$mainframe = 19;

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

    VAR
      v$parameter_index_conversion: [READ, read_only] array [t$select_job_param_value_kind] of
            p$control_family .. p$mainframe := [
{ C$CONTROL_FAMILY              } p$control_family,
{ C$CONTROL_USER                } p$control_user,
{ C$JOB_CATEGORY_NAME           } p$job_category_name,
{ C$JOB_CLASS                   } p$job_class,
{ C$JOB_DEFERRED_BY_OPERATOR    } p$job_deferred_by_operator,
{ C$JOB_DEFERRED_BY_USER        } p$job_deferred_by_user,
{ C$JOB_QUALIFIER               } p$job_qualifier,
{ C$JOB_MODE                    } p$job_mode,
{ C$JOB_STATE                   } p$job_state,
{ C$LOGIN_ACCOUNT               } p$login_account,
{ C$LOGIN_FAMILY                } p$login_family,
{ C$LOGIN_PROJECT               } p$login_project,
{ C$LOGIN_USER                  } p$login_user,
{ C$NAME                        } p$name,
{ C$DISPLAY_MESSAGE             } p$display_message,
{ C$SITE_INFORMATION            } p$site_information,
{ C$USER_INFORMATION            } p$user_information,
{ C$MAXIMUM_SELECTION           } p$maximum_selection,
{ C$MAINFRAME                   } p$mainframe];

    VAR
      attribute_count: clt$parameter_count,
      select_job_pvt: t$select_job_parameter_values;

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

    FOR attribute_count := LOWERBOUND (select_job_pvt) TO UPPERBOUND (select_job_pvt) DO
      select_job_pvt [attribute_count] := pvt [v$parameter_index_conversion [attribute_count]];
    FOREND;

    p$select_job (select_job_pvt, ^work_area_p, ^work_area.sequence_pointer, result, status);

  PROCEND p$$selected_jobs;
?? OLDTITLE ??
?? NEWTITLE := 'queued_job_path', EJECT ??

  PROCEDURE queued_job_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$manj_$qjp) $queued_job_path (
{   names: list 0..clc$max_list_size of name = jmv$selected_jobs
{   )

?? 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_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        default_value: string (17),
      recend,
    recend := [
    [1,
    [104, 9, 28, 11, 43, 36, 345],
    clc$function, 1, 1, 0, 0, 0, 0, 0, 'JMM$MANJ_$QJP'], [
    ['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, 17]],
{ PARAMETER 1
    [[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_jobs']];

?? 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,
      job_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;

    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, job_name, status);
      IF NOT status.normal THEN
        EXIT /get_each_path/; {----->
      IFEND;
      IF job_name.kind <> jmc$system_supplied_name THEN
        osp$set_status_abnormal (jmc$job_management_id, jme$name_not_found, job_name.user_supplied_name,
              status);
        EXIT /get_each_path/; {----->
      IFEND;

      jmp$get_job_path_elements (job_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_job_path;
?? OLDTITLE ??
?? NEWTITLE := 'quit', EJECT ??

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

{ PROCEDURE (jmm$manj_qui) quit, qui (
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 1] of clt$pdt_parameter_name,
      parameters: array [1 .. 1] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [104, 9, 28, 11, 43, 21, 187],
    clc$command, 1, 1, 0, 0, 0, 0, 1, 'JMM$MANJ_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]]];

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

    CONST
      p$status = 1;

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

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

    mmp$delete_scratch_segment (work_area, status);

    clp$end_include (utility_name, status);

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

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

{ PROCEDURE (jmm$manj_selj) select_job, select_jobs, selj (
{   control_family, control_families, cf: list of name = $optional
{   control_user, control_users, cu: list of name = $optional
{   job_category_name, job_category_names, jcn: list of name = $optional
{   job_class, job_classes, jc: list of name = $optional
{   job_deferred_by_operator, jdbo: boolean = $optional
{   job_deferred_by_user, jdbu: boolean = $optional
{   job_qualifier, job_qualifiers, jq: list of name = $optional
{   job_mode, jm: any of
{       key
{         all
{       keyend
{       list of key
{         (batch, b)
{         (interactive_connected, ic, interactive, i)
{         (interactive_disconnected, id)
{         advanced_usage
{         (interactive_command_disconnect, icd)
{         (interactive_line_disconnect, ild)
{         (interactive_system_disconnect, isd)
{       keyend
{     anyend = $optional
{   job_state, job_states, js: any of
{       key
{         all
{       keyend
{       list of key
{         (deferred, d)
{         (queued, q)
{         (initiated, i)
{         (terminated, t)
{         (completed, c)
{       keyend
{     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: any of
{       list of name
{       string_pattern
{       application
{     anyend = $optional
{   display_message, dm: any of
{       string
{       string_pattern
{       application
{     anyend = $optional
{   site_information, si: list of string 0..jmc$site_information_size = $optional
{   user_information, ui: list of string 0..jmc$user_information_size = $optional
{   maximum_selection, ms: any of
{       key
{         all
{       keyend
{       integer 1..jmc$maximum_job_count
{     anyend = all
{   mainframe, mainframes, m: key
{       all
{       (current, c)
{     keyend = current
{   job_selection_list, jsl: (VAR) list 0..clc$max_list_size of name = jmv$selected_jobs
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 53] of clt$pdt_parameter_name,
      parameters: array [1 .. 21] 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$name_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$name_type_qualifier,
        recend,
      recend,
      type5: record
        header: clt$type_specification_header,
      recend,
      type6: record
        header: clt$type_specification_header,
      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$name_type_qualifier,
        recend,
      recend,
      type8: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 15] of clt$keyword_specification,
          recend,
        recend,
      recend,
      type9: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$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,
      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$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$application_type_qualifier,
        recend,
      recend,
      type15: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$application_type_qualifier,
        recend,
      recend,
      type16: 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,
      type17: 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,
      type18: 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,
      type19: 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,
      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,
        default_value: string (17),
      recend,
      type21: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [104, 9, 28, 9, 46, 10, 475],
    clc$command, 53, 21, 0, 0, 0, 1, 21, 'JMM$MANJ_SELJ'], [
    ['CF                             ',clc$abbreviation_entry, 1],
    ['CONTROL_FAMILIES               ',clc$alias_entry, 1],
    ['CONTROL_FAMILY                 ',clc$nominal_entry, 1],
    ['CONTROL_USER                   ',clc$nominal_entry, 2],
    ['CONTROL_USERS                  ',clc$alias_entry, 2],
    ['CU                             ',clc$abbreviation_entry, 2],
    ['DISPLAY_MESSAGE                ',clc$nominal_entry, 15],
    ['DM                             ',clc$abbreviation_entry, 15],
    ['JC                             ',clc$abbreviation_entry, 4],
    ['JCN                            ',clc$abbreviation_entry, 3],
    ['JDBO                           ',clc$abbreviation_entry, 5],
    ['JDBU                           ',clc$abbreviation_entry, 6],
    ['JM                             ',clc$abbreviation_entry, 8],
    ['JOB_CATEGORY_NAME              ',clc$nominal_entry, 3],
    ['JOB_CATEGORY_NAMES             ',clc$alias_entry, 3],
    ['JOB_CLASS                      ',clc$nominal_entry, 4],
    ['JOB_CLASSES                    ',clc$alias_entry, 4],
    ['JOB_DEFERRED_BY_OPERATOR       ',clc$nominal_entry, 5],
    ['JOB_DEFERRED_BY_USER           ',clc$nominal_entry, 6],
    ['JOB_MODE                       ',clc$nominal_entry, 8],
    ['JOB_QUALIFIER                  ',clc$nominal_entry, 7],
    ['JOB_QUALIFIERS                 ',clc$alias_entry, 7],
    ['JOB_SELECTION_LIST             ',clc$nominal_entry, 20],
    ['JOB_STATE                      ',clc$nominal_entry, 9],
    ['JOB_STATES                     ',clc$alias_entry, 9],
    ['JQ                             ',clc$abbreviation_entry, 7],
    ['JS                             ',clc$abbreviation_entry, 9],
    ['JSL                            ',clc$abbreviation_entry, 20],
    ['LA                             ',clc$abbreviation_entry, 10],
    ['LF                             ',clc$abbreviation_entry, 11],
    ['LOGIN_ACCOUNT                  ',clc$nominal_entry, 10],
    ['LOGIN_ACCOUNTS                 ',clc$alias_entry, 10],
    ['LOGIN_FAMILIES                 ',clc$alias_entry, 11],
    ['LOGIN_FAMILY                   ',clc$nominal_entry, 11],
    ['LOGIN_PROJECT                  ',clc$nominal_entry, 12],
    ['LOGIN_PROJECTS                 ',clc$alias_entry, 12],
    ['LOGIN_USER                     ',clc$nominal_entry, 13],
    ['LOGIN_USERS                    ',clc$alias_entry, 13],
    ['LP                             ',clc$abbreviation_entry, 12],
    ['LU                             ',clc$abbreviation_entry, 13],
    ['M                              ',clc$abbreviation_entry, 19],
    ['MAINFRAME                      ',clc$nominal_entry, 19],
    ['MAINFRAMES                     ',clc$alias_entry, 19],
    ['MAXIMUM_SELECTION              ',clc$nominal_entry, 18],
    ['MS                             ',clc$abbreviation_entry, 18],
    ['N                              ',clc$abbreviation_entry, 14],
    ['NAME                           ',clc$nominal_entry, 14],
    ['NAMES                          ',clc$alias_entry, 14],
    ['SI                             ',clc$abbreviation_entry, 16],
    ['SITE_INFORMATION               ',clc$nominal_entry, 16],
    ['STATUS                         ',clc$nominal_entry, 21],
    ['UI                             ',clc$abbreviation_entry, 17],
    ['USER_INFORMATION               ',clc$nominal_entry, 17]],
    [
{ 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, 21, clc$optional_parameter,
  0, 0],
{ PARAMETER 2
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 21, clc$optional_parameter,
  0, 0],
{ PARAMETER 3
    [14, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 21, clc$optional_parameter,
  0, 0],
{ PARAMETER 4
    [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, 21, clc$optional_parameter,
  0, 0],
{ PARAMETER 5
    [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, 3, clc$optional_parameter, 0
  , 0],
{ PARAMETER 6
    [19, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$optional_parameter, 0
  , 0],
{ PARAMETER 7
    [21, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 21, clc$optional_parameter,
  0, 0],
{ PARAMETER 8
    [20, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 642,
  clc$optional_parameter, 0, 0],
{ PARAMETER 9
    [24, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 457,
  clc$optional_parameter, 0, 0],
{ PARAMETER 10
    [31, 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
    [34, 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
    [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, 21, clc$optional_parameter,
  0, 0],
{ PARAMETER 13
    [37, 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
    [47, 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, 52, clc$optional_parameter,
  0, 0],
{ PARAMETER 15
    [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, 39, clc$optional_parameter,
  0, 0],
{ PARAMETER 16
    [50, 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 17
    [53, 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 18
    [44, 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 19
    [42, 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 20
    [23, 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, 17],
{ PARAMETER 21
    [51, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ 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], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 5
    [[1, 0, clc$boolean_type]],
{ PARAMETER 6
    [[1, 0, clc$boolean_type]],
{ PARAMETER 7
    [[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 8
    [[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]]
      ],
    578, [[1, 0, clc$list_type], [562, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$keyword_type], [15], [
        ['ADVANCED_USAGE                 ', clc$nominal_entry, clc$normal_usage_entry, 4],
        ['B                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['BATCH                          ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['I                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['IC                             ', clc$alias_entry, clc$normal_usage_entry, 2],
        ['ICD                            ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
        ['ID                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['ILD                            ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
        ['INTERACTIVE                    ', clc$alias_entry, clc$normal_usage_entry, 2],
        ['INTERACTIVE_COMMAND_DISCONNECT ', clc$nominal_entry, clc$normal_usage_entry, 5],
        ['INTERACTIVE_CONNECTED          ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['INTERACTIVE_DISCONNECTED       ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['INTERACTIVE_LINE_DISCONNECT    ', clc$nominal_entry, clc$normal_usage_entry, 6],
        ['INTERACTIVE_SYSTEM_DISCONNECT  ', clc$nominal_entry, clc$normal_usage_entry, 7],
        ['ISD                            ', clc$abbreviation_entry, clc$normal_usage_entry, 7]]
        ]
      ]
    ],
{ PARAMETER 9
    [[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 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$union_type], [[clc$application_type, clc$list_type, clc$string_pattern_type],
    FALSE, 3],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$name_type], [1, osc$max_name_size]]
      ],
    3, [[1, 0, clc$string_pattern_type]],
    4, [[1, 0, clc$application_type], [FALSE]]
    ],
{ PARAMETER 15
    [[1, 0, clc$union_type], [[clc$application_type, clc$string_type, clc$string_pattern_type],
    FALSE, 3],
    8, [[1, 0, clc$string_type], [0, clc$max_string_size, FALSE]],
    3, [[1, 0, clc$string_pattern_type]],
    4, [[1, 0, clc$application_type], [FALSE]]
    ],
{ PARAMETER 16
    [[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 17
    [[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 18
    [[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_job_count, 10]]
    ,
    'all'],
{ PARAMETER 19
    [[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 20
    [[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_jobs'],
{ PARAMETER 21
    [[1, 0, clc$status_type]]];

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

    CONST
      p$control_family = 1,
      p$control_user = 2,
      p$job_category_name = 3,
      p$job_class = 4,
      p$job_deferred_by_operator = 5,
      p$job_deferred_by_user = 6,
      p$job_qualifier = 7,
      p$job_mode = 8,
      p$job_state = 9,
      p$login_account = 10,
      p$login_family = 11,
      p$login_project = 12,
      p$login_user = 13,
      p$name = 14,
      p$display_message = 15,
      p$site_information = 16,
      p$user_information = 17,
      p$maximum_selection = 18,
      p$mainframe = 19,
      p$job_selection_list = 20,
      p$status = 21;

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

    VAR
      v$parameter_index_conversion: [READ, read_only] array [t$select_job_param_value_kind] of
            p$control_family .. p$mainframe := [
{ C$CONTROL_FAMILY              } p$control_family,
{ C$CONTROL_USER                } p$control_user,
{ C$JOB_CATEGORY_NAME           } p$job_category_name,
{ C$JOB_CLASS                   } p$job_class,
{ C$JOB_DEFERRED_BY_OPERATOR    } p$job_deferred_by_operator,
{ C$JOB_DEFERRED_BY_USER        } p$job_deferred_by_user,
{ C$JOB_QUALIFIER               } p$job_qualifier,
{ C$JOB_MODE                    } p$job_mode,
{ C$JOB_STATE                   } p$job_state,
{ C$LOGIN_ACCOUNT               } p$login_account,
{ C$LOGIN_FAMILY                } p$login_family,
{ C$LOGIN_PROJECT               } p$login_project,
{ C$LOGIN_USER                  } p$login_user,
{ C$NAME                        } p$name,
{ C$DISPLAY_MESSAGE             } p$display_message,
{ C$SITE_INFORMATION            } p$site_information,
{ C$USER_INFORMATION            } p$user_information,
{ C$MAXIMUM_SELECTION           } p$maximum_selection,
{ C$MAINFRAME                   } p$mainframe];

    VAR
      attribute_count: clt$parameter_count,
      job_selection_list: ^clt$data_value,
      select_job_pvt: t$select_job_parameter_values;

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

    FOR attribute_count := LOWERBOUND (select_job_pvt) TO UPPERBOUND (select_job_pvt) DO
      select_job_pvt [attribute_count] := pvt [v$parameter_index_conversion [attribute_count]];
    FOREND;

    p$select_job (select_job_pvt, ^work_area.sequence_pointer, ^work_area.sequence_pointer,
          job_selection_list, status);

    IF status.normal THEN
      clp$change_variable (pvt [p$job_selection_list].variable^, job_selection_list, status);
    IFEND;

  PROCEND select_job;
*copy clp$new_page_procedure
?? OLDTITLE ??
MODEND jmm$manage_job_utility;
