?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Accounting and Validation: Validation Commands' ??
MODULE avm$validation_commands;

{ PURPOSE:
{   This module contains the command and function processors used to control system and user access to NOS/VE.
{
{ DESIGN:
{   The command processors in this module convert the parameter values specified on the command into their
{   internal formats (when necessary) and call the appropriate validation program interface.

*copyc avc$compile_test_code
?IF avc$compile_test_code THEN
  PROCEDURE [XREF] initialize
    (    validation_level: avt$validation_level;
         system_administrator: boolean;
         family_administrator: boolean;
     VAR status: ost$status);
?IFEND

?? NEWTITLE := 'Global declarations referenced by this module.', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc avc$max_template_record_size
*copyc cle$work_area_overflow
*copyc clt$work_area
*copyc fst$path
*copyc oss$job_paged_literal
?? POP ??
*copyc avp$change_password
*copyc avp$get_account_project_value
*copyc avp$get_accum_limit_value
*copyc avp$get_capability
*copyc avp$get_date_time_value
*copyc avp$get_field_type
*copyc avp$get_file_value
*copyc avp$get_integer_value
*copyc avp$get_job_class_value
*copyc avp$get_labeled_names_value
*copyc avp$get_limit_value
*copyc avp$get_login_password_value
*copyc avp$get_name_value
*copyc avp$get_real_value
*copyc avp$get_string_value
*copyc avp$make_acct_proj_scl_value
*copyc avp$make_accum_limit_scl_value
*copyc avp$make_capability_scl_value
*copyc avp$make_date_time_scl_value
*copyc avp$make_file_scl_value
*copyc avp$make_integer_scl_value
*copyc avp$make_job_class_scl_value
*copyc avp$make_labeled_names_scl_valu
*copyc avp$make_limit_scl_value
*copyc avp$make_login_pw_scl_value
*copyc avp$make_name_scl_value
*copyc avp$make_real_scl_value
*copyc avp$make_ring_priv_scl_value
*copyc avp$make_string_scl_value
*copyc avp$ring_min
*copyc avp$ring_nominal
*copyc avp$set_validation_level
*copyc avp$validation_level
*copyc clp$evaluate_parameters
*copyc clp$make_name_value
*copyc osp$set_status_abnormal
?? OLDTITLE ??
?? NEWTITLE := 'Global declarations declared by this module.', EJECT ??
?? FMT (FORMAT := OFF) ??
  VAR
    avv$field_kind_names: [#GATE, XDCL, READ, oss$job_paged_literal] array [avt$field_kind] of ost$name :=
          ['ACCOUNT_PROJECT                ', 'ACCUMULATING_LIMIT             ',
          'CAPABILITY                     ', 'DATE_TIME                      ',
          'FILE                           ', 'INTEGER                        ',
          'JOB_CLASS                      ', 'KEYWORD                        ',
          'LIMIT                          ', 'LOGIN_PASSWORD                 ',
          'NAME                           ', 'REAL                           ',
          'RESTRICTION                    ', 'RING_PRIVILEGE                 ',
          'STRING                         ', 'LABELED_NAMES                  ',
          'UNUSED                         ', 'UNUSED                         ',
          'UNUSED                         ', 'UNUSED                         ',
          'UNUSED                         ', 'UNUSED                         ',
          'UNUSED                         ', 'UNUSED                         ',
          'UNUSED                         ', 'UNUSED                         ',
          'UNUSED                         ', 'UNUSED                         ',
          'UNUSED                         ', 'UNUSED                         ',
          'UNUSED                         ', 'UNUSED                         '];
?? FMT (FORMAT := ON) ??

?? NEWTITLE := '[XDCL] avp$change_password_command', EJECT ??
{ PURPOSE:
{   This is the command processor for CHANGE_LOGIN_PASSWORD.
{
{ DESIGN:
{   AVP$CHANGE_PASSWORD is called to update the currently executing user's login
{   password.

  PROCEDURE [XDCL] avp$change_password_command
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (osm$chalpw) change_login_password, set_password, setpw, chalpw (
{   old_password, f, from, opw: (SECURE) name = $required
{   new_password, t, to, npw: (SECURE) name = $required
{   expiration_interval, ei: any of
{       key
{         unlimited
{       keyend
{       integer 1..365
{     anyend = $optional
{   expiration_date, ed: any of
{       key
{         none
{       keyend
{       date_time
{     anyend = $optional
{   update_batch_job_passwords, ubjpw: (BY_NAME) boolean = osd$chalpw_ubjpw, ..
{ TRUE
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 15] of clt$pdt_parameter_name,
      parameters: array [1 .. 6] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$date_time_type_qualifier,
        recend,
      recend,
      type5: record
        header: clt$type_specification_header,
        default_name: string (16),
        default_value: string (4),
      recend,
      type6: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [92, 5, 29, 9, 27, 36, 693],
    clc$command, 15, 6, 2, 0, 0, 0, 6, 'OSM$CHALPW'], [
    ['ED                             ',clc$abbreviation_entry, 4],
    ['EI                             ',clc$abbreviation_entry, 3],
    ['EXPIRATION_DATE                ',clc$nominal_entry, 4],
    ['EXPIRATION_INTERVAL            ',clc$nominal_entry, 3],
    ['F                              ',clc$alias_entry, 1],
    ['FROM                           ',clc$alias_entry, 1],
    ['NEW_PASSWORD                   ',clc$nominal_entry, 2],
    ['NPW                            ',clc$abbreviation_entry, 2],
    ['OLD_PASSWORD                   ',clc$nominal_entry, 1],
    ['OPW                            ',clc$abbreviation_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 6],
    ['T                              ',clc$alias_entry, 2],
    ['TO                             ',clc$alias_entry, 2],
    ['UBJPW                          ',clc$abbreviation_entry, 5],
    ['UPDATE_BATCH_JOB_PASSWORDS     ',clc$nominal_entry, 5]],
    [
{ PARAMETER 1
    [9, clc$normal_usage_entry, clc$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
    [7, clc$normal_usage_entry, clc$secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 5, clc$required_parameter, 0, 0],
{ PARAMETER 3
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 84, clc$optional_parameter, 0, 0],
{ PARAMETER 4
    [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, 69, clc$optional_parameter, 0, 0],
{ PARAMETER 5
    [15, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_default_parameter, 16, 4],
{ PARAMETER 6
    [11, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 2
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 3
    [[1, 0, clc$union_type], [[clc$integer_type,
    clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['UNLIMITED                      ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [1, 365, 10]]
    ],
{ PARAMETER 4
    [[1, 0, clc$union_type], [[clc$date_time_type,
    clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NONE                           ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    5, [[1, 0, clc$date_time_type], [$clt$date_and_or_time [clc$date, clc$time
  ], $clt$date_time_tenses [clc$past, clc$present, clc$future]]]
    ],
{ PARAMETER 5
    [[1, 0, clc$boolean_type],
    'OSD$CHALPW_UBJPW',
    'TRUE'],
{ PARAMETER 6
    [[1, 0, clc$status_type]]];

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

    CONST
      p$old_password = 1,
      p$new_password = 2,
      p$expiration_interval = 3,
      p$expiration_date = 4,
      p$update_batch_job_passwords = 5,
      p$status = 6;

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

    VAR
      expiration_date: ^ost$date_time,
      expiration_interval: ^pmt$time_increment,
      new_password: avt$password,
      old_password: avt$password;

    ?IF avc$compile_test_code THEN
      initialize (avc$user_level, FALSE, FALSE, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
    ?IFEND

    status.normal := TRUE;

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

    IF pvt [p$expiration_interval].specified THEN
      PUSH expiration_interval;
      IF pvt [p$expiration_interval].value^.kind = clc$keyword THEN
        expiration_interval^.year := UPPERVALUE (expiration_interval^.year);
        expiration_interval^.month := UPPERVALUE (expiration_interval^.month);
        expiration_interval^.day := UPPERVALUE (expiration_interval^.day);
        expiration_interval^.hour := UPPERVALUE (expiration_interval^.hour);
        expiration_interval^.minute := UPPERVALUE (expiration_interval^.minute);
        expiration_interval^.second := UPPERVALUE (expiration_interval^.second);
        expiration_interval^.millisecond := UPPERVALUE (expiration_interval^.millisecond);
      ELSE { clc$integer}
        expiration_interval^.year := 0;
        expiration_interval^.month := 0;
        expiration_interval^.day := pvt [p$expiration_interval].value^.integer_value.value;
        expiration_interval^.hour := 0;
        expiration_interval^.minute := 0;
        expiration_interval^.second := 0;
        expiration_interval^.millisecond := 0;
      IFEND;
    ELSE
      expiration_interval := NIL;
    IFEND;

    IF pvt [p$expiration_date].specified THEN
      PUSH expiration_date;
      IF pvt [p$expiration_date].value^.kind = clc$keyword THEN
        expiration_date^.year := UPPERVALUE (expiration_date^.year);
        expiration_date^.month := UPPERVALUE (expiration_date^.month);
        expiration_date^.day := UPPERVALUE (expiration_date^.day);
        expiration_date^.hour := UPPERVALUE (expiration_date^.hour);
        expiration_date^.minute := UPPERVALUE (expiration_date^.minute);
        expiration_date^.second := UPPERVALUE (expiration_date^.second);
        expiration_date^.millisecond := UPPERVALUE (expiration_date^.millisecond);
      ELSE {clc$date_time}
        expiration_date^ := pvt [p$expiration_date].value^.date_time_value.value;
      IFEND;
    ELSE
      expiration_date := NIL;
    IFEND;

    old_password := pvt [p$old_password].value^.name_value;
    new_password := pvt [p$new_password].value^.name_value;

    avp$change_password (old_password, new_password, expiration_date, expiration_interval,
          pvt [p$update_batch_job_passwords].value^.boolean_value.value, status);

    old_password := ' ';
    new_password := ' ';
    pvt [p$old_password].value^.name_value := ' ';
    pvt [p$new_password].value^.name_value := ' ';

  PROCEND avp$change_password_command;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL] avp$change_validation_level', EJECT ??
{ PURPOSE:
{   This is the command processor for the CHANGE_VALIDATION_LEVEL command.
{
{ DESIGN:
{   AVP$SET_VALIDATION_LEVEL is called with the specified validation level.

  PROCEDURE [XDCL] avp$change_validation_level
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (osm$chavl) change_validation_level (
{   validation_level, vl: key
{       user, account, project
{     keyend = $required
{   status)

?? PUSH (LISTEXT := ON) ??

  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$keyword_type_qualifier,
        keyword_specs: array [1 .. 3] of clt$keyword_specification,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [88, 9, 29, 11, 56, 39, 344],
    clc$command, 3, 2, 1, 0, 0, 0, 2, 'OSM$CHAVL'], [
    ['STATUS                         ',clc$nominal_entry, 2],
    ['VALIDATION_LEVEL               ',clc$nominal_entry, 1],
    ['VL                             ',clc$abbreviation_entry, 1]],
    [
{ PARAMETER 1
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 118,
  clc$required_parameter, 0, 0],
{ PARAMETER 2
    [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$keyword_type], [3], [
    ['ACCOUNT                        ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['PROJECT                        ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['USER                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
    ],
{ PARAMETER 2
    [[1, 0, clc$status_type]]];

?? POP ??

  CONST
    p$validation_level = 1,
    p$status = 2;

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

    VAR
      level: avt$validation_level;

    status.normal := TRUE;

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

    IF pvt [p$validation_level].value^.keyword_value = 'USER' THEN
      level := avc$user_level;
    ELSEIF pvt [p$validation_level].value^.keyword_value = 'ACCOUNT' THEN
      level := avc$account_level;
    ELSE
      level := avc$project_level;
    IFEND;

    avp$set_validation_level (level, status);

  PROCEND avp$change_validation_level;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL] avp$$job_validation', EJECT ??

{ PURPOSE:
{   Return information about a specified validation field for the executing job.

  PROCEDURE [XDCL] avp$$job_validation
    (    parameter_list: clt$parameter_list;
     VAR work_area: ^clt$work_area;
     VAR result: ^clt$data_value;
     VAR status: ost$status);

{ FUNCTION (osm$$job_validation) $job_validation (
{   field_name: name = $required
{   option: key
{       (declared, d)
{       (type, t)
{       (value, v)
{     keyend = value
{   validation_record: key
{       (account, a)
{       (account_member, am)
{       (project, p)
{       (project_member, pm)
{       (user, u)
{     keyend = user
{   )

?? 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 .. 3] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 6] of clt$keyword_specification,
        default_value: string (5),
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 10] of clt$keyword_specification,
        default_value: string (4),
      recend,
    recend := [
    [1,
    [88, 12, 14, 13, 57, 8, 847],
    clc$function, 3, 3, 1, 0, 0, 0, 0, 'OSM$$JOB_VALIDATION'], [
    ['FIELD_NAME                     ',clc$nominal_entry, 1],
    ['OPTION                         ',clc$nominal_entry, 2],
    ['VALIDATION_RECORD              ',clc$nominal_entry, 3]],
    [
{ 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, 5, clc$required_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, 229,
  clc$optional_default_parameter, 0, 5],
{ PARAMETER 3
    [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, 377,
  clc$optional_default_parameter, 0, 4]],
{ PARAMETER 1
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 2
    [[1, 0, clc$keyword_type], [6], [
    ['D                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['DECLARED                       ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['T                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['TYPE                           ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['V                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['VALUE                          ', clc$nominal_entry, clc$normal_usage_entry, 3]]
    ,
    'value'],
{ PARAMETER 3
    [[1, 0, clc$keyword_type], [10], [
    ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['ACCOUNT                        ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['ACCOUNT_MEMBER                 ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['AM                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['P                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['PM                             ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
    ['PROJECT                        ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['PROJECT_MEMBER                 ', clc$nominal_entry, clc$normal_usage_entry, 4],
    ['U                              ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
    ['USER                           ', clc$nominal_entry, clc$normal_usage_entry, 5]]
    ,
    'user']];

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

    CONST
      p$field_name = 1,
      p$option = 2,
      p$validation_record = 3;

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

    VAR
      account: avt$account_name,
      batch_default: ost$name,
      capability: boolean,
      change_date: ost$date_time,
      date_display_format: string(clc$max_date_time_form_string),
      date_time: avt$date_time,
      declared: ost$name,
      expiration_date: ost$date_time,
      expiration_interval: pmt$time_increment,
      expiration_warning_interval: pmt$time_increment,
      expired_password_chg_interval: pmt$time_increment,
      field_kind: avt$field_kind,
      field_work_area: ^seq (*),
      file_reference: fst$path,
      integer_value: integer,
      interactive_default: ost$name,
      job_limit_information: avt$job_limit_information,
      labeled_names: ^avt$labeled_names_list,
      limit_value: avt$limit_value,
      local_status: ost$status,
      maximum_expiration_interval: pmt$time_increment,
      name_list: ^avt$name_list,
      name_list_size: avt$name_list_size,
      numeric_display_format: avt$numeric_display_format,
      project: avt$project_name,
      real_value: real,
      string_value: ost$string,
      time_display_format: string(clc$max_date_time_form_string),
      total_limit_information: avt$total_limit_information,
      validation_record: avt$validation_record;

    status.normal := TRUE;

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

{ Determine which validation record to retrieve information from.

    IF pvt [p$validation_record].value^.keyword_value = 'USER' THEN
      validation_record := avc$user;
    ELSEIF pvt [p$validation_record].value^.keyword_value = 'ACCOUNT' THEN
      validation_record := avc$account;
    ELSEIF pvt [p$validation_record].value^.keyword_value = 'ACCOUNT_MEMBER' THEN
      validation_record := avc$account_member;
    ELSEIF pvt [p$validation_record].value^.keyword_value = 'PROJECT' THEN
      validation_record := avc$project;
    ELSE { PROJECT_MEMBER }
      validation_record := avc$project_member;
    IFEND;

{ Determine the type of the specified field.

    avp$get_field_type (pvt [p$field_name].value^.name_value, validation_record, field_kind, local_status);
    IF (NOT local_status.normal) AND (pvt [p$option].value^.keyword_value <> 'DECLARED') THEN
      status := local_status;
      RETURN;
    IFEND;

    IF (pvt [p$option].value^.keyword_value = 'DECLARED') THEN
      IF local_status.normal THEN
        declared := 'ACTIVE';
      ELSEIF local_status.condition = ave$field_was_deleted THEN
        declared := 'DELETED';
      ELSE
        declared := 'UNKNOWN';
      IFEND;

      clp$make_name_value (declared, work_area, result);
      IF result = NIL THEN
        osp$set_status_abnormal ('CL', cle$work_area_overflow, '', status);
        RETURN;
      IFEND;
    ELSEIF (pvt [p$option].value^.keyword_value = 'TYPE') THEN
      clp$make_name_value (avv$field_kind_names [field_kind], work_area, result);
      IF result = NIL THEN
        osp$set_status_abnormal ('CL', cle$work_area_overflow, '', status);
        RETURN;
      IFEND;
    ELSE { VALUE }
      CASE field_kind OF
      = avc$account_project_kind =
        avp$get_account_project_value (pvt [p$field_name].value^.name_value, validation_record, account,
              project, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
        avp$make_acct_proj_scl_value (account, project, work_area, result, status);
      = avc$accumulating_limit_kind =
        avp$get_accum_limit_value (pvt [p$field_name].value^.name_value, validation_record,
              job_limit_information, total_limit_information, numeric_display_format, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
        avp$make_accum_limit_scl_value (job_limit_information, total_limit_information,
              numeric_display_format, work_area, result, status);
      = avc$capability_kind =
        avp$get_capability (pvt [p$field_name].value^.name_value, validation_record, capability, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
        avp$make_capability_scl_value (capability, work_area, result, status);
      = avc$date_time_kind =
        avp$get_date_time_value (pvt [p$field_name].value^.name_value, validation_record, date_time,
              date_display_format, time_display_format, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
        avp$make_date_time_scl_value (date_time, work_area, result, status);
      = avc$file_kind =
        avp$get_file_value (pvt [p$field_name].value^.name_value, validation_record, file_reference,
              status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
        avp$make_file_scl_value (file_reference, work_area, result, status);
      = avc$integer_kind =
        avp$get_integer_value (pvt [p$field_name].value^.name_value, validation_record, integer_value,
              numeric_display_format, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
        avp$make_integer_scl_value (integer_value, numeric_display_format, work_area, result, status);
      = avc$job_class_kind =
        PUSH name_list: [1 .. avc$maximum_name_list_size];
        avp$get_job_class_value (pvt [p$field_name].value^.name_value, validation_record, name_list^,
              name_list_size, batch_default, interactive_default, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
        avp$make_job_class_scl_value (batch_default, interactive_default, name_list^, name_list_size,
              work_area, result, status);
      = avc$keyword_kind =

{ Keywords are not implemented yet.

      = avc$labeled_names_kind =
        PUSH field_work_area: [[REP avc$max_template_record_size OF cell]];
        RESET field_work_area;
        avp$get_labeled_names_value (pvt [p$field_name].value^.name_value, validation_record,
              field_work_area, labeled_names, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
        avp$make_labeled_names_scl_valu (labeled_names, work_area, result, status);
      = avc$limit_kind =
        avp$get_limit_value (pvt [p$field_name].value^.name_value, validation_record, limit_value,
              numeric_display_format, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
        avp$make_limit_scl_value (limit_value, numeric_display_format, work_area, result, status);
      = avc$login_password_kind =
        PUSH name_list: [1 .. avc$maximum_name_list_size];
        avp$get_login_password_value (pvt [p$field_name].value^.name_value, validation_record,
              expiration_date, expiration_interval, maximum_expiration_interval,
              expiration_warning_interval, expired_password_chg_interval, change_date, name_list^,
              name_list_size, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
        avp$make_login_pw_scl_value (expiration_date, expiration_interval, maximum_expiration_interval,
              expiration_warning_interval, expired_password_chg_interval, change_date, name_list^,
              name_list_size, work_area, result, status);
      = avc$name_kind =
        PUSH name_list: [1 .. avc$maximum_name_list_size];
        avp$get_name_value (pvt [p$field_name].value^.name_value, validation_record, name_list^,
              name_list_size, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
        avp$make_name_scl_value (name_list^, name_list_size, work_area, result, status);
      = avc$real_kind =
        avp$get_real_value (pvt [p$field_name].value^.name_value, validation_record, real_value,
              numeric_display_format, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
        avp$make_real_scl_value (real_value, work_area, result, status);
      = avc$ring_privilege_kind =
        avp$make_ring_priv_scl_value (avp$ring_min (), avp$ring_nominal (), work_area, result, status);
      = avc$string_kind =
        avp$get_string_value (pvt [p$field_name].value^.name_value, validation_record, string_value,
              status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
        avp$make_string_scl_value (string_value, work_area, result, status);
      CASEND;
    IFEND;

  PROCEND avp$$job_validation;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL] avp$$validation_level', EJECT ??
{ PURPOSE:
{   This is the function processor for $VALIDATION_LEVEL
{
{ DESIGN:
{   AVP$VALIDATION_LEVEL is called to get the validation_level.

  PROCEDURE [XDCL] avp$$validation_level
    (    parameter_list: clt$parameter_list;
     VAR work_area: ^clt$work_area;
     VAR result: ^clt$data_value;
     VAR status: ost$status);

{ FUNCTION $validation_level

?? PUSH (LISTEXT := ON) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
    recend := [
    [1,
    [88, 5, 25, 11, 53, 54, 150],
    clc$function, 0, 0, 0, 0, 0, 0, 0, '$VALIDATION_LEVEL']];

?? POP ??

    status.normal := TRUE;

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

    NEXT result IN work_area;
    IF result = NIL THEN
      osp$set_status_abnormal ('CL', cle$work_area_overflow, '', status);
      RETURN;
    IFEND;

    result^.kind := clc$name;

    CASE avp$validation_level () OF
    = avc$user_level =
      result^.name_value := avc$user_level_name;
    = avc$account_level =
      result^.name_value := avc$account_level_name;
    ELSE { project level }
      result^.name_value := avc$project_level_name;
    CASEND;

  PROCEND avp$$validation_level;
?? OLDTITLE ??
MODEND avm$validation_commands;

