?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE SCL Interpreter : System Access Commands' ??
MODULE clm$system_access_commands;

{
{ PURPOSE:
{   This module contains the processors for commands that are used to gain and control access to NOS/VE.
{

?? NEWTITLE := 'Global Declarations', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc ame$lfn_program_actions
*copyc avc$system_epilog
*copyc avc$system_prolog
*copyc clc$compiling_for_test_harness
*copyc cle$command_terminated
*copyc cle$epilog_file_missing
*copyc cle$login_prolog_file_missing
*copyc clt$parameter_list
*copyc jmc$class_names
*copyc jmc$job_management_id
*copyc jme$job_monitor_conditions
*copyc jmt$job_system_label
*copyc oss$job_paged_literal
*copyc ost$name_reference
*copyc ost$status
?? POP ??
*copyc amp$get_file_attributes
*copyc avp$display_pw_exp_warning
*copyc avp$get_capability
*copyc avp$get_file_value
*copyc clp$add_file_to_command_list
*copyc clp$delete_all_from_cmnd_list
*copyc clp$delete_all_file_connections
*copyc clp$delete_all_targets
*copyc clp$establish_sys_command_lib
*copyc clp$evaluate_parameters
*copyc clp$find_current_block
*copyc clp$free_all_handlers
*copyc clp$get_interpreter_mode
*copyc clp$include_file
*copyc clp$include_line
*copyc clp$log_edited_login_command
*copyc clp$login_command_ring_3
*copyc clp$put_job_command_response
*copyc clp$put_job_output
*copyc clp$set_command_kind
*copyc clp$set_processing_phase
*copyc ifp$discard_suspended_output
*copyc jmp$enable_exit_processing
*copyc jmp$enable_user_breaks
*copyc jmp$get_attribute_defaults
*copyc jmp$get_job_attributes
*copyc jmp$get_job_class_prolog
*copyc jmp$inhibit_exit_processing
*copyc jmp$logout
*copyc jmp$system_job
*copyc osp$append_status_file
*copyc osp$disestablish_cond_handler
*copyc osp$enforce_exception_policies
*copyc osp$file_access_condition
*copyc osp$establish_condition_handler
*copyc osp$generate_message
*copyc osp$generate_log_message
*copyc osp$generate_output_message
*copyc osp$get_status_severity
*copyc osp$set_message_level
*copyc osp$set_status_abnormal
*copyc osp$set_status_condition
*copyc osv$initial_exception_context
*copyc pmp$abort
*copyc pmp$continue_to_cause

*copyc clv$processing_phase
*copyc clv$standard_files
*copyc jmv$initialized_as_disconnected
*copyc pmv$epilog_file

?? TITLE := 'clp$login_command', EJECT ??

  PROCEDURE [XDCL] clp$login_command
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

    VAR
      interpreter_mode: clt$interpreter_modes,
      job_system_label: jmt$job_system_label;


    status.normal := TRUE;

    clp$set_command_kind (clc$login_command);
    clp$get_interpreter_mode (interpreter_mode);

    IF interpreter_mode = clc$help_mode THEN
      clp$get_login_parameters (parameter_list, job_system_label, status);
    ELSE
      clp$login_command_ring_3 (status);
    IFEND;

  PROCEND clp$login_command;
?? TITLE := 'clp$get_login_data_for_nam', EJECT ??

  PROCEDURE [XDCL, #GATE] clp$get_login_data_for_nam
    (    parameter_list: clt$parameter_list;
     VAR login_user: ost$name;
     VAR login_password: ost$name;
     VAR login_family: ost$name;
     VAR login_account: ost$name;
     VAR login_project: ost$name;
     VAR status: ost$status);

    VAR
      job_system_label: jmt$job_system_label;

    status.normal := TRUE;
    job_system_label.login_account := osc$null_name;
    job_system_label.login_password := osc$null_name;
    job_system_label.login_project := osc$null_name;
    job_system_label.login_user_identification.user := osc$null_name;
    job_system_label.login_user_identification.family := osc$null_name;
    clp$get_login_parameters (parameter_list, job_system_label, status);
    IF status.normal THEN
      login_user := job_system_label.login_user_identification.user;
      login_password := job_system_label.login_password;
      login_family := job_system_label.login_user_identification.family;
      login_account := job_system_label.login_account;
      login_project := job_system_label.login_project;
    IFEND;
  PROCEND clp$get_login_data_for_nam;

?? TITLE := 'clp$get_login_parameters', EJECT ??

  PROCEDURE [XDCL] clp$get_login_parameters
    (    parameter_list: clt$parameter_list;
     VAR job_system_label {input, output} : jmt$job_system_label;
     VAR status: ost$status);

{ PROCEDURE (osm$login) login (
{   login_user, u, user, lu: name = $required
{   password, pw: name = $optional
{   login_family, family_name, fn, lf: name = $optional
{   login_account, a, account, la: name = $optional
{   login_project, p, project, lp: name = $optional
{   cpu_time_limit, ctl: any of
{       key
{         system_default, unlimited
{       keyend
{       integer jmc$lowest_cpu_time_limit..jmc$highest_cpu_time_limit
{     anyend = $optional
{   earliest_run_time, ert: date_time = $optional
{   job_abort_disposition, jad: key
{       (restart, r)
{       (terminate, t)
{     keyend = $optional
{   job_class, jc: name = $optional
{   job_deferred_by_user, jdbu: boolean = false
{   job_destination_usage, jdu: any of
{       key
{         ntf, qtf, ve, ve_family, ve_local, ve_qtf
{       keyend
{       name
{     anyend = $optional
{   job_execution_ring, jer: integer osc$sj_ring_1..osc$user_ring_2 = $optional
{   job_qualifier, job_qualifiers, jq: any of
{       key
{         none, system_default
{       keyend
{       list 1..jmc$maximum_job_qualifiers of name
{     anyend = $optional
{   job_recovery_disposition, jrd: key
{       (continue, c)
{       (restart, r)
{       (terminate, t)
{     keyend = $optional
{   latest_run_time, lrt: date_time = $optional
{   magnetic_tape_limit, mtl: any of
{       key
{         system_default, unlimited, unspecified
{       keyend
{       integer jmc$lowest_magnetic_tape_limit..jmc$highest_magnetic_tape_limit
{     anyend = $optional
{   maximum_working_set, maxws: any of
{       key
{         system_default, unlimited
{       keyend
{       integer jmc$lowest_working_set_size..jmc$highest_working_set_size
{     anyend = $optional
{   sru_limit, sl: any of
{       key
{         system_default, unlimited
{       keyend
{       integer jmc$lowest_sru_limit..jmc$highest_sru_limit
{     anyend = $optional
{   user_information, ui: string 0..jmc$user_information_size = $optional
{   user_job_name, jn, job_name, ujn: name = $optional
{   )

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 51] of clt$pdt_parameter_name,
      parameters: array [1 .. 20] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type5: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type6: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      type7: record
        header: clt$type_specification_header,
        qualifier: clt$date_time_type_qualifier,
      recend,
      type8: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
      recend,
      type9: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type10: record
        header: clt$type_specification_header,
        default_value: string (5),
      recend,
      type11: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 6] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type12: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type13: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
      recend,
      type14: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 6] of clt$keyword_specification,
      recend,
      type15: record
        header: clt$type_specification_header,
        qualifier: clt$date_time_type_qualifier,
      recend,
      type16: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 3] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      type17: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      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 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      type19: record
        header: clt$type_specification_header,
        qualifier: clt$string_type_qualifier,
      recend,
      type20: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
    recend := [
    [1,
    [91, 7, 8, 15, 10, 2, 248],
    clc$command, 51, 20, 1, 0, 0, 0, 0, 'OSM$LOGIN'], [
    ['A                              ',clc$alias_entry, 4],
    ['ACCOUNT                        ',clc$alias_entry, 4],
    ['CPU_TIME_LIMIT                 ',clc$nominal_entry, 6],
    ['CTL                            ',clc$abbreviation_entry, 6],
    ['EARLIEST_RUN_TIME              ',clc$nominal_entry, 7],
    ['ERT                            ',clc$abbreviation_entry, 7],
    ['FAMILY_NAME                    ',clc$alias_entry, 3],
    ['FN                             ',clc$alias_entry, 3],
    ['JAD                            ',clc$abbreviation_entry, 8],
    ['JC                             ',clc$abbreviation_entry, 9],
    ['JDBU                           ',clc$abbreviation_entry, 10],
    ['JDU                            ',clc$abbreviation_entry, 11],
    ['JER                            ',clc$abbreviation_entry, 12],
    ['JN                             ',clc$alias_entry, 20],
    ['JOB_ABORT_DISPOSITION          ',clc$nominal_entry, 8],
    ['JOB_CLASS                      ',clc$nominal_entry, 9],
    ['JOB_DEFERRED_BY_USER           ',clc$nominal_entry, 10],
    ['JOB_DESTINATION_USAGE          ',clc$nominal_entry, 11],
    ['JOB_EXECUTION_RING             ',clc$nominal_entry, 12],
    ['JOB_NAME                       ',clc$alias_entry, 20],
    ['JOB_QUALIFIER                  ',clc$nominal_entry, 13],
    ['JOB_QUALIFIERS                 ',clc$alias_entry, 13],
    ['JOB_RECOVERY_DISPOSITION       ',clc$nominal_entry, 14],
    ['JQ                             ',clc$abbreviation_entry, 13],
    ['JRD                            ',clc$abbreviation_entry, 14],
    ['LA                             ',clc$abbreviation_entry, 4],
    ['LATEST_RUN_TIME                ',clc$nominal_entry, 15],
    ['LF                             ',clc$abbreviation_entry, 3],
    ['LOGIN_ACCOUNT                  ',clc$nominal_entry, 4],
    ['LOGIN_FAMILY                   ',clc$nominal_entry, 3],
    ['LOGIN_PROJECT                  ',clc$nominal_entry, 5],
    ['LOGIN_USER                     ',clc$nominal_entry, 1],
    ['LP                             ',clc$abbreviation_entry, 5],
    ['LRT                            ',clc$abbreviation_entry, 15],
    ['LU                             ',clc$abbreviation_entry, 1],
    ['MAGNETIC_TAPE_LIMIT            ',clc$nominal_entry, 16],
    ['MAXIMUM_WORKING_SET            ',clc$nominal_entry, 17],
    ['MAXWS                          ',clc$abbreviation_entry, 17],
    ['MTL                            ',clc$abbreviation_entry, 16],
    ['P                              ',clc$alias_entry, 5],
    ['PASSWORD                       ',clc$nominal_entry, 2],
    ['PROJECT                        ',clc$alias_entry, 5],
    ['PW                             ',clc$abbreviation_entry, 2],
    ['SL                             ',clc$abbreviation_entry, 18],
    ['SRU_LIMIT                      ',clc$nominal_entry, 18],
    ['U                              ',clc$alias_entry, 1],
    ['UI                             ',clc$abbreviation_entry, 19],
    ['UJN                            ',clc$abbreviation_entry, 20],
    ['USER                           ',clc$alias_entry, 1],
    ['USER_INFORMATION               ',clc$nominal_entry, 19],
    ['USER_JOB_NAME                  ',clc$nominal_entry, 20]],
    [
{ PARAMETER 1
    [32, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 5, clc$required_parameter, 0
  , 0],
{ PARAMETER 2
    [41, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 3
    [30, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 4
    [29, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 5
    [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, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 6
    [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, 121,
  clc$optional_parameter, 0, 0],
{ PARAMETER 7
    [5, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 8
    [15, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,
  clc$optional_parameter, 0, 0],
{ PARAMETER 9
    [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, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 10
    [17, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 5],
{ PARAMETER 11
    [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, 254,
  clc$optional_parameter, 0, 0],
{ PARAMETER 12
    [19, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$optional_parameter,
  0, 0],
{ PARAMETER 13
    [21, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 122,
  clc$optional_parameter, 0, 0],
{ PARAMETER 14
    [23, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 229,
  clc$optional_parameter, 0, 0],
{ PARAMETER 15
    [27, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 16
    [36, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 158,
  clc$optional_parameter, 0, 0],
{ PARAMETER 17
    [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, 121,
  clc$optional_parameter, 0, 0],
{ PARAMETER 18
    [45, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 121,
  clc$optional_parameter, 0, 0],
{ PARAMETER 19
    [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, 8, clc$optional_parameter, 0
  , 0],
{ PARAMETER 20
    [51, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 5, clc$optional_parameter, 0
  , 0]],
{ PARAMETER 1
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 2
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 3
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 4
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 5
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 6
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['SYSTEM_DEFAULT                 ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['UNLIMITED                      ', clc$nominal_entry, clc$normal_usage_entry, 2]]
      ],
    20, [[1, 0, clc$integer_type], [jmc$lowest_cpu_time_limit, jmc$highest_cpu_time_limit, 10]]
    ],
{ PARAMETER 7
    [[1, 0, clc$date_time_type], [$clt$date_and_or_time [clc$date, clc$time], $clt$date_time_tenses [clc$past
  , clc$present, clc$future]]],
{ PARAMETER 8
    [[1, 0, clc$keyword_type], [4], [
    ['R                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['RESTART                        ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['T                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['TERMINATE                      ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ],
{ PARAMETER 9
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 10
    [[1, 0, clc$boolean_type],
    'false'],
{ PARAMETER 11
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type],
    FALSE, 2],
    229, [[1, 0, clc$keyword_type], [6], [
      ['NTF                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['QTF                            ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['VE                             ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['VE_FAMILY                      ', clc$nominal_entry, clc$normal_usage_entry, 4],
      ['VE_LOCAL                       ', clc$nominal_entry, clc$normal_usage_entry, 5],
      ['VE_QTF                         ', clc$nominal_entry, clc$normal_usage_entry, 6]]
      ],
    5, [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 12
    [[1, 0, clc$integer_type], [osc$sj_ring_1, osc$user_ring_2, 10]],
{ PARAMETER 13
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['SYSTEM_DEFAULT                 ', clc$nominal_entry, clc$normal_usage_entry, 2]]
      ],
    21, [[1, 0, clc$list_type], [5, 1, jmc$maximum_job_qualifiers, 0, FALSE, FALSE],
        [[1, 0, clc$name_type], [1, osc$max_name_size]]
      ]
    ],
{ PARAMETER 14
    [[1, 0, clc$keyword_type], [6], [
    ['C                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['CONTINUE                       ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['R                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['RESTART                        ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['T                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['TERMINATE                      ', clc$nominal_entry, clc$normal_usage_entry, 3]]
    ],
{ PARAMETER 15
    [[1, 0, clc$date_time_type], [$clt$date_and_or_time [clc$date, clc$time], $clt$date_time_tenses [clc$past
  , clc$present, clc$future]]],
{ PARAMETER 16
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    118, [[1, 0, clc$keyword_type], [3], [
      ['SYSTEM_DEFAULT                 ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['UNLIMITED                      ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['UNSPECIFIED                    ', clc$nominal_entry, clc$normal_usage_entry, 3]]
      ],
    20, [[1, 0, clc$integer_type], [jmc$lowest_magnetic_tape_limit, jmc$highest_magnetic_tape_limit, 10]]
    ],
{ PARAMETER 17
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['SYSTEM_DEFAULT                 ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['UNLIMITED                      ', clc$nominal_entry, clc$normal_usage_entry, 2]]
      ],
    20, [[1, 0, clc$integer_type], [jmc$lowest_working_set_size, jmc$highest_working_set_size, 10]]
    ],
{ PARAMETER 18
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['SYSTEM_DEFAULT                 ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['UNLIMITED                      ', clc$nominal_entry, clc$normal_usage_entry, 2]]
      ],
    20, [[1, 0, clc$integer_type], [jmc$lowest_sru_limit, jmc$highest_sru_limit, 10]]
    ],
{ PARAMETER 19
    [[1, 0, clc$string_type], [0, jmc$user_information_size, FALSE]],
{ PARAMETER 20
    [[1, 0, clc$name_type], [1, osc$max_name_size]]];

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

    CONST
      p$login_user = 1,
      p$password = 2,
      p$login_family = 3,
      p$login_account = 4,
      p$login_project = 5,
      p$cpu_time_limit = 6,
      p$earliest_run_time = 7,
      p$job_abort_disposition = 8,
      p$job_class = 9,
      p$job_deferred_by_user = 10,
      p$job_destination_usage = 11,
      p$job_execution_ring = 12,
      p$job_qualifier = 13,
      p$job_recovery_disposition = 14,
      p$latest_run_time = 15,
      p$magnetic_tape_limit = 16,
      p$maximum_working_set = 17,
      p$sru_limit = 18,
      p$user_information = 19,
      p$user_job_name = 20;

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

    VAR
      default_job_attributes_p: ^jmt$default_attribute_results,
      job_qualifier_index: 1 .. jmc$maximum_job_qualifiers,
      value: ^clt$data_value;


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

    job_system_label.login_user_identification.user := pvt [p$login_user].value^.name_value;

    IF pvt [p$password].specified THEN
      job_system_label.login_password := pvt [p$password].value^.name_value;
    IFEND;

    IF pvt [p$login_family].specified THEN
      job_system_label.login_user_identification.family := pvt [p$login_family].value^.name_value;
    IFEND;

    IF pvt [p$login_account].specified THEN
      job_system_label.login_account := pvt [p$login_account].value^.name_value;
    IFEND;

    IF pvt [p$login_project].specified THEN
      job_system_label.login_project := pvt [p$login_project].value^.name_value;
    IFEND;

    IF pvt [p$cpu_time_limit].specified THEN
      IF pvt [p$cpu_time_limit].value^.kind = clc$integer THEN
        job_system_label.limit_information.cpu_time_limit_requested :=
              pvt [p$cpu_time_limit].value^.integer_value.value;
      ELSEIF pvt [p$cpu_time_limit].value^.keyword_value = 'SYSTEM_DEFAULT' THEN
        job_system_label.limit_information.cpu_time_limit_requested := jmc$system_default_cpu_time_lim;
      ELSE { IF pvt [p$cpu_time_limit].value^.keyword_value = 'UNLIMITED' THEN
        job_system_label.limit_information.cpu_time_limit_requested := jmc$unlimited_cpu_time_limit;
      IFEND;
      job_system_label.limit_information.cpu_time_limit_specified := TRUE;
    IFEND;

    IF pvt [p$earliest_run_time].specified THEN
      job_system_label.job_attributes.earliest_run_time.specified := TRUE;
      job_system_label.job_attributes.earliest_run_time.date_time :=
            pvt [p$earliest_run_time].value^.date_time_value.value;
    IFEND;

    IF pvt [p$job_abort_disposition].specified THEN
      IF pvt [p$job_abort_disposition].value^.keyword_value = 'RESTART' THEN
        job_system_label.job_abort_disposition := jmc$restart_on_abort;
      ELSE { IF pvt [p$job_abort_disposition].value^.keyword_value = 'TERMINATE' THEN
        job_system_label.job_abort_disposition := jmc$terminate_on_abort;
      IFEND;
    IFEND;

    IF pvt [p$job_class].specified THEN
      job_system_label.job_class_name := pvt [p$job_class].value^.name_value;
    IFEND;

    job_system_label.job_deferred_by_user := pvt [p$job_deferred_by_user].value^.boolean_value.value;

    IF pvt [p$job_destination_usage].specified THEN
      IF pvt [p$job_destination_usage].value^.kind = clc$name THEN
        job_system_label.job_destination_usage := pvt [p$job_destination_usage].value^.name_value;
      ELSE
        job_system_label.job_destination_usage := pvt [p$job_destination_usage].value^.keyword_value;
      IFEND;
    IFEND;

    IF pvt [p$job_execution_ring].specified THEN
      job_system_label.job_execution_ring := pvt [p$job_execution_ring].value^.integer_value.value;
    IFEND;

    IF pvt [p$job_qualifier].specified THEN
      IF pvt [p$job_qualifier].value^.kind = clc$keyword THEN
        IF pvt [p$job_qualifier].value^.keyword_value = 'NONE' THEN
          FOR job_qualifier_index := 1 TO jmc$maximum_job_qualifiers DO
            job_system_label.job_attributes.job_qualifier_list [job_qualifier_index] := osc$null_name;
          FOREND;
        ELSE { IF pvt [p$job_qualifier].value^.keyword_value = 'SYSTEM_DEFAULT' THEN
          PUSH default_job_attributes_p: [1 .. 1];
          default_job_attributes_p^ [1].key := jmc$job_qualifier_list;
          default_job_attributes_p^ [1].job_qualifier_list :=
                ^job_system_label.job_attributes.job_qualifier_list;
          jmp$get_attribute_defaults (job_system_label.job_mode, default_job_attributes_p, status);
        IFEND;

      ELSE { IF pvt [p$job_qualifier].value^.kind = clc$list THEN
        value := pvt [p$job_qualifier].value;
        FOR job_qualifier_index := 1 TO jmc$maximum_job_qualifiers DO
          IF value <> NIL THEN
            job_system_label.job_attributes.job_qualifier_list [job_qualifier_index] :=
                  value^.element_value^.name_value;
            value := value^.link;
          ELSE
            job_system_label.job_attributes.job_qualifier_list [job_qualifier_index] := osc$null_name;
          IFEND;
        FOREND;
      IFEND;
    IFEND;

    IF pvt [p$job_recovery_disposition].specified THEN
      IF pvt [p$job_recovery_disposition].value^.keyword_value = 'CONTINUE' THEN
        job_system_label.job_recovery_disposition := jmc$continue_on_recovery;
      ELSEIF pvt [p$job_recovery_disposition].value^.keyword_value = 'RESTART' THEN
        job_system_label.job_recovery_disposition := jmc$restart_on_recovery;
      ELSE { IF pvt [p$job_recovery_disposition].value^.keyword_value = 'TERMINATE' THEN
        job_system_label.job_recovery_disposition := jmc$terminate_on_recovery;
      IFEND;
    IFEND;

    IF pvt [p$latest_run_time].specified THEN
      job_system_label.job_attributes.latest_run_time.specified := TRUE;
      job_system_label.job_attributes.latest_run_time.date_time :=
            pvt [p$latest_run_time].value^.date_time_value.value;
    IFEND;

    IF pvt [p$magnetic_tape_limit].specified THEN
      IF pvt [p$magnetic_tape_limit].value^.kind = clc$integer THEN
        job_system_label.limit_information.magnetic_tape_limit_requested := pvt [p$magnetic_tape_limit].
              value^.integer_value.value;
        job_system_label.limit_information.magnetic_tape_limit_specified := TRUE;
      ELSEIF pvt [p$magnetic_tape_limit].value^.keyword_value = 'SYSTEM_DEFAULT' THEN
        job_system_label.limit_information.magnetic_tape_limit_requested := jmc$system_default_mag_tape_lim;
      ELSEIF pvt [p$magnetic_tape_limit].value^.keyword_value = 'UNLIMITED' THEN
        job_system_label.limit_information.magnetic_tape_limit_requested := jmc$unlimited_mag_tape_limit;
      ELSE { IF pvt [p$magnetic_tape_limit].value^.keyword_value = 'UNSPECIFIED' THEN
        job_system_label.limit_information.magnetic_tape_limit_requested := jmc$unspecified_mag_tape_limit;
      IFEND;
      job_system_label.limit_information.magnetic_tape_limit_specified := TRUE;
    IFEND;

    IF pvt [p$maximum_working_set].specified THEN
      IF pvt [p$maximum_working_set].value^.kind = clc$integer THEN
        job_system_label.limit_information.maximum_working_set_requested := pvt [p$maximum_working_set].
              value^.integer_value.value;
      ELSEIF pvt [p$maximum_working_set].value^.keyword_value = 'SYSTEM_DEFAULT' THEN
        job_system_label.limit_information.maximum_working_set_requested := jmc$system_default_work_set_siz;
      ELSE { IF pvt [p$maximum_working_set].value^.keyword_value = 'UNLIMITED' THEN
        job_system_label.limit_information.maximum_working_set_requested := jmc$unlimited_working_set_size;
      IFEND;
      job_system_label.limit_information.maximum_working_set_specified := TRUE;
    IFEND;

    IF pvt [p$sru_limit].specified THEN
      IF pvt [p$sru_limit].value^.kind = clc$integer THEN
        job_system_label.limit_information.sru_limit_requested := pvt [p$sru_limit].value^.integer_value.
              value;
      ELSEIF pvt [p$sru_limit].value^.keyword_value = 'SYSTEM_DEFAULT' THEN
        job_system_label.limit_information.sru_limit_requested := jmc$system_default_sru_limit;
      ELSE { IF pvt [p$sru_limit]va.ue^.keyword_value = 'UNLIMITED' THEN
        job_system_label.limit_information.sru_limit_requested := jmc$unlimited_sru_limit;
      IFEND;
      job_system_label.limit_information.sru_limit_specified := TRUE;
    IFEND;

    IF pvt [p$user_information].specified THEN
      job_system_label.job_attributes.user_information := pvt [p$user_information].value^.string_value^;
    IFEND;

    IF pvt [p$user_job_name].specified THEN
      job_system_label.user_job_name := pvt [p$user_job_name].value^.name_value;
    IFEND;

  PROCEND clp$get_login_parameters;
?? TITLE := 'clp$login', EJECT ??

  PROCEDURE [XDCL] clp$login
    (VAR status: ost$status);

?? NEWTITLE := 'process_prolog', EJECT ??

    PROCEDURE process_prolog
      (    prolog: string ( * );
           processing_phase: clt$processing_phase;
       VAR status: ost$status);

?? TITLE := 'login_break_handler', EJECT ??

      PROCEDURE login_break_handler
        (    condition: pmt$condition;
             ignore_condition_information: ^pmt$condition_information;
             ignore_save_area: ^ost$stack_frame_save_area;
         VAR handler_status: ost$status);

        VAR
          termination_status: ost$status;

        CASE condition.selector OF
        = ifc$interactive_condition =
          IF condition.interactive_condition = ifc$terminate_break THEN
            terminate_break_detected := TRUE;
            #SPOIL (terminate_break_detected);
            EXIT process_prolog;
          IFEND;
        = pmc$block_exit_processing =
          IF terminate_break_detected THEN
            ifp$discard_suspended_output;
            osp$set_status_abnormal ('CL', cle$command_terminated, '', termination_status);
            osp$generate_output_message (termination_status, status);
          IFEND;
          RETURN;
        ELSE
          ;
        CASEND;

        pmp$continue_to_cause (pmc$execute_standard_procedure, handler_status);

      PROCEND login_break_handler;
?? OLDTITLE, EJECT ??

      VAR
        file_attributes: array [1 .. 1] of amt$get_item,
        file_exists: boolean,
        ignore_contains_data: boolean,
        ignore_file_previously_opened: boolean,
        p_local_status: ^ost$status,
        terminate_break_detected: boolean;

      IF processing_phase = clc$user_prolog_phase THEN
        terminate_break_detected := FALSE;
        #SPOIL (terminate_break_detected);
        osp$establish_condition_handler (^login_break_handler, TRUE);
      IFEND;

      clp$set_processing_phase (processing_phase, status);
      clp$include_file (prolog, '', osc$null_name, status);
      IF (NOT status.normal) AND (status.condition = ame$file_not_known) THEN
        file_attributes [1].key := amc$null_attribute;
        PUSH p_local_status;
        amp$get_file_attributes (prolog, file_attributes, file_exists, ignore_file_previously_opened,
              ignore_contains_data, p_local_status^);
        IF (NOT p_local_status^.normal) OR (NOT file_exists) THEN
          status.condition := cle$login_prolog_file_missing;
          IF processing_phase = clc$user_prolog_phase THEN
            osp$generate_log_message ($pmt$ascii_logset [pmc$job_log], status, p_local_status^);
          IFEND;
        IFEND;
      IFEND;

      IF processing_phase = clc$user_prolog_phase THEN
        osp$disestablish_cond_handler;
      IFEND;

    PROCEND process_prolog;
?? OLDTITLE ??
?? NEWTITLE := 'handle_prolog_error_status', EJECT ??

{ PURPOSE:
{   The purpose of this request is to report an error found in a prolog and determine if the login
{ process should continue.

    PROCEDURE handle_prolog_error_status
      (    prolog_name: ost$name_reference);

      VAR
        ignore_status: ost$status,
        local_status: ost$status;

      osp$get_status_severity (status.condition, severity, ignore_status);
      IF severity >= osc$error_status THEN
        IF (get_attribute_p^ [2].job_class = jmc$system_class_name) OR
              ((get_attribute_p^ [1].job_mode <> jmc$batch) AND (prolog_name <> system_prolog_name)) THEN
          osp$set_status_abnormal (jmc$job_management_id, jme$login_error_in_prolog, prolog_name,
                local_status);
          osp$generate_message (local_status, ignore_status);
          osp$generate_message (status, ignore_status);
        ELSE
          osp$set_status_abnormal (jmc$job_management_id, jme$login_abort_in_prolog, prolog_name,
                local_status);
          osp$generate_message (local_status, ignore_status);
          pmp$abort (status);
        IFEND;
      IFEND;
      status.normal := TRUE;

    PROCEND handle_prolog_error_status;
?? OLDTITLE, EJECT ??

    CONST
      system_prolog_name = 'SYSTEM';

    VAR
      account_prolog: string (fsc$max_path_size),
      block_at_login: ^clt$block,
      get_attribute_p: ^jmt$job_attribute_results,
      ignore_status: ost$status,
      interrupt_capability: boolean,
      job_class_prolog: string (fsc$max_path_size),
      processing_phase: clt$processing_phase,
      project_prolog: string (fsc$max_path_size),
      severity: ost$status_severity,
      user_prolog: string (fsc$max_path_size);

    status.normal := TRUE;

    IF NOT jmp$system_job () THEN
      clp$find_current_block (block_at_login);

      PUSH get_attribute_p: [1 .. 2];
      get_attribute_p^ [1].key := jmc$job_mode;
      get_attribute_p^ [2].key := jmc$job_class;
      jmp$get_job_attributes (get_attribute_p, { ignore } status);

{ Begin account/project processing and log the login command.

      clp$log_edited_login_command (status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      avp$display_pw_exp_warning (status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

{ Execute system prolog

      ?IF clc$compiling_for_test_harness THEN
        clp$set_processing_phase (clc$system_prolog_phase, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
        clp$include_line ('system_prolog', TRUE, osc$null_name, status);
      ?ELSE
        process_prolog (avc$system_prolog, clc$system_prolog_phase, status);
      ?IFEND
      IF NOT status.normal THEN
        handle_prolog_error_status (system_prolog_name);
      IFEND;

{ Execute job class prolog.

      jmp$get_job_class_prolog (job_class_prolog, status);
      IF status.normal THEN
        IF (job_class_prolog <> '') THEN
          process_prolog (job_class_prolog, clc$class_prolog_phase, status);
          IF NOT status.normal THEN
            handle_prolog_error_status ('JOB CLASS');
          IFEND;
        IFEND;
      IFEND;

{ Execute account prolog

      avp$get_capability (avc$interrupt_prologs, avc$user, interrupt_capability, status);
      IF NOT status.normal THEN
        IF (status.condition = ave$unknown_field) OR (status.condition = ave$field_was_deleted) THEN
          status.normal := TRUE;
          interrupt_capability := TRUE;
        ELSE
          RETURN;
        IFEND;
      IFEND;

      IF interrupt_capability THEN
        jmp$enable_user_breaks;
      IFEND;

      ?IF NOT clc$compiling_for_test_harness THEN
        avp$get_file_value (avc$account_prolog, avc$account, account_prolog, status);
        IF status.normal THEN
          IF ((account_prolog (1, 5) <> '$NULL') AND (account_prolog (1, 12) <> '$LOCAL.$NULL')) THEN
            process_prolog (account_prolog, clc$account_prolog_phase, status);
          IFEND;
        ELSE
          IF status.condition = ave$account_info_not_found THEN
            status.normal := TRUE;
          IFEND;
        IFEND;
        IF NOT status.normal THEN
          handle_prolog_error_status ('ACCOUNT');
        IFEND;

{ Execute project prolog

        avp$get_file_value (avc$project_prolog, avc$project, project_prolog, status);
        IF status.normal THEN
          IF ((project_prolog (1, 5) <> '$NULL') AND (project_prolog (1, 12) <> '$LOCAL.$NULL')) THEN
            process_prolog (project_prolog, clc$project_prolog_phase, status);
          IFEND;
        ELSE
          IF status.condition = ave$project_info_not_found THEN
            status.normal := TRUE;
          IFEND;
        IFEND;
        IF NOT status.normal THEN
          handle_prolog_error_status ('PROJECT');
        IFEND;
      ?IFEND

      IF get_attribute_p^ [1].job_mode <> jmc$batch THEN
        osp$set_message_level (osc$brief_message_level, status);
      IFEND;

{ Execute user prolog

      avp$get_file_value (avc$user_prolog, avc$user, user_prolog, status);
      IF status.normal THEN
        IF ((user_prolog (1, 5) <> '$NULL') AND (user_prolog (1, 12) <> '$LOCAL.$NULL')) THEN
          process_prolog (user_prolog, clc$user_prolog_phase, status);
        IFEND;
      IFEND;
      IF NOT status.normal THEN
        handle_prolog_error_status ('USER');
      IFEND;
      IF jmv$initialized_as_disconnected THEN

{ Jobs in this state must not escape from the user prolog phase

        jmp$logout (ignore_status);
      IFEND;

      IF NOT interrupt_capability THEN
        jmp$enable_user_breaks;
      IFEND;

    IFEND; {if not executing within system job

    clp$set_processing_phase (clc$command_phase, ignore_status);

  PROCEND clp$login;
?? TITLE := 'clp$logout_command', EJECT ??

  PROCEDURE [XDCL] clp$logout_command
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (osm$logout) logout

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
      recend := [[1, [87, 10, 29, 15, 5, 52, 981], clc$command, 0, 0, 0, 0, 0, 0, 0, 'OSM$LOGOUT']];

?? POP ??


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

    jmp$logout (status);

  PROCEND clp$logout_command;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL] clp$execute_job_epilog', EJECT ??
*copyc clh$execute_job_epilog

  PROCEDURE [XDCL] clp$execute_job_epilog;

    VAR
      block_at_logout: ^clt$block,
      epilog_file: string (fsc$max_path_size),
      file: clt$command_list_entry_file,
      ignore_status: ost$status,
      severity: ost$status_severity,
      status: ost$status;

    ?IF clc$compiling_for_test_harness THEN

      VAR
        system_command_library: [STATIC, READ, oss$job_paged_literal] string (27) :=
              ':$LOCAL.OSF$COMMAND_LIBRARY';

    ?ELSE

      VAR
        system_command_library: [STATIC, READ, oss$job_paged_literal] string (36) :=
              ':$SYSTEM.$SYSTEM.OSF$COMMAND_LIBRARY';

    ?IFEND

?? NEWTITLE := 'process_epilog', EJECT ??

    PROCEDURE process_epilog
      (VAR status: ost$status);

      VAR
        terminate_break_detected: boolean;

?? NEWTITLE := 'interactive_terminate_handler', ??

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


        CASE condition.selector OF

        = pmc$block_exit_processing =
          IF terminate_break_detected THEN
            ifp$discard_suspended_output;
            clp$put_job_output (' Epilog terminated', ignore_status);
          IFEND;
          RETURN;

        = ifc$interactive_condition =
          IF condition.interactive_condition = ifc$terminate_break THEN
            terminate_break_detected := TRUE;
            EXIT process_epilog;
          IFEND;

        ELSE
          ;
        CASEND;

        pmp$continue_to_cause (pmc$execute_standard_procedure, handler_status);

      PROCEND interactive_terminate_handler;
?? OLDTITLE, EJECT ??

      terminate_break_detected := FALSE;
      #SPOIL (terminate_break_detected);
      osp$establish_condition_handler (^interactive_terminate_handler, TRUE);
      IF clv$processing_phase > clc$user_epilog_phase THEN
        prepare_for_epilog;
      IFEND;
      clp$include_file (pmv$epilog_file, '', osc$null_name, status);
      osp$disestablish_cond_handler;

    PROCEND process_epilog;
?? OLDTITLE ??
?? NEWTITLE := 'prepare_for_epilog', EJECT ??

    PROCEDURE prepare_for_epilog;

{ The job command search mode must be reset to global by ring 3 code before calling
{ this procedure.

      VAR
        context: ^ost$ecp_exception_context;

      PUSH context;

      REPEAT
        clp$delete_all_from_cmnd_list (status);
        IF NOT status.normal THEN
          context^ := osv$initial_exception_context;
          context^.condition_status := status;
          osp$enforce_exception_policies (context^);
          status := context^.condition_status;
        IFEND;
      UNTIL status.normal OR (NOT osp$file_access_condition (status)) OR (NOT context^.wait);
      IF (NOT status.normal) AND (NOT osp$file_access_condition (status)) THEN
        osp$generate_log_message ($pmt$ascii_logset [pmc$job_log], status, ignore_status);
      IFEND;

      file.kind := clc$command_list_entry_$system;
      REPEAT
        clp$add_file_to_command_list (file, FALSE, status);
        IF NOT status.normal THEN
          context^ := osv$initial_exception_context;
          context^.condition_status := status;
          osp$enforce_exception_policies (context^);
          status := context^.condition_status;
        IFEND;
      UNTIL status.normal OR (NOT osp$file_access_condition (status)) OR (NOT context^.wait);
      IF (NOT status.normal) AND (NOT osp$file_access_condition (status)) THEN
        osp$generate_log_message ($pmt$ascii_logset [pmc$job_log], status, ignore_status);
      IFEND;

      file.kind := clc$command_list_entry_path;
      file.path := ^system_command_library;
      REPEAT
        clp$establish_sys_command_lib (file.path, status);
        IF NOT status.normal THEN
          context^ := osv$initial_exception_context;
          context^.file.selector := osc$ecp_file_reference;
          context^.file.file_reference := file.path;
          context^.condition_status := status;
          osp$enforce_exception_policies (context^);
          status := context^.condition_status;
        IFEND;
      UNTIL status.normal OR (NOT osp$file_access_condition (status)) OR (NOT context^.wait);
      IF (NOT status.normal) AND (NOT osp$file_access_condition (status)) THEN
        osp$generate_log_message ($pmt$ascii_logset [pmc$job_log], status, ignore_status);
      IFEND;

      IF clv$processing_phase < clc$class_epilog_phase THEN
        clp$delete_all_targets (clv$standard_files [clc$sf_echo_file].path_handle_name, ignore_status);
      ELSE
        clp$delete_all_file_connections;
      IFEND;

      clp$free_all_handlers

    PROCEND prepare_for_epilog;
?? OLDTITLE, EJECT ??

    CASE clv$processing_phase OF

    = clc$user_epilog_phase =

{ Execute user epilog

      jmp$enable_exit_processing;
      process_epilog (status);
      IF NOT status.normal THEN
        IF status.condition = ame$file_not_known THEN
          avp$get_file_value (avc$user_epilog, avc$user, epilog_file, status);
          osp$set_status_condition (cle$epilog_file_missing, status);
          osp$append_status_file (osc$status_parameter_delimiter, epilog_file, status);
          osp$generate_log_message ($pmt$ascii_logset [pmc$job_log], status, ignore_status);
        ELSE
          osp$get_status_severity (status.condition, severity, ignore_status);
          IF severity >= osc$error_status THEN
            clp$put_job_command_response (' Following error in USER epilog:', ignore_status);
            osp$generate_message (status, ignore_status);
          IFEND;
        IFEND;
        status.normal := TRUE;
      IFEND;
      jmp$inhibit_exit_processing;

    = clc$project_epilog_phase =

{ Execute project epilog

      process_epilog (status);
      IF NOT status.normal THEN
        IF status.condition <> ame$file_not_known THEN
          osp$get_status_severity (status.condition, severity, ignore_status);
          IF severity >= osc$error_status THEN
            clp$put_job_command_response (' Following error in PROJECT epilog:', ignore_status);
            osp$generate_message (status, ignore_status);
          IFEND;
        IFEND;
        status.normal := TRUE;
      IFEND;

    = clc$account_epilog_phase =

{ Execute account epilog

      process_epilog (status);
      IF NOT status.normal THEN
        IF status.condition <> ame$file_not_known THEN
          osp$get_status_severity (status.condition, severity, ignore_status);
          IF severity >= osc$error_status THEN
            clp$put_job_command_response (' Following error in ACCOUNT epilog:', ignore_status);
            osp$generate_message (status, ignore_status);
          IFEND;
        IFEND;
        status.normal := TRUE;
      IFEND;

    = clc$class_epilog_phase =

{ Execute job class epilog.

      process_epilog (status);
      IF NOT status.normal THEN
        IF status.condition <> ame$file_not_known THEN
          osp$get_status_severity (status.condition, severity, ignore_status);
          IF severity >= osc$error_status THEN
            clp$put_job_command_response (' Following error in JOB CLASS epilog:', ignore_status);
            osp$generate_message (status, ignore_status);
          IFEND;
        IFEND;
        status.normal := TRUE;
      IFEND;

    = clc$system_epilog_phase =

      ?IF NOT clc$compiling_for_test_harness THEN

{ Execute system epilog

        epilog_file := avc$system_epilog;
        process_epilog (status);
        IF NOT status.normal THEN
          IF status.condition <> ame$file_not_known THEN
            osp$get_status_severity (status.condition, severity, ignore_status);
            IF severity >= osc$error_status THEN
              clp$put_job_command_response (' Following error in SYSTEM epilog:', ignore_status);
              osp$generate_message (status, ignore_status);
            IFEND;
          IFEND;
          status.normal := TRUE;
        IFEND;
      ?IFEND

    ELSE
      ;
    CASEND;

  PROCEND clp$execute_job_epilog;

MODEND clm$system_access_commands;
