?? NEWTITLE := 'NOS/VE SCL Interpreter: Permanent File Commands', ??
MODULE clm$permanent_file_commands;
?? RIGHT := 110 ??

{
{ PURPOSE:
{   This module contains the processors for all permanent file commands except those that display
{   information about catalogs and files.
{

?? NEWTITLE := 'Global Declarations', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc clc$standard_file_names
*copyc cle$all_must_be_used_alone
*copyc cle$ecc_file_reference
*copyc cle$ecc_parsing
*copyc cle$incompatible_params_given
*copyc cle$none_must_be_used_alone
*copyc cle$redundancy_in_selections
*copyc clt$parameter_list
*copyc fme$file_management_errors
*copyc fsc$local
*copyc fse$path_exception_conditions
*copyc oss$job_paged_literal
*copyc ost$status
*copyc pfe$internal_error_conditions
*copyc rmc$condition_code_limits
?? POP ??
*copyc amp$get_file_attributes
*copyc amp$return
*copyc bap$create_file
*copyc bap$file_command
*copyc bap$get_default_file_attribs
*copyc bap$process_pt_request
*copyc bap$set_attachment_options
*copyc clp$convert_cyc_ref_to_cyc_sel
*copyc clp$convert_file_ref_to_string
*copyc clp$count_list_elements
*copyc clp$evaluate_file_reference
*copyc clp$evaluate_parameters
*copyc clp$find_current_block
*copyc clp$get_work_area
*copyc clp$verify_time_increment
*copyc fsp$change_catalog_flush_option
*copyc fsp$change_catalog_name
*copyc fsp$change_file
*copyc fsp$convert_fs_structure_to_pf
*copyc fsp$flush_catalog
*copyc fsp$path_element
*copyc nfp$check_implicit_access
*copyc nfp$perform_implicit_access
*copyc osp$append_status_file
*copyc osp$append_status_parameter
*copyc osp$enforce_exception_policies
*copyc osp$file_access_condition
*copyc osp$set_status_condition
*copyc osp$set_status_abnormal
*copyc osv$initial_exception_context
*copyc osv$lower_to_upper
*copyc pfp$attach
*copyc pfp$change
*copyc pfp$convert_fs_retention_to_int
*copyc pfp$define
*copyc pfp$define_catalog
*copyc pfp$delete_catalog_permit
*copyc pfp$delete_permit
*copyc pfp$permit
*copyc pfp$permit_catalog
*copyc pfp$purge
*copyc pfp$purge_catalog
*copyc pfp$purge_catalog_contents
*copyc rmp$validate_ansi_string

  VAR
    log_select: [STATIC, READ, oss$job_paged_literal] array [boolean] of pft$log := [pfc$no_log, pfc$log],
    wait_select: [STATIC, READ, oss$job_paged_literal] array [boolean] of pft$wait := [pfc$no_wait, pfc$wait];

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

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

{ PROCEDURE (osm$cref) create_file, cref (
{   file, f: file = $required
{   local_file_name, lfn: name = $optional
{   password, pw: (SECURE) any of
{       key
{         none
{       keyend
{       name
{     anyend = none
{   retention, r: integer pfc$minimum_retention..pfc$maximum_retention = 999
{   log, l: boolean = false
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 11] of clt$pdt_parameter_name,
      parameters: array [1 .. 6] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        default_value: string (4),
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
        default_value: string (3),
      recend,
      type5: record
        header: clt$type_specification_header,
        default_value: string (5),
      recend,
      type6: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [106, 7, 17, 14, 14, 53, 123],
    clc$command, 11, 6, 1, 0, 0, 0, 6, 'OSM$CREF'], [
    ['F                              ',clc$abbreviation_entry, 1],
    ['FILE                           ',clc$nominal_entry, 1],
    ['L                              ',clc$abbreviation_entry, 5],
    ['LFN                            ',clc$abbreviation_entry, 2],
    ['LOCAL_FILE_NAME                ',clc$nominal_entry, 2],
    ['LOG                            ',clc$nominal_entry, 5],
    ['PASSWORD                       ',clc$nominal_entry, 3],
    ['PW                             ',clc$abbreviation_entry, 3],
    ['R                              ',clc$abbreviation_entry, 4],
    ['RETENTION                      ',clc$nominal_entry, 4],
    ['STATUS                         ',clc$nominal_entry, 6]],
    [
{ PARAMETER 1
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$required_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, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 3
    [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, 69,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 4
    [10, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20,
  clc$optional_default_parameter, 0, 3],
{ PARAMETER 5
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 5],
{ 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$file_type]],
{ PARAMETER 2
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 3
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    5, [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ,
    'none'],
{ PARAMETER 4
    [[1, 0, clc$integer_type], [pfc$minimum_retention, pfc$maximum_retention, 10],
    '999'],
{ PARAMETER 5
    [[1, 0, clc$boolean_type],
    'false'],
{ PARAMETER 6
    [[1, 0, clc$status_type]]];

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

    CONST
      p$file = 1,
      p$local_file_name = 2,
      p$password = 3,
      p$retention = 4,
      p$log = 5,
      p$status = 6;

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

    VAR
      context: ^ost$ecp_exception_context,
      cycle_selector: clt$cycle_selector,
      default_file_attributes: bat$static_label_attributes,
      default_new_retention: fst$retention,
      default_new_retention_specified: boolean,
      evaluated_file_reference: fst$evaluated_file_reference,
      existing_file: boolean,
      file_attributes: array [1 .. 1] of amt$get_item,
      first_path_element_is_$local: boolean,
      ignore_contains_data: boolean,
      ignore_local_file: boolean,
      local_file_name: amt$local_file_name,
      log: pft$log,
      password: pft$password,
      pf_path: ^pft$path,
      remote: boolean,
      resolved_path: fst$path,
      retention_value: integer;

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

    context := NIL;
    evaluate_path_and_handle_remote ('CREATE_FILE', pvt [p$file].value^.file_value^, ^pvt,
          evaluated_file_reference, first_path_element_is_$local, remote, status);
    IF (NOT status.normal) OR remote THEN
      RETURN; {----->
    IFEND;

    IF pvt [p$password].value^.kind = clc$name THEN
      password := pvt [p$password].value^.name_value;
    ELSE { keyword = NONE }
      password := osc$null_name;
    IFEND;

    log := log_select [pvt [p$log].value^.boolean_value.value];

    IF pvt [p$local_file_name].specified THEN
      IF first_path_element_is_$local AND (evaluated_file_reference.number_of_path_elements = 2) AND
            (fsp$path_element (^evaluated_file_reference, 2) ^ <> pvt [p$local_file_name].
            value^.name_value) THEN
        osp$set_status_abnormal ('CL', cle$not_permitted_on_loc_file, '', status);
        RETURN; {----->
      IFEND;
      local_file_name := pvt [p$local_file_name].value^.name_value;
    ELSE
      local_file_name := fsp$path_element (^evaluated_file_reference,
            evaluated_file_reference.number_of_path_elements) ^;
    IFEND;

{We could use bap$create_file for both, local and permanent files (both end up in pfp$r2_define).
{But the bap$create_file path uses a unique file name to register the local file name and
{pfp$define accepts one as parameter.
{Anyway, osc$null_name could be specified to not register an alias. But PF is strange in all ways.

    IF first_path_element_is_$local THEN
      IF evaluated_file_reference.number_of_path_elements = 1 THEN
        osp$set_status_abnormal ('CL', cle$not_permitted_on_loc_cat, '', status);
        RETURN; {----->
      IFEND;

      file_attributes [1].key := amc$null_attribute;
      amp$get_file_attributes (pvt [p$file].value^.file_value^, file_attributes, ignore_local_file,
            existing_file, ignore_contains_data, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      IF existing_file THEN
        osp$set_status_abnormal ('CL', pfe$name_already_permanent_file, pvt [p$file].value^.file_value^,
              status);
        RETURN; {----->
      IFEND;

      REPEAT
        bap$create_file (NIL, NIL, NIL, NIL, evaluated_file_reference, resolved_path, status);
        IF osp$file_access_condition (status) THEN
          IF context = NIL THEN
            PUSH context;
            context^ := osv$initial_exception_context;
            context^.file.selector := osc$ecp_evaluated_file_ref;
            context^.file.evaluated_file_reference := evaluated_file_reference;
          IFEND;
          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);
    ELSE
      PUSH pf_path: [1 .. evaluated_file_reference.number_of_path_elements];
      fsp$convert_fs_structure_to_pf (evaluated_file_reference, pf_path);
      clp$convert_cyc_ref_to_cyc_sel (evaluated_file_reference.cycle_reference, cycle_selector);
      bap$get_default_file_attribs (default_file_attributes, default_new_retention_specified,
            default_new_retention, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

      IF (pvt [p$retention].specified) OR (NOT default_new_retention_specified) THEN
        retention_value := pvt [p$retention].value^.integer_value.value;
      ELSE
        pfp$convert_fs_retention_to_int (default_new_retention, retention_value, status);
        IF (NOT status.normal) OR (retention_value > pfc$maximum_retention) THEN
          retention_value := pfc$maximum_retention;
        IFEND
      IFEND;

      pfp$define (local_file_name, pf_path^, cycle_selector.value, password, retention_value, log, status);
    IFEND;

  PROCEND clp$_create_file;
?? TITLE := 'clp$_attach_file', EJECT ??

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

{ PROCEDURE (osm$attf) attach_file, attf (
{   file, f: file = $required
{   local_file_name, lfn: name = $optional
{   access_modes, access_mode, am: (BY_NAME) list of key
{       all
{       (append, a)
{       (execute, e)
{       (modify, m)
{       (read, r)
{       (shorten, s)
{       (write, w)
{     keyend = (read, execute)
{   error_exit_procedure_name, een, error_exit_name, eepn: (BY_NAME, ADVANCED) name = $optional
{   error_limit, el: (BY_NAME, ADVANCED) integer 0..65535 = $optional
{   external_vsn, evsn, ev: (BY_NAME, ADVANCED) list of any of
{       string 1..6
{       name 1..6
{     anyend = $optional
{   free_behind, fb: (BY_NAME, ADVANCED) boolean = $optional
{   job_write_concurrency, jwc: (BY_NAME, ADVANCED) boolean = $optional
{   message_control, mc: (BY_NAME, ADVANCED) list of key
{       none
{       (messages, m)
{       (statistics, s)
{       (trivial_errors, t, te)
{     keyend = $optional
{   open_position, op: (BY_NAME) key
{       $asis, $boi, $bop, $eoi
{     keyend = $optional
{   password, pw: (BY_NAME, SECURE) any of
{       key
{         none
{       keyend
{       name
{     anyend = none
{   private_read, pr: (BY_NAME, ADVANCED) boolean = $optional
{   recorded_vsn, rvsn, rv: (BY_NAME, ADVANCED) list of any of
{       string 1..6
{       name 1..6
{     anyend = $optional
{   sequential_access, sa: (BY_NAME, ADVANCED) boolean = $optional
{   share_modes, share_mode, sm: (BY_NAME) list of key
{       all, none
{       (append, a)
{       (execute, e)
{       (modify, m)
{       (read, r)
{       (shorten, s)
{       (write, w)
{     keyend = $optional
{   transfer_size, ts: (BY_NAME, ADVANCED) integer 16384..2147483648 = $optional
{   volume_overflow_allowed, voa: (BY_NAME, ADVANCED) boolean = true
{   wait, w: (BY_NAME) boolean = false
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 43] of clt$pdt_parameter_name,
      parameters: array [1 .. 19] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 13] of clt$keyword_specification,
        recend,
        default_value: string (15),
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type5: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type6: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$union_type_qualifier,
          type_size_1: clt$type_specification_size,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$string_type_qualifier,
          recend,
          type_size_2: clt$type_specification_size,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
      recend,
      type7: record
        header: clt$type_specification_header,
      recend,
      type8: record
        header: clt$type_specification_header,
      recend,
      type9: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 8] of clt$keyword_specification,
        recend,
      recend,
      type10: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
      recend,
      type11: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        default_value: string (4),
      recend,
      type12: record
        header: clt$type_specification_header,
      recend,
      type13: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$union_type_qualifier,
          type_size_1: clt$type_specification_size,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$string_type_qualifier,
          recend,
          type_size_2: clt$type_specification_size,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
      recend,
      type14: record
        header: clt$type_specification_header,
      recend,
      type15: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 14] of clt$keyword_specification,
        recend,
      recend,
      type16: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type17: record
        header: clt$type_specification_header,
        default_value: string (4),
      recend,
      type18: record
        header: clt$type_specification_header,
        default_value: string (5),
      recend,
      type19: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 7, 18, 17, 0, 20, 944],
    clc$command, 43, 19, 1, 11, 0, 0, 19, 'OSM$ATTF'], [
    ['ACCESS_MODE                    ',clc$alias_entry, 3],
    ['ACCESS_MODES                   ',clc$nominal_entry, 3],
    ['AM                             ',clc$abbreviation_entry, 3],
    ['EEN                            ',clc$alias_entry, 4],
    ['EEPN                           ',clc$abbreviation_entry, 4],
    ['EL                             ',clc$abbreviation_entry, 5],
    ['ERROR_EXIT_NAME                ',clc$alias_entry, 4],
    ['ERROR_EXIT_PROCEDURE_NAME      ',clc$nominal_entry, 4],
    ['ERROR_LIMIT                    ',clc$nominal_entry, 5],
    ['EV                             ',clc$abbreviation_entry, 6],
    ['EVSN                           ',clc$alias_entry, 6],
    ['EXTERNAL_VSN                   ',clc$nominal_entry, 6],
    ['F                              ',clc$abbreviation_entry, 1],
    ['FB                             ',clc$abbreviation_entry, 7],
    ['FILE                           ',clc$nominal_entry, 1],
    ['FREE_BEHIND                    ',clc$nominal_entry, 7],
    ['JOB_WRITE_CONCURRENCY          ',clc$nominal_entry, 8],
    ['JWC                            ',clc$abbreviation_entry, 8],
    ['LFN                            ',clc$abbreviation_entry, 2],
    ['LOCAL_FILE_NAME                ',clc$nominal_entry, 2],
    ['MC                             ',clc$abbreviation_entry, 9],
    ['MESSAGE_CONTROL                ',clc$nominal_entry, 9],
    ['OP                             ',clc$abbreviation_entry, 10],
    ['OPEN_POSITION                  ',clc$nominal_entry, 10],
    ['PASSWORD                       ',clc$nominal_entry, 11],
    ['PR                             ',clc$abbreviation_entry, 12],
    ['PRIVATE_READ                   ',clc$nominal_entry, 12],
    ['PW                             ',clc$abbreviation_entry, 11],
    ['RECORDED_VSN                   ',clc$nominal_entry, 13],
    ['RV                             ',clc$abbreviation_entry, 13],
    ['RVSN                           ',clc$alias_entry, 13],
    ['SA                             ',clc$abbreviation_entry, 14],
    ['SEQUENTIAL_ACCESS              ',clc$nominal_entry, 14],
    ['SHARE_MODE                     ',clc$alias_entry, 15],
    ['SHARE_MODES                    ',clc$nominal_entry, 15],
    ['SM                             ',clc$abbreviation_entry, 15],
    ['STATUS                         ',clc$nominal_entry, 19],
    ['TRANSFER_SIZE                  ',clc$nominal_entry, 16],
    ['TS                             ',clc$abbreviation_entry, 16],
    ['VOA                            ',clc$abbreviation_entry, 17],
    ['VOLUME_OVERFLOW_ALLOWED        ',clc$nominal_entry, 17],
    ['W                              ',clc$abbreviation_entry, 18],
    ['WAIT                           ',clc$nominal_entry, 18]],
    [
{ PARAMETER 1
    [15, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$required_parameter, 0
  , 0],
{ PARAMETER 2
    [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, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 3
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 504,
  clc$optional_default_parameter, 0, 15],
{ PARAMETER 4
    [8, clc$advanced_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, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 5
    [9, clc$advanced_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, 20, clc$optional_parameter,
  0, 0],
{ PARAMETER 6
    [12, clc$advanced_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, 49, clc$optional_parameter,
  0, 0],
{ PARAMETER 7
    [16, clc$advanced_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_parameter, 0
  , 0],
{ PARAMETER 8
    [17, clc$advanced_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_parameter, 0
  , 0],
{ PARAMETER 9
    [22, clc$advanced_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, 319,
  clc$optional_parameter, 0, 0],
{ PARAMETER 10
    [24, 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, 155,
  clc$optional_parameter, 0, 0],
{ PARAMETER 11
    [25, clc$normal_usage_entry, clc$secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 69,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 12
    [27, clc$advanced_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_parameter, 0
  , 0],
{ PARAMETER 13
    [29, clc$advanced_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, 49, clc$optional_parameter,
  0, 0],
{ PARAMETER 14
    [33, clc$advanced_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_parameter, 0
  , 0],
{ PARAMETER 15
    [35, 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, 541,
  clc$optional_parameter, 0, 0],
{ PARAMETER 16
    [38, clc$advanced_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, 20, clc$optional_parameter,
  0, 0],
{ PARAMETER 17
    [41, clc$advanced_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, 0, 4],
{ PARAMETER 18
    [43, 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, 0, 5],
{ PARAMETER 19
    [37, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$file_type]],
{ PARAMETER 2
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 3
    [[1, 0, clc$list_type], [488, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$keyword_type], [13], [
      ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['APPEND                         ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['E                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['EXECUTE                        ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['M                              ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['MODIFY                         ', clc$nominal_entry, clc$normal_usage_entry, 4],
      ['R                              ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
      ['READ                           ', clc$nominal_entry, clc$normal_usage_entry, 5],
      ['S                              ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
      ['SHORTEN                        ', clc$nominal_entry, clc$normal_usage_entry, 6],
      ['W                              ', clc$abbreviation_entry, clc$normal_usage_entry, 7],
      ['WRITE                          ', clc$nominal_entry, clc$normal_usage_entry, 7]]
      ]
    ,
    '(read, execute)'],
{ PARAMETER 4
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 5
    [[1, 0, clc$integer_type], [0, 65535, 10]],
{ PARAMETER 6
    [[1, 0, clc$list_type], [33, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$union_type], [[clc$name_type, clc$string_type],
      TRUE, 2],
      8, [[1, 0, clc$string_type], [1, 6, FALSE]],
      5, [[1, 0, clc$name_type], [1, 6]]
      ]
    ],
{ PARAMETER 7
    [[1, 0, clc$boolean_type]],
{ PARAMETER 8
    [[1, 0, clc$boolean_type]],
{ PARAMETER 9
    [[1, 0, clc$list_type], [303, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$keyword_type], [8], [
      ['M                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['MESSAGES                       ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['S                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['STATISTICS                     ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['T                              ', clc$alias_entry, clc$normal_usage_entry, 4],
      ['TE                             ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['TRIVIAL_ERRORS                 ', clc$nominal_entry, clc$normal_usage_entry, 4]]
      ]
    ],
{ PARAMETER 10
    [[1, 0, clc$keyword_type], [4], [
    ['$ASIS                          ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['$BOI                           ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['$BOP                           ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['$EOI                           ', clc$nominal_entry, clc$normal_usage_entry, 4]]
    ],
{ PARAMETER 11
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    5, [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ,
    'none'],
{ PARAMETER 12
    [[1, 0, clc$boolean_type]],
{ PARAMETER 13
    [[1, 0, clc$list_type], [33, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$union_type], [[clc$name_type, clc$string_type],
      TRUE, 2],
      8, [[1, 0, clc$string_type], [1, 6, FALSE]],
      5, [[1, 0, clc$name_type], [1, 6]]
      ]
    ],
{ PARAMETER 14
    [[1, 0, clc$boolean_type]],
{ PARAMETER 15
    [[1, 0, clc$list_type], [525, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$keyword_type], [14], [
      ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['APPEND                         ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['E                              ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['EXECUTE                        ', clc$nominal_entry, clc$normal_usage_entry, 4],
      ['M                              ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
      ['MODIFY                         ', clc$nominal_entry, clc$normal_usage_entry, 5],
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['R                              ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
      ['READ                           ', clc$nominal_entry, clc$normal_usage_entry, 6],
      ['S                              ', clc$abbreviation_entry, clc$normal_usage_entry, 7],
      ['SHORTEN                        ', clc$nominal_entry, clc$normal_usage_entry, 7],
      ['W                              ', clc$abbreviation_entry, clc$normal_usage_entry, 8],
      ['WRITE                          ', clc$nominal_entry, clc$normal_usage_entry, 8]]
      ]
    ],
{ PARAMETER 16
    [[1, 0, clc$integer_type], [16384, 2147483648, 10]],
{ PARAMETER 17
    [[1, 0, clc$boolean_type],
    'true'],
{ PARAMETER 18
    [[1, 0, clc$boolean_type],
    'false'],
{ PARAMETER 19
    [[1, 0, clc$status_type]]];

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

    CONST
      p$file = 1,
      p$local_file_name = 2,
      p$access_modes = 3,
      p$error_exit_procedure_name = 4,
      p$error_limit = 5,
      p$external_vsn = 6,
      p$free_behind = 7,
      p$job_write_concurrency = 8,
      p$message_control = 9,
      p$open_position = 10,
      p$password = 11,
      p$private_read = 12,
      p$recorded_vsn = 13,
      p$sequential_access = 14,
      p$share_modes = 15,
      p$transfer_size = 16,
      p$volume_overflow_allowed = 17,
      p$wait = 18,
      p$status = 19;

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

    CONST
      max_attributes = 4;

    VAR
      access_mode_selections: pft$usage_selections,
      attribute_count: 0 .. max_attributes,
      attribute_index: 0 .. max_attributes + 1,
      attributes: array [1 .. max_attributes] of amt$file_item,
      block: ^clt$block,
      cd_attachment_options: fmt$cd_attachment_options,
      current_evsn: ^clt$data_value,
      current_message: ^clt$data_value,
      current_rvsn: ^clt$data_value,
      cycle_selector: clt$cycle_selector,
      evaluated_file_reference: fst$evaluated_file_reference,
      evsn_count: integer,
      file_attributes: array [1 .. 1] of amt$get_item,
      first_path_element_is_$local: boolean,
      ignore_contains_data: boolean,
      ignore_existing_file: boolean,
      ignore_permit: pft$permit_selections,
      ignore_status: ost$status,
      local_file: boolean,
      local_file_name: amt$local_file_name,
      message_control: amt$message_control,
      p_volume_list: ^rmt$volume_list,
      password: pft$password,
      pf_path: ^pft$path,
      rvsn_count: integer,
      share_selections: pft$share_selections,
      share_specified: boolean,
      usage_selections: pft$usage_selections,
      volume_list: ^rmt$volume_list,
      volume_list_index: integer,
      vsn_count: integer,
      vsn_string: string (rmc$external_vsn_size),
      wait: pft$wait,
      work_area: ^^clt$work_area;

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

    access_mode_selections := $pft$usage_selections [pfc$append, pfc$shorten, pfc$modify];

    IF pvt [p$password].value^.kind = clc$name THEN
      password := pvt [p$password].value^.name_value;
    ELSE { keyword = NONE }
      password := osc$null_name;
    IFEND;

    handle_access_mode_or_share (pvt [p$access_modes].value, select_usage, usage_selections, ignore_permit,
          status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF pvt [p$share_modes].specified THEN
      handle_access_mode_or_share (pvt [p$share_modes].value, select_share, share_selections, ignore_permit,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    ELSEIF (usage_selections * access_mode_selections) <> $pft$usage_selections [] THEN
      share_selections := $pft$share_selections [];
    ELSE
      share_selections := $pft$share_selections [pfc$read, pfc$execute];
    IFEND;

    wait := wait_select [pvt [p$wait].value^.boolean_value.value];

    clp$evaluate_file_reference (pvt [p$file].value^.file_value^, $clt$file_ref_parsing_options [], FALSE,
          evaluated_file_reference, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    first_path_element_is_$local := fsp$path_element (^evaluated_file_reference, 1) ^ = fsc$local;

    IF pvt [p$local_file_name].specified THEN
      IF first_path_element_is_$local AND (evaluated_file_reference.number_of_path_elements = 2) AND
            (fsp$path_element (^evaluated_file_reference, 2) ^ <> pvt [p$local_file_name].
            value^.name_value) THEN
        osp$set_status_abnormal ('CL', cle$not_permitted_on_loc_file, '', status);
        RETURN; {----->
      IFEND;
      local_file_name := pvt [p$local_file_name].value^.name_value;
    ELSE
      local_file_name := fsp$path_element (^evaluated_file_reference,
            evaluated_file_reference.number_of_path_elements) ^;
    IFEND;

    IF first_path_element_is_$local THEN
      IF evaluated_file_reference.number_of_path_elements = 1 THEN
        osp$set_status_abnormal ('CL', cle$not_permitted_on_loc_cat, '', status);
        RETURN; {----->
      ELSE
        file_attributes [1].key := amc$null_attribute;
        amp$get_file_attributes (pvt [p$file].value^.file_value^, file_attributes, local_file,
              ignore_existing_file, ignore_contains_data, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
        IF NOT local_file THEN
          osp$set_status_abnormal ('CL', cle$name_not_file, local_file_name, status);
          RETURN; {----->
        IFEND;
      IFEND;
    ELSE
      PUSH pf_path: [1 .. evaluated_file_reference.number_of_path_elements];
      fsp$convert_fs_structure_to_pf (evaluated_file_reference, pf_path);
      clp$convert_cyc_ref_to_cyc_sel (evaluated_file_reference.cycle_reference, cycle_selector);
      pfp$attach (local_file_name, pf_path^, cycle_selector.value, password, usage_selections,
            share_selections, wait, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    IFEND;

    attribute_count := 0;

    IF pvt [p$error_exit_procedure_name].specified THEN
      attribute_count := attribute_count + 1;
      attributes [attribute_count].key := amc$error_exit_name;
      attributes [attribute_count].error_exit_name := pvt [p$error_exit_procedure_name].value^.name_value;
    IFEND;

    IF pvt [p$error_limit].specified THEN
      attribute_count := attribute_count + 1;
      attributes [attribute_count].key := amc$error_limit;
      attributes [attribute_count].error_limit := pvt [p$error_limit].value^.integer_value.value;
    IFEND;

    IF pvt [p$message_control].specified THEN
      attribute_count := attribute_count + 1;
      attributes [attribute_count].key := amc$message_control;
      message_control := $amt$message_control [];
      current_message := pvt [p$message_control].value;

      WHILE current_message <> NIL DO
        IF current_message^.element_value^.keyword_value = 'NONE' THEN
          IF pvt [p$message_control].value^.link <> NIL THEN
            osp$set_status_abnormal ('CL', cle$none_must_be_used_alone, 'MESSAGE_CONTROL', status);
            RETURN; {----->
          IFEND;
        ELSEIF current_message^.element_value^.keyword_value = 'MESSAGES' THEN
          message_control := message_control + $amt$message_control [amc$messages];
        ELSEIF current_message^.element_value^.keyword_value = 'STATISTICS' THEN
          message_control := message_control + $amt$message_control [amc$statistics];
        ELSEIF current_message^.element_value^.keyword_value = 'TRIVIAL_ERRORS' THEN
          message_control := message_control + $amt$message_control [amc$trivial_errors];
        IFEND;
        current_message := current_message^.link;
      WHILEND;
      attributes [attribute_count].message_control := message_control;
    IFEND;

    IF pvt [p$open_position].specified THEN
      attribute_count := attribute_count + 1;
      attributes [attribute_count].key := amc$open_position;
      IF pvt [p$open_position].value^.keyword_value = '$ASIS' THEN
        attributes [attribute_count].open_position := amc$open_no_positioning;
      ELSEIF pvt [p$open_position].value^.keyword_value = '$BOI' THEN
        attributes [attribute_count].open_position := amc$open_at_boi;
      ELSEIF pvt [p$open_position].value^.keyword_value = '$BOP' THEN
        attributes [attribute_count].open_position := amc$open_at_bop;
      ELSEIF pvt [p$open_position].value^.keyword_value = '$EOI' THEN
        attributes [attribute_count].open_position := amc$open_at_eoi;
      IFEND;
    IFEND;

    IF attribute_count > 0 THEN
      IF attribute_count < max_attributes THEN
        FOR attribute_index := attribute_count + 1 TO max_attributes DO
          attributes [attribute_index].key := amc$null_attribute;
        FOREND;
      IFEND;
      bap$file_command (local_file_name, ^attributes, status);
    IFEND;

    IF pvt [p$external_vsn].specified OR pvt [p$free_behind].specified OR
          pvt [p$job_write_concurrency].specified OR pvt [p$private_read].specified OR
          pvt [p$recorded_vsn].specified OR pvt [p$sequential_access].specified OR
          pvt [p$transfer_size].specified OR pvt [p$volume_overflow_allowed].specified THEN
      cd_attachment_options.free_behind_specified := pvt [p$free_behind].specified;
      IF cd_attachment_options.free_behind_specified THEN
        cd_attachment_options.free_behind := pvt [p$free_behind].value^.boolean_value.value;
      IFEND;
      cd_attachment_options.job_write_concurrency_specified := pvt [p$job_write_concurrency].specified;
      IF cd_attachment_options.job_write_concurrency_specified THEN
        cd_attachment_options.job_write_concurrency := pvt [p$job_write_concurrency].value^.boolean_value.
              value;
      IFEND;
      cd_attachment_options.private_read_specified := pvt [p$private_read].specified;
      IF cd_attachment_options.private_read_specified THEN
        cd_attachment_options.private_read := pvt [p$private_read].value^.boolean_value.value;
      IFEND;
      cd_attachment_options.sequential_access_specified := pvt [p$sequential_access].specified;
      IF cd_attachment_options.sequential_access_specified THEN
        cd_attachment_options.sequential_access := pvt [p$sequential_access].value^.boolean_value.value;
      IFEND;
      cd_attachment_options.transfer_size_specified := pvt [p$transfer_size].specified;
      IF cd_attachment_options.transfer_size_specified THEN
        cd_attachment_options.transfer_size := pvt [p$transfer_size].value^.integer_value.value;
      IFEND;
      cd_attachment_options.volume_overflow_allowed_spec := pvt [p$volume_overflow_allowed].specified;
      IF cd_attachment_options.volume_overflow_allowed_spec THEN
        cd_attachment_options.volume_overflow_allowed := pvt [p$volume_overflow_allowed].value^.boolean_value.
              value;
      IFEND;

      cd_attachment_options.external_vsn_specified := pvt [p$external_vsn].specified;
      cd_attachment_options.recorded_vsn_specified := pvt [p$recorded_vsn].specified;

      IF cd_attachment_options.external_vsn_specified OR cd_attachment_options.recorded_vsn_specified THEN
        evsn_count := clp$count_list_elements (pvt [p$external_vsn].value);
        rvsn_count := clp$count_list_elements (pvt [p$recorded_vsn].value);

        IF ((rvsn_count > 0) AND (evsn_count > 0)) AND (rvsn_count <> evsn_count) THEN
          osp$set_status_condition (cle$inconsistent_vsn_lists, status);
          RETURN; {----->
        IFEND;

        IF rvsn_count > evsn_count THEN
          vsn_count := rvsn_count;
        ELSE
          vsn_count := evsn_count;
        IFEND;

        PUSH p_volume_list: [1 .. vsn_count];
        current_evsn := pvt [p$external_vsn].value;
        current_rvsn := pvt [p$recorded_vsn].value;

        FOR volume_list_index := 1 TO vsn_count DO
          IF current_evsn <> NIL THEN
            IF current_evsn^.element_value^.kind = clc$string THEN
              vsn_string := current_evsn^.element_value^.string_value^;
            ELSEIF current_evsn^.element_value^.kind = clc$name THEN
              vsn_string := current_evsn^.element_value^.name_value;
            IFEND;
            rmp$validate_ansi_string (vsn_string, p_volume_list^ [volume_list_index].external_vsn, status);
            IF NOT status.normal THEN
              osp$set_status_abnormal (rmc$resource_management_id, cle$improper_vsn_value, vsn_string,
                    status);
              osp$append_status_parameter (osc$status_parameter_delimiter, 'EXTERNAL_VSN', status);
              RETURN; {----->
            IFEND;
            current_evsn := current_evsn^.link;
          ELSE
            p_volume_list^ [volume_list_index].external_vsn := rmc$unspecified_vsn;
          IFEND;
          IF current_rvsn <> NIL THEN
            IF current_rvsn^.element_value^.kind = clc$string THEN
              vsn_string := current_rvsn^.element_value^.string_value^;
            ELSEIF current_rvsn^.element_value^.kind = clc$name THEN
              vsn_string := current_rvsn^.element_value^.name_value;
            IFEND;
            rmp$validate_ansi_string (vsn_string, p_volume_list^ [volume_list_index].recorded_vsn, status);
            IF NOT status.normal THEN
              osp$set_status_abnormal (rmc$resource_management_id, cle$improper_vsn_value, vsn_string,
                    status);
              osp$append_status_parameter (osc$status_parameter_delimiter, 'RECORDED_VSN', status);
              RETURN; {----->
            IFEND;
            current_rvsn := current_rvsn^.link;
          ELSE
            p_volume_list^ [volume_list_index].recorded_vsn := rmc$unspecified_vsn;
          IFEND;
          IF (p_volume_list^ [volume_list_index].external_vsn = rmc$unspecified_vsn) THEN
            p_volume_list^ [volume_list_index].external_vsn := p_volume_list^ [volume_list_index].
                  recorded_vsn;
          ELSEIF (p_volume_list^ [volume_list_index].recorded_vsn = rmc$unspecified_vsn) THEN
            p_volume_list^ [volume_list_index].recorded_vsn := p_volume_list^ [volume_list_index].
                  external_vsn;
          IFEND;
        FOREND;
      ELSE
        p_volume_list := NIL;
      IFEND;

      bap$set_attachment_options (local_file_name, cd_attachment_options, p_volume_list, status);
      IF NOT status.normal THEN
        IF status.condition = fme$no_cycle_description THEN
{ File must have been detached by an asynchronous task.  A permanent file should have been attached by
{ PFP$ATTACH, and a temporary file's existance should have been verified by AMP$GET_FILE_ATTRIBUTES.
{ This situation can be treated as if the asynchronous detach occurred after this request and therefore
{ return a normal status.
          status.normal := TRUE;
        ELSEIF NOT first_path_element_is_$local THEN
          amp$return (local_file_name, ignore_status);
        IFEND;
      IFEND;
    IFEND; {Attachment Option Specified.

  PROCEND clp$_attach_file;
?? TITLE := 'clp$_delete_file', EJECT ??

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

{ PROCEDURE (osm$delf) delete_file, delf (
{   file, files, f: list 0..clc$max_list_size of file = $required
{   password, pw: (SECURE) any of
{       key
{         none
{       keyend
{       name
{     anyend = none
{   status)

?? PUSH (LISTEXT := ON) ??

    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,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
          recend,
        recend,
        type2: record
          header: clt$type_specification_header,
          qualifier: clt$union_type_qualifier,
          type_size_1: clt$type_specification_size,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 1] of clt$keyword_specification,
          recend,
          type_size_2: clt$type_specification_size,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
          default_value: string (4),
        recend,
        type3: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [88, 5, 6, 18, 39, 53, 773], clc$command, 6, 3, 1, 0, 0, 0, 3, 'OSM$DELF'],
            [['F                              ', clc$abbreviation_entry, 1],
            ['FILE                           ', clc$nominal_entry, 1],
            ['FILES                          ', clc$alias_entry, 1],
            ['PASSWORD                       ', clc$nominal_entry, 2],
            ['PW                             ', clc$abbreviation_entry, 2],
            ['STATUS                         ', clc$nominal_entry, 3]], [

{ 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, 19, clc$required_parameter, 0, 0],

{ PARAMETER 2

      [4, 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, 69, clc$optional_default_parameter, 0, 4],

{ 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$list_type], [3, 0, clc$max_list_size, FALSE], [[1, 0, clc$file_type]]],

{ PARAMETER 2

      [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type], FALSE, 2], 44,
            [[1, 0, clc$keyword_type], [1], [['NONE                           ', clc$nominal_entry,
            clc$normal_usage_entry, 1]]], 5, [[1, 0, clc$name_type], [1, osc$max_name_size]], 'none'],

{ PARAMETER 3

      [[1, 0, clc$status_type]]];

?? POP ??

    CONST
      p$file = 1,
      p$password = 2,
      p$status = 3;

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

    VAR
      current_file: ^clt$data_value,
      cycle_selector: clt$cycle_selector,
      delete_path: fst$path,
      delete_path_size: fst$path_size,
      evaluated_file_reference: fst$evaluated_file_reference,
      first_path_element_is_$local: boolean,
      password: pft$password,
      pf_path: ^pft$path,
      remote: boolean;


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

    IF pvt [p$password].value^.kind = clc$name THEN
      password := pvt [p$password].value^.name_value;
    ELSE { keyword = NONE }
      password := osc$null_name;
    IFEND;

    current_file := pvt [p$file].value;

    WHILE (current_file <> NIL) AND (current_file^.element_value <> NIL) DO
      evaluate_path_and_handle_remote ('DELETE_FILE', current_file^.element_value^.file_value^, ^pvt,
            evaluated_file_reference, first_path_element_is_$local, remote, status);
      IF NOT status.normal THEN
        RETURN; {----->
      ELSEIF NOT remote THEN

        IF evaluated_file_reference.cycle_reference.specification = fsc$cycle_omitted THEN
          evaluated_file_reference.cycle_reference.specification := fsc$low_cycle;
        IFEND;

        clp$convert_file_ref_to_string (evaluated_file_reference, FALSE, delete_path, delete_path_size,
              status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;

        IF first_path_element_is_$local THEN
          IF evaluated_file_reference.number_of_path_elements = 1 THEN
            osp$set_status_abnormal ('CL', pfe$name_not_permanent_file, fsc$local, status);
            RETURN; {----->
          IFEND;
          amp$return (delete_path (1, delete_path_size), status);
        ELSE
          amp$return (delete_path (1, delete_path_size), status);
          IF NOT status.normal THEN
            IF status.condition <> ame$file_not_known THEN
              RETURN; {----->
            IFEND;
            status.normal := TRUE;
          IFEND;
          PUSH pf_path: [1 .. evaluated_file_reference.number_of_path_elements];
          fsp$convert_fs_structure_to_pf (evaluated_file_reference, pf_path);
          clp$convert_cyc_ref_to_cyc_sel (evaluated_file_reference.cycle_reference, cycle_selector);
          pfp$purge (pf_path^, cycle_selector.value, password, status);
        IFEND;
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;

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

  PROCEND clp$_delete_file;

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

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

{ PROCEDURE [HIDDEN] change_catalog_access (
{   flush_catalogs, fc: any of
{       key
{         $unspecified
{       keyend
{       boolean
{     anyend = $optional
{   )

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 2] of clt$pdt_parameter_name,
      parameters: array [1 .. 1] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
      recend,
    recend := [
    [1,
    [90, 3, 9, 11, 27, 11, 994],
    clc$command, 2, 1, 0, 0, 0, 0, 0, ''], [
    ['FC                             ',clc$abbreviation_entry, 1],
    ['FLUSH_CATALOGS                 ',clc$nominal_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, 67, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$boolean_type,
    clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['$UNSPECIFIED                   ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$boolean_type]]
    ]];

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

    CONST
      p$flush_catalogs = 1;

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

    VAR
      flush_catalogs: boolean;

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

    IF pvt [p$flush_catalogs].specified THEN
      IF pvt [p$flush_catalogs].value^.kind = clc$keyword THEN {$unspeicified}
        flush_catalogs := TRUE;
      ELSE
        flush_catalogs := pvt [p$flush_catalogs].value^.boolean_value.value;
      IFEND;
    IFEND;

    fsp$change_catalog_flush_option (flush_catalogs, status);
  PROCEND clp$_change_catalog_access;

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

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

{ PROCEDURE (osm$chace) change_catalog_entry, chace (
{   file, f: file = $required
{   password, pw: (SECURE) any of
{       key
{         none
{       keyend
{       name
{     anyend = none
{   new_file_name, nfn: name = $optional
{   new_cycle, nc: integer pfc$minimum_cycle_number..pfc$maximum_cycle_number = $optional
{   new_password, npw: (SECURE) any of
{       key
{         none
{       keyend
{       name
{     anyend = $optional
{   new_log, nl: boolean = $optional
{   new_retention, nr: (BY_NAME) any of
{       integer pfc$minimum_retention..pfc$maximum_retention
{       date
{       date_time
{       time_increment
{     anyend = $optional
{   new_account_project, nap: boolean = $optional
{   delete_damage_condition, ddc: list of key
{       (media_image_inconsistent, mii)
{       (respf_modification_mismatch, rmm)
{       (parent_catalog_restored, pcr)
{     keyend = $optional
{   new_retrieve_option, nro: (BY_NAME, ADVANCED) key
{       (always_retrieve, ar)
{       (explicit_retrieve_only, ero)
{       (administrative_retrieve_only, aro)
{     keyend = $optional
{   new_shared_queue, nsq: (BY_NAME, ADVANCED) key
{       site_01, site_02, site_03, site_04, site_05, site_06, site_07, site_08, site_09, site_10, site_11
{       site_12, site_13, site_14, site_15, site_16, site_17, site_18, site_19, site_20, site_21, site_22
{       site_23, site_24, site_25, system
{     keyend = $optional
{   new_site_archive_option, nsao: (BY_NAME, ADVANCED) any of
{       integer 1..255
{       key
{         null
{       keyend
{     anyend = $optional
{   new_site_backup_option, nsbo: (BY_NAME, ADVANCED) any of
{       integer 1..255
{       key
{         null
{       keyend
{     anyend = $optional
{   new_site_release_option, nsro: (BY_NAME, ADVANCED) any of
{       integer 1..255
{       key
{         null
{       keyend
{     anyend = $optional
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 29] of clt$pdt_parameter_name,
      parameters: array [1 .. 15] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        default_value: string (4),
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type5: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type6: record
        header: clt$type_specification_header,
      recend,
      type7: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        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,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$date_time_type_qualifier,
        recend,
        type_size_4: clt$type_specification_size,
        element_type_spec_4: record
          header: clt$type_specification_header,
        recend,
      recend,
      type8: record
        header: clt$type_specification_header,
      recend,
      type9: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 6] of clt$keyword_specification,
        recend,
      recend,
      type10: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 6] of clt$keyword_specification,
      recend,
      type11: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 26] of clt$keyword_specification,
      recend,
      type12: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
      recend,
      type13: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        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$integer_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
      recend,
      type15: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [97, 1, 20, 14, 28, 48, 497],
    clc$command, 29, 15, 1, 5, 0, 0, 15, 'OSM$CHACE'], [
    ['DDC                            ',clc$abbreviation_entry, 9],
    ['DELETE_DAMAGE_CONDITION        ',clc$nominal_entry, 9],
    ['F                              ',clc$abbreviation_entry, 1],
    ['FILE                           ',clc$nominal_entry, 1],
    ['NAP                            ',clc$abbreviation_entry, 8],
    ['NC                             ',clc$abbreviation_entry, 4],
    ['NEW_ACCOUNT_PROJECT            ',clc$nominal_entry, 8],
    ['NEW_CYCLE                      ',clc$nominal_entry, 4],
    ['NEW_FILE_NAME                  ',clc$nominal_entry, 3],
    ['NEW_LOG                        ',clc$nominal_entry, 6],
    ['NEW_PASSWORD                   ',clc$nominal_entry, 5],
    ['NEW_RETENTION                  ',clc$nominal_entry, 7],
    ['NEW_RETRIEVE_OPTION            ',clc$nominal_entry, 10],
    ['NEW_SHARED_QUEUE               ',clc$nominal_entry, 11],
    ['NEW_SITE_ARCHIVE_OPTION        ',clc$nominal_entry, 12],
    ['NEW_SITE_BACKUP_OPTION         ',clc$nominal_entry, 13],
    ['NEW_SITE_RELEASE_OPTION        ',clc$nominal_entry, 14],
    ['NFN                            ',clc$abbreviation_entry, 3],
    ['NL                             ',clc$abbreviation_entry, 6],
    ['NPW                            ',clc$abbreviation_entry, 5],
    ['NR                             ',clc$abbreviation_entry, 7],
    ['NRO                            ',clc$abbreviation_entry, 10],
    ['NSAO                           ',clc$abbreviation_entry, 12],
    ['NSBO                           ',clc$abbreviation_entry, 13],
    ['NSQ                            ',clc$abbreviation_entry, 11],
    ['NSRO                           ',clc$abbreviation_entry, 14],
    ['PASSWORD                       ',clc$nominal_entry, 2],
    ['PW                             ',clc$abbreviation_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 15]],
    [
{ PARAMETER 1
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$required_parameter, 0
  , 0],
{ PARAMETER 2
    [27, 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, 69,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 3
    [9, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 4
    [8, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$optional_parameter,
  0, 0],
{ PARAMETER 5
    [11, 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, 69, clc$optional_parameter,
  0, 0],
{ PARAMETER 6
    [10, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$optional_parameter, 0
  , 0],
{ PARAMETER 7
    [12, 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, 61, clc$optional_parameter,
  0, 0],
{ PARAMETER 8
    [7, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$optional_parameter, 0
  , 0],
{ PARAMETER 9
    [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, 245,
  clc$optional_parameter, 0, 0],
{ PARAMETER 10
    [13, clc$advanced_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, 229,
  clc$optional_parameter, 0, 0],
{ PARAMETER 11
    [14, clc$advanced_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, 969,
  clc$optional_parameter, 0, 0],
{ PARAMETER 12
    [15, clc$advanced_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, 84, clc$optional_parameter,
  0, 0],
{ PARAMETER 13
    [16, clc$advanced_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, 84, clc$optional_parameter,
  0, 0],
{ PARAMETER 14
    [17, clc$advanced_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, 84, clc$optional_parameter,
  0, 0],
{ PARAMETER 15
    [29, 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$union_type], [[clc$keyword_type, clc$name_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    5, [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ,
    'none'],
{ PARAMETER 3
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 4
    [[1, 0, clc$integer_type], [pfc$minimum_cycle_number, pfc$maximum_cycle_number, 10]],
{ PARAMETER 5
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    5, [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 6
    [[1, 0, clc$boolean_type]],
{ PARAMETER 7
    [[1, 0, clc$union_type], [[clc$date_time_type, clc$integer_type, clc$time_increment_type],
    FALSE, 4],
    20, [[1, 0, clc$integer_type], [pfc$minimum_retention, pfc$maximum_retention, 10]],
    5, [[1, 0, clc$date_time_type], [$clt$date_and_or_time [clc$date], $clt$date_time_tenses [clc$past,
  clc$present, clc$future]]],
    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]]],
    3, [[1, 0, clc$time_increment_type]]
    ],
{ PARAMETER 8
    [[1, 0, clc$boolean_type]],
{ PARAMETER 9
    [[1, 0, clc$list_type], [229, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$keyword_type], [6], [
      ['MEDIA_IMAGE_INCONSISTENT       ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['MII                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['PARENT_CATALOG_RESTORED        ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['PCR                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['RESPF_MODIFICATION_MISMATCH    ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['RMM                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2]]
      ]
    ],
{ PARAMETER 10
    [[1, 0, clc$keyword_type], [6], [
    ['ADMINISTRATIVE_RETRIEVE_ONLY   ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['ALWAYS_RETRIEVE                ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['AR                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['ARO                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['ERO                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['EXPLICIT_RETRIEVE_ONLY         ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ],
{ PARAMETER 11
    [[1, 0, clc$keyword_type], [26], [
    ['SITE_01                        ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['SITE_02                        ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['SITE_03                        ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['SITE_04                        ', clc$nominal_entry, clc$normal_usage_entry, 4],
    ['SITE_05                        ', clc$nominal_entry, clc$normal_usage_entry, 5],
    ['SITE_06                        ', clc$nominal_entry, clc$normal_usage_entry, 6],
    ['SITE_07                        ', clc$nominal_entry, clc$normal_usage_entry, 7],
    ['SITE_08                        ', clc$nominal_entry, clc$normal_usage_entry, 8],
    ['SITE_09                        ', clc$nominal_entry, clc$normal_usage_entry, 9],
    ['SITE_10                        ', clc$nominal_entry, clc$normal_usage_entry, 10],
    ['SITE_11                        ', clc$nominal_entry, clc$normal_usage_entry, 11],
    ['SITE_12                        ', clc$nominal_entry, clc$normal_usage_entry, 12],
    ['SITE_13                        ', clc$nominal_entry, clc$normal_usage_entry, 13],
    ['SITE_14                        ', clc$nominal_entry, clc$normal_usage_entry, 14],
    ['SITE_15                        ', clc$nominal_entry, clc$normal_usage_entry, 15],
    ['SITE_16                        ', clc$nominal_entry, clc$normal_usage_entry, 16],
    ['SITE_17                        ', clc$nominal_entry, clc$normal_usage_entry, 17],
    ['SITE_18                        ', clc$nominal_entry, clc$normal_usage_entry, 18],
    ['SITE_19                        ', clc$nominal_entry, clc$normal_usage_entry, 19],
    ['SITE_20                        ', clc$nominal_entry, clc$normal_usage_entry, 20],
    ['SITE_21                        ', clc$nominal_entry, clc$normal_usage_entry, 21],
    ['SITE_22                        ', clc$nominal_entry, clc$normal_usage_entry, 22],
    ['SITE_23                        ', clc$nominal_entry, clc$normal_usage_entry, 23],
    ['SITE_24                        ', clc$nominal_entry, clc$normal_usage_entry, 24],
    ['SITE_25                        ', clc$nominal_entry, clc$normal_usage_entry, 25],
    ['SYSTEM                         ', clc$nominal_entry, clc$normal_usage_entry, 26]]
    ],
{ PARAMETER 12
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    20, [[1, 0, clc$integer_type], [1, 255, 10]],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NULL                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ]
    ],
{ PARAMETER 13
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    20, [[1, 0, clc$integer_type], [1, 255, 10]],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NULL                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ]
    ],
{ PARAMETER 14
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    20, [[1, 0, clc$integer_type], [1, 255, 10]],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NULL                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ]
    ],
{ PARAMETER 15
    [[1, 0, clc$status_type]]];

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

    CONST
      p$file = 1,
      p$password = 2,
      p$new_file_name = 3,
      p$new_cycle = 4,
      p$new_password = 5,
      p$new_log = 6,
      p$new_retention = 7,
      p$new_account_project = 8,
      p$delete_damage_condition = 9,
      p$new_retrieve_option = 10,
      p$new_shared_queue = 11,
      p$new_site_archive_option = 12,
      p$new_site_backup_option = 13,
      p$new_site_release_option = 14,
      p$status = 15;

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

    CONST
      max_changes = 13;

    VAR
      cycle_selector: clt$cycle_selector,
      damage_conditions: ^clt$data_value,
      password: pft$password,
      file_change_area: SEQ (REP max_changes of fst$file_change),
      area_pointer: ^SEQ (REP max_changes of fst$file_change),
      change_count: 0 .. max_changes,
      file_changes: ^fst$file_changes,
      evaluated_file_reference: fst$evaluated_file_reference,
      first_path_element_is_$local: boolean,
      parameter: p$new_file_name .. p$new_site_release_option,
      pf_path: ^pft$path,
      remote: boolean;

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

    evaluate_path_and_handle_remote ('CHANGE_CATALOG_ENTRY', pvt [p$file].value^.file_value^, ^pvt,
          evaluated_file_reference, first_path_element_is_$local, remote, status);
    IF (NOT status.normal) OR remote THEN
      RETURN; {----->
    IFEND;

    change_count := 0;
    area_pointer := ^file_change_area;

    IF pvt [p$password].value^.kind = clc$name THEN
      password := pvt [p$password].value^.name_value;
    ELSE { keyword = NONE }
      password := osc$null_name;
    IFEND;

    IF first_path_element_is_$local THEN
      IF evaluated_file_reference.number_of_path_elements = 1 THEN
        osp$set_status_abnormal ('CL', cle$not_permitted_on_loc_cat, '', status);
      ELSE
        osp$set_status_abnormal ('CL', cle$not_permitted_on_loc_file, '', status);
      IFEND;
    ELSE

      FOR parameter := p$new_file_name TO p$new_site_release_option DO
        IF pvt [parameter].specified THEN
          change_count := change_count + 1;
        IFEND;
      FOREND;

      IF change_count = 0 THEN
        osp$set_status_abnormal ('CL', cle$required_parameter_omitted,
              'NEW_FILE_NAME..NEW_SITE_RELEASE_OPTION', status);
        RETURN; {----->
      IFEND;

      RESET area_pointer;
      NEXT file_changes: [1 .. change_count] IN area_pointer;

      change_count := 0;
      IF pvt [p$new_file_name].specified THEN
        change_count := change_count + 1;
        file_changes^ [change_count].selector := fsc$pf_name_change;
        file_changes^ [change_count].pfn := pvt [p$new_file_name].value^.name_value;
      IFEND;

      IF pvt [p$new_cycle].specified THEN
        change_count := change_count + 1;
        file_changes^ [change_count].selector := fsc$cycle_number_change;
        file_changes^ [change_count].cycle_number := pvt [p$new_cycle].value^.integer_value.value;
      IFEND;

      IF pvt [p$new_password].specified THEN
        change_count := change_count + 1;
        file_changes^ [change_count].selector := fsc$password_change;
        IF pvt [p$new_password].value^.kind = clc$keyword THEN {keyword = NONE}
          file_changes^ [change_count].password := osc$null_name;
        ELSE
          file_changes^ [change_count].password := pvt [p$new_password].value^.name_value;
        IFEND;
      IFEND;

      IF pvt [p$new_log].specified THEN
        change_count := change_count + 1;
        file_changes^ [change_count].selector := fsc$log_change;
        file_changes^ [change_count].log := log_select [pvt [p$new_log].value^.boolean_value.value];
      IFEND;

      IF pvt [p$new_retention].specified THEN
        change_count := change_count + 1;
        file_changes^ [change_count].selector := fsc$retention_change;
        IF pvt [p$new_retention].value^.kind = clc$integer THEN
          file_changes^ [change_count].retention.selector := fsc$retention_day_increment;
          file_changes^ [change_count].retention.day_increment :=
                pvt [p$new_retention].value^.integer_value.value;
        ELSEIF pvt [p$new_retention].value^.kind = clc$time_increment THEN
          clp$verify_time_increment (pvt [p$new_retention].value^.time_increment_value^, status);
          IF NOT status.normal THEN
            RETURN; {----->
          IFEND;
          file_changes^ [change_count].retention.selector := fsc$retention_time_increment;
          file_changes^ [change_count].retention.time_increment :=
                pvt [p$new_retention].value^.time_increment_value^;
        ELSE
          file_changes^ [change_count].retention.selector := fsc$retention_expiration_date;
          file_changes^ [change_count].retention.expiration_date :=
                pvt [p$new_retention].value^.date_time_value.value;
        IFEND;
      IFEND;

      IF pvt [p$new_account_project].specified AND pvt [p$new_account_project].value^.boolean_value.value THEN
        change_count := change_count + 1;
        file_changes^ [change_count].selector := fsc$charge_change;
      IFEND;

      IF pvt [p$delete_damage_condition].specified THEN
        damage_conditions := pvt [p$delete_damage_condition].value;
        change_count := change_count + 1;
        file_changes^ [change_count].selector := fsc$delete_damage_change;
        file_changes^ [change_count].delete_damage_condition := $fst$cycle_damage_symptoms [];
        WHILE damage_conditions <> NIL DO
          IF damage_conditions^.element_value^.keyword_value = 'MEDIA_IMAGE_INCONSISTENT' THEN
            file_changes^ [change_count].delete_damage_condition :=
                  file_changes^ [change_count].delete_damage_condition +
                  $fst$cycle_damage_symptoms [fsc$media_image_inconsistent];
          ELSEIF damage_conditions^.element_value^.keyword_value = 'RESPF_MODIFICATION_MISMATCH' THEN
            file_changes^ [change_count].delete_damage_condition :=
                  file_changes^ [change_count].delete_damage_condition +
                  $fst$cycle_damage_symptoms [fsc$respf_modification_mismatch];
          ELSE {'PARENT_CATALOG_RESTORED'}
            file_changes^ [change_count].delete_damage_condition :=
                  file_changes^ [change_count].delete_damage_condition +
                  $fst$cycle_damage_symptoms [fsc$parent_catalog_restored];
          IFEND;
          damage_conditions := damage_conditions^.link;
        WHILEND;
      IFEND;

      IF pvt [p$new_shared_queue].specified THEN
        change_count := change_count + 1;
        file_changes^ [change_count].selector := fsc$shared_queue_change;
        file_changes^ [change_count].shared_queue := pvt [p$new_shared_queue].value^.keyword_value;
      IFEND;

      IF pvt [p$new_retrieve_option].specified THEN
        change_count := change_count + 1;
        file_changes^ [change_count].selector := fsc$retrieve_option_change;
        IF (pvt [p$new_retrieve_option].value^.name_value = 'ALWAYS_RETRIEVE') THEN
          file_changes^ [change_count].retrieve_option := pfc$always_retrieve;
        ELSEIF (pvt [p$new_retrieve_option].value^.name_value = 'EXPLICIT_RETRIEVE_ONLY') THEN
          file_changes^ [change_count].retrieve_option := pfc$explicit_retrieve_only;
        ELSE { 'ADMINISTRATIVE_RETRIEVE_ONLY' }
          file_changes^ [change_count].retrieve_option := pfc$admin_retrieve_only;
        IFEND;
      IFEND;

      IF pvt [p$new_site_archive_option].specified THEN
        change_count := change_count + 1;
        file_changes^ [change_count].selector := fsc$site_archive_option_change;
        IF pvt [p$new_site_archive_option].value^.kind = clc$integer THEN
          file_changes^ [change_count].site_archive_option :=
                pvt [p$new_site_archive_option].value^.integer_value.value;
        ELSE { 'NULL' }
          file_changes^ [change_count].site_archive_option := pfc$null_site_archive_option;
        IFEND;
      IFEND;

      IF pvt [p$new_site_backup_option].specified THEN
        change_count := change_count + 1;
        file_changes^ [change_count].selector := fsc$site_backup_option_change;
        IF pvt [p$new_site_backup_option].value^.kind = clc$integer THEN
          file_changes^ [change_count].site_backup_option :=
                pvt [p$new_site_backup_option].value^.integer_value.value;
        ELSE { 'NULL' }
          file_changes^ [change_count].site_backup_option := pfc$null_site_backup_option;
        IFEND;
      IFEND;

      IF pvt [p$new_site_release_option].specified THEN
        change_count := change_count + 1;
        file_changes^ [change_count].selector := fsc$site_release_option_change;
        IF pvt [p$new_site_release_option].value^.kind = clc$integer THEN
          file_changes^ [change_count].site_release_option :=
                pvt [p$new_site_release_option].value^.integer_value.value;
        ELSE { 'NULL' }
          file_changes^ [change_count].site_release_option := pfc$null_site_release_option;
        IFEND;
      IFEND;

      fsp$change_file (pvt [p$file].value^.file_value^, password, file_changes, status);
      IF NOT status.normal THEN
        status.normal := status.condition = pfe$no_media_image_inconsistent;
      IFEND;
    IFEND;

  PROCEND clp$_change_catalog_entry;
?? TITLE := 'clp$_change_catalog_name', EJECT ??

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

{ PROCEDURE change_catalog_name (
{   catalog, c: file = $required
{   new_catalog_name, ncn: name = $required
{   )

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 4] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
    recend := [
    [1,
    [102, 6, 5, 13, 13, 35, 650],
    clc$command, 4, 2, 2, 0, 0, 0, 0, ''], [
    ['C                              ',clc$abbreviation_entry, 1],
    ['CATALOG                        ',clc$nominal_entry, 1],
    ['NCN                            ',clc$abbreviation_entry, 2],
    ['NEW_CATALOG_NAME               ',clc$nominal_entry, 2]],
    [
{ PARAMETER 1
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$required_parameter, 0
  , 0],
{ PARAMETER 2
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 5, clc$required_parameter, 0
  , 0]],
{ PARAMETER 1
    [[1, 0, clc$file_type]],
{ PARAMETER 2
    [[1, 0, clc$name_type], [1, osc$max_name_size]]];

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

    CONST
      p$catalog = 1,
      p$new_catalog_name = 2;

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

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

    fsp$change_catalog_name (pvt [p$catalog].value^.file_value^, pvt [p$new_catalog_name].value^.name_value,
          status);

  PROCEND clp$_change_catalog_name;
?? TITLE := 'clp$_create_file_permit', EJECT ??

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

{ PROCEDURE (osm$crefp) create_file_permit, crefp (
{   file, f: file = $required
{   group, g: key
{       public, family, account, project, user, user_account, member
{     keyend = user
{   family_name, fn: name = $optional
{   user, u: name = $optional
{   account, a: name = $optional
{   project, p: name = $optional
{   access_modes, access_mode, am: list of key
{       none, read, execute, append, modify, shorten, write, all, cycle, control
{     keyend = (read, execute)
{   share_modes, share_mode, sm: list of key
{       none, read, execute, append, modify, shorten, write, all
{     keyend = $optional
{   application_information, ai: string 0..osc$max_name_size = ''
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 21] of clt$pdt_parameter_name,
        parameters: array [1 .. 10] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
        recend,
        type2: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 7] of clt$keyword_specification,
          default_value: string (4),
        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$name_type_qualifier,
        recend,
        type7: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 10] of clt$keyword_specification,
          recend,
          default_value: string (15),
        recend,
        type8: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 8] of clt$keyword_specification,
          recend,
        recend,
        type9: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
          default_value: string (2),
        recend,
        type10: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [87, 10, 20, 12, 46, 12, 676], clc$command, 21, 10, 1, 0, 0, 0, 10, 'OSM$CREFP'],
            [['A                              ', clc$abbreviation_entry, 5],
            ['ACCESS_MODE                    ', clc$alias_entry, 7],
            ['ACCESS_MODES                   ', clc$nominal_entry, 7],
            ['ACCOUNT                        ', clc$nominal_entry, 5],
            ['AI                             ', clc$abbreviation_entry, 9],
            ['AM                             ', clc$abbreviation_entry, 7],
            ['APPLICATION_INFORMATION        ', clc$nominal_entry, 9],
            ['F                              ', clc$abbreviation_entry, 1],
            ['FAMILY_NAME                    ', clc$nominal_entry, 3],
            ['FILE                           ', clc$nominal_entry, 1],
            ['FN                             ', clc$abbreviation_entry, 3],
            ['G                              ', clc$abbreviation_entry, 2],
            ['GROUP                          ', clc$nominal_entry, 2],
            ['P                              ', clc$abbreviation_entry, 6],
            ['PROJECT                        ', clc$nominal_entry, 6],
            ['SHARE_MODE                     ', clc$alias_entry, 8],
            ['SHARE_MODES                    ', clc$nominal_entry, 8],
            ['SM                             ', clc$abbreviation_entry, 8],
            ['STATUS                         ', clc$nominal_entry, 10],
            ['U                              ', clc$abbreviation_entry, 4],
            ['USER                           ', clc$nominal_entry, 4]], [

{ PARAMETER 1

      [10, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 3, clc$required_parameter, 0, 0],

{ PARAMETER 2

      [13, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 266, clc$optional_default_parameter, 0, 4],

{ PARAMETER 3

      [9, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 5, clc$optional_parameter, 0, 0],

{ PARAMETER 4

      [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, 5, clc$optional_parameter, 0, 0],

{ PARAMETER 5

      [4, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 5, clc$optional_parameter, 0, 0],

{ PARAMETER 6

      [15, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 5, clc$optional_parameter, 0, 0],

{ PARAMETER 7

      [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, 393, clc$optional_default_parameter, 0, 15],

{ PARAMETER 8

      [17, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 319, clc$optional_parameter, 0, 0],

{ PARAMETER 9

      [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, 8, clc$optional_default_parameter, 0, 2],

{ PARAMETER 10

      [19, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name], clc$pass_by_reference, clc$immediate_evaluation,
            clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],

{ PARAMETER 1

      [[1, 0, clc$file_type]],

{ PARAMETER 2

      [[1, 0, clc$keyword_type], [7], [['ACCOUNT                        ', clc$nominal_entry,
            clc$normal_usage_entry, 3], ['FAMILY                         ', clc$nominal_entry,
            clc$normal_usage_entry, 2], ['MEMBER                         ', clc$nominal_entry,
            clc$normal_usage_entry, 7], ['PROJECT                        ', clc$nominal_entry,
            clc$normal_usage_entry, 4], ['PUBLIC                         ', clc$nominal_entry,
            clc$normal_usage_entry, 1], ['USER                           ', clc$nominal_entry,
            clc$normal_usage_entry, 5], ['USER_ACCOUNT                   ', clc$nominal_entry,
            clc$normal_usage_entry, 6]], 'user'],

{ 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$name_type], [1, osc$max_name_size]],

{ PARAMETER 7

      [[1, 0, clc$list_type], [377, 1, clc$max_list_size, FALSE],
            [[1, 0, clc$keyword_type], [10], [['ALL                            ', clc$nominal_entry,
            clc$normal_usage_entry, 8], ['APPEND                         ', clc$nominal_entry,
            clc$normal_usage_entry, 4], ['CONTROL                        ', clc$nominal_entry,
            clc$normal_usage_entry, 10], ['CYCLE                          ', clc$nominal_entry,
            clc$normal_usage_entry, 9], ['EXECUTE                        ', clc$nominal_entry,
            clc$normal_usage_entry, 3], ['MODIFY                         ', clc$nominal_entry,
            clc$normal_usage_entry, 5], ['NONE                           ', clc$nominal_entry,
            clc$normal_usage_entry, 1], ['READ                           ', clc$nominal_entry,
            clc$normal_usage_entry, 2], ['SHORTEN                        ', clc$nominal_entry,
            clc$normal_usage_entry, 6], ['WRITE                          ', clc$nominal_entry,
            clc$normal_usage_entry, 7]]], '(read, execute)'],

{ PARAMETER 8

      [[1, 0, clc$list_type], [303, 1, clc$max_list_size, FALSE],
            [[1, 0, clc$keyword_type], [8], [['ALL                            ', clc$nominal_entry,
            clc$normal_usage_entry, 8], ['APPEND                         ', clc$nominal_entry,
            clc$normal_usage_entry, 4], ['EXECUTE                        ', clc$nominal_entry,
            clc$normal_usage_entry, 3], ['MODIFY                         ', clc$nominal_entry,
            clc$normal_usage_entry, 5], ['NONE                           ', clc$nominal_entry,
            clc$normal_usage_entry, 1], ['READ                           ', clc$nominal_entry,
            clc$normal_usage_entry, 2], ['SHORTEN                        ', clc$nominal_entry,
            clc$normal_usage_entry, 6], ['WRITE                          ', clc$nominal_entry,
            clc$normal_usage_entry, 7]]]],

{ PARAMETER 9

      [[1, 0, clc$string_type], [0, osc$max_name_size, FALSE], ''''''],

{ PARAMETER 10

      [[1, 0, clc$status_type]]];

?? POP ??

    CONST
      p$file = 1,
      p$group = 2,
      p$family_name = 3,
      p$user = 4,
      p$account = 5,
      p$project = 6,
      p$access_modes = 7,
      p$share_modes = 8,
      p$application_information = 9,
      p$status = 10;

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

    VAR
      application_info: pft$application_info,
      evaluated_file_reference: fst$evaluated_file_reference,
      first_path_element_is_$local: boolean,
      group: pft$group,
      ignore_permit: pft$permit_selections,
      ignore_usage_share: pft$usage_selections,
      permit: pft$permit_selections,
      pf_path: ^pft$path,
      remote: boolean,
      share: pft$share_selections,
      share_specified: boolean;


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

    evaluate_path_and_handle_remote ('CREATE_FILE_PERMIT', pvt [p$file].value^.file_value^, ^pvt,
          evaluated_file_reference, first_path_element_is_$local, remote, status);
    IF (NOT status.normal) OR remote THEN
      RETURN; {----->
    IFEND;

    handle_group_specification (^pvt, group, status);
    IF NOT status.normal THEN
      RETURN {----->
    IFEND;

    handle_access_mode_or_share (pvt [p$access_modes].value, select_permit, ignore_usage_share, permit,
          status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF pvt [p$share_modes].specified THEN
      handle_access_mode_or_share (pvt [p$share_modes].value, select_share, share, ignore_permit, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    ELSEIF (permit * $pft$permit_selections [pfc$append, pfc$shorten,
          pfc$modify]) <> $pft$permit_selections [] THEN
      share := $pft$share_selections [];
    ELSE
      share := $pft$share_selections [pfc$read, pfc$execute];
    IFEND;

    application_info := pvt [p$application_information].value^.string_value^;

    IF first_path_element_is_$local THEN
      IF evaluated_file_reference.number_of_path_elements = 1 THEN
        osp$set_status_abnormal ('CL', cle$not_permitted_on_loc_cat, '', status);
      ELSE
        osp$set_status_abnormal ('CL', cle$not_permitted_on_loc_file, '', status);
      IFEND;
    ELSE
      PUSH pf_path: [1 .. evaluated_file_reference.number_of_path_elements];
      fsp$convert_fs_structure_to_pf (evaluated_file_reference, pf_path);
      pfp$permit (pf_path^, group, permit, share, application_info, status);
    IFEND;

  PROCEND clp$_create_file_permit;
?? TITLE := 'clp$_delete_file_permit', EJECT ??

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

{ PROCEDURE (osm$delfp) delete_file_permit, delfp (
{   file, f: file = $required
{   group, g: key
{       public, family, account, project, user, user_account, member
{     keyend = user
{   family_name, fn: name = $optional
{   user, u: name = $optional
{   account, a: name = $optional
{   project, p: name = $optional
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 13] of clt$pdt_parameter_name,
        parameters: array [1 .. 7] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
        recend,
        type2: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 7] of clt$keyword_specification,
          default_value: string (4),
        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$name_type_qualifier,
        recend,
        type7: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [87, 10, 20, 12, 46, 35, 368], clc$command, 13, 7, 1, 0, 0, 0, 7, 'OSM$DELFP'],
            [['A                              ', clc$abbreviation_entry, 5],
            ['ACCOUNT                        ', clc$nominal_entry, 5],
            ['F                              ', clc$abbreviation_entry, 1],
            ['FAMILY_NAME                    ', clc$nominal_entry, 3],
            ['FILE                           ', clc$nominal_entry, 1],
            ['FN                             ', clc$abbreviation_entry, 3],
            ['G                              ', clc$abbreviation_entry, 2],
            ['GROUP                          ', clc$nominal_entry, 2],
            ['P                              ', clc$abbreviation_entry, 6],
            ['PROJECT                        ', clc$nominal_entry, 6],
            ['STATUS                         ', clc$nominal_entry, 7],
            ['U                              ', clc$abbreviation_entry, 4],
            ['USER                           ', clc$nominal_entry, 4]], [

{ PARAMETER 1

      [5, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 3, clc$required_parameter, 0, 0],

{ PARAMETER 2

      [8, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 266, clc$optional_default_parameter, 0, 4],

{ PARAMETER 3

      [4, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 5, clc$optional_parameter, 0, 0],

{ PARAMETER 4

      [13, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 5, clc$optional_parameter, 0, 0],

{ PARAMETER 5

      [2, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 5, clc$optional_parameter, 0, 0],

{ PARAMETER 6

      [10, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 5, clc$optional_parameter, 0, 0],

{ PARAMETER 7

      [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$file_type]],

{ PARAMETER 2

      [[1, 0, clc$keyword_type], [7], [['ACCOUNT                        ', clc$nominal_entry,
            clc$normal_usage_entry, 3], ['FAMILY                         ', clc$nominal_entry,
            clc$normal_usage_entry, 2], ['MEMBER                         ', clc$nominal_entry,
            clc$normal_usage_entry, 7], ['PROJECT                        ', clc$nominal_entry,
            clc$normal_usage_entry, 4], ['PUBLIC                         ', clc$nominal_entry,
            clc$normal_usage_entry, 1], ['USER                           ', clc$nominal_entry,
            clc$normal_usage_entry, 5], ['USER_ACCOUNT                   ', clc$nominal_entry,
            clc$normal_usage_entry, 6]], 'user'],

{ 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$name_type], [1, osc$max_name_size]],

{ PARAMETER 7

      [[1, 0, clc$status_type]]];

?? POP ??

    CONST
      p$file = 1,
      p$group = 2,
      p$family_name = 3,
      p$user = 4,
      p$account = 5,
      p$project = 6,
      p$status = 7;

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

    VAR
      group: pft$group,
      evaluated_file_reference: fst$evaluated_file_reference,
      first_path_element_is_$local: boolean,
      pf_path: ^pft$path,
      remote: boolean;


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

    evaluate_path_and_handle_remote ('DELETE_FILE_PERMIT', pvt [p$file].value^.file_value^, ^pvt,
          evaluated_file_reference, first_path_element_is_$local, remote, status);
    IF (NOT status.normal) OR remote THEN
      RETURN; {----->
    IFEND;

    handle_group_specification (^pvt, group, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF first_path_element_is_$local THEN
      IF evaluated_file_reference.number_of_path_elements = 1 THEN
        osp$set_status_abnormal ('CL', cle$not_permitted_on_loc_cat, '', status);
      ELSE
        osp$set_status_abnormal ('CL', cle$not_permitted_on_loc_file, '', status);
      IFEND;
    ELSE
      PUSH pf_path: [1 .. evaluated_file_reference.number_of_path_elements];
      fsp$convert_fs_structure_to_pf (evaluated_file_reference, pf_path);
      pfp$delete_permit (pf_path^, group, status);
    IFEND;

  PROCEND clp$_delete_file_permit;
?? TITLE := 'clp$_create_catalog', EJECT ??

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

{ PROCEDURE (osm$crec) create_catalog, crec (
{   catalog, c: file = $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,
        recend,
        type2: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [87, 10, 20, 12, 46, 56, 588], clc$command, 3, 2, 1, 0, 0, 0, 2, 'OSM$CREC'],
            [['C                              ', clc$abbreviation_entry, 1],
            ['CATALOG                        ', 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_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 3, 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$file_type]],

{ PARAMETER 2

      [[1, 0, clc$status_type]]];

?? POP ??

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

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

    VAR
      evaluated_file_reference: fst$evaluated_file_reference,
      first_path_element_is_$local: boolean,
      pf_path: ^pft$path,
      remote: boolean;


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

    evaluate_path_and_handle_remote ('CREATE_CATALOG', pvt [p$catalog].value^.file_value^, ^pvt,
          evaluated_file_reference, first_path_element_is_$local, remote, status);
    IF (NOT status.normal) OR remote THEN
      RETURN; {----->
    IFEND;

    IF evaluated_file_reference.path_handle_info.path_handle.open_position.specified THEN
      osp$set_status_abnormal ('CL', cle$file_position_not_allowed, '', status);
      RETURN; {----->
    IFEND;

    IF first_path_element_is_$local THEN
      IF evaluated_file_reference.number_of_path_elements = 1 THEN
        osp$set_status_abnormal ('CL', cle$name_already_catalog, fsc$local, status);
      ELSE
        osp$set_status_abnormal ('CL', fse$local_subcatalog_illegal, '', status);
      IFEND;
    ELSE
      IF evaluated_file_reference.cycle_reference.specification <> fsc$cycle_omitted THEN
        osp$set_status_abnormal ('CL', fse$catalogs_do_not_have_cycles, '', status);
        osp$append_status_file (osc$status_parameter_delimiter, pvt [p$catalog].value^.file_value^, status);
        RETURN; {----->
      IFEND;

      PUSH pf_path: [1 .. evaluated_file_reference.number_of_path_elements];
      fsp$convert_fs_structure_to_pf (evaluated_file_reference, pf_path);
      pfp$define_catalog (pf_path^, status);
    IFEND;

  PROCEND clp$_create_catalog;
?? TITLE := 'clp$_delete_catalog', EJECT ??

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

{ PROCEDURE (osm$delc) delete_catalog, delc (
{   catalog, c: file = $required
{   delete_option, do: key
{       (catalog_and_contents, cac)
{       (contents_only, co)
{       (only_if_empty, oie)
{     keyend = only_if_empty
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 5] of clt$pdt_parameter_name,
        parameters: array [1 .. 3] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
        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 (13),
        recend,
        type3: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [88, 3, 29, 9, 39, 5, 639], clc$command, 5, 3, 1, 0, 0, 0, 3, 'OSM$DELC'],
            [['C                              ', clc$abbreviation_entry, 1],
            ['CATALOG                        ', clc$nominal_entry, 1],
            ['DELETE_OPTION                  ', clc$nominal_entry, 2],
            ['DO                             ', clc$abbreviation_entry, 2],
            ['STATUS                         ', clc$nominal_entry, 3]], [

{ 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, 3, clc$required_parameter, 0, 0],

{ PARAMETER 2

      [3, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 229, clc$optional_default_parameter, 0, 13],

{ PARAMETER 3

      [5, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods [clc$specify_by_name],
            clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
            clc$optional_parameter, 0, 0]],

{ PARAMETER 1

      [[1, 0, clc$file_type]],

{ PARAMETER 2

      [[1, 0, clc$keyword_type], [6], [['CAC                            ', clc$abbreviation_entry,
            clc$normal_usage_entry, 1], ['CATALOG_AND_CONTENTS           ', clc$nominal_entry,
            clc$normal_usage_entry, 1], ['CO                             ', clc$abbreviation_entry,
            clc$normal_usage_entry, 2], ['CONTENTS_ONLY                  ', clc$nominal_entry,
            clc$normal_usage_entry, 2], ['OIE                            ', clc$abbreviation_entry,
            clc$normal_usage_entry, 3], ['ONLY_IF_EMPTY                  ', clc$nominal_entry,
            clc$normal_usage_entry, 3]], 'only_if_empty'],

{ PARAMETER 3

      [[1, 0, clc$status_type]]];

?? POP ??

    CONST
      p$catalog = 1,
      p$delete_option = 2,
      p$status = 3;

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

    VAR
      evaluated_file_reference: fst$evaluated_file_reference,
      first_path_element_is_$local: boolean,
      pf_path: ^pft$path,
      remote: boolean;


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

    evaluate_path_and_handle_remote ('DELETE_CATALOG', pvt [p$catalog].value^.file_value^, ^pvt,
          evaluated_file_reference, first_path_element_is_$local, remote, status);
    IF (NOT status.normal) OR remote THEN
      RETURN; {----->
    IFEND;

    IF evaluated_file_reference.path_handle_info.path_handle.open_position.specified THEN
      osp$set_status_abnormal ('CL', cle$file_position_not_allowed, '', status);
      RETURN; {----->
    IFEND;

    IF first_path_element_is_$local THEN
      IF evaluated_file_reference.number_of_path_elements = 1 THEN
        osp$set_status_abnormal ('CL', cle$catalog_not_empty, fsc$local, status);
      ELSE
        osp$set_status_abnormal ('CL', cle$not_permitted_on_loc_file, '', status);
      IFEND;
    ELSE
      IF evaluated_file_reference.cycle_reference.specification <> fsc$cycle_omitted THEN
        osp$set_status_abnormal ('CL', fse$catalogs_do_not_have_cycles, '', status);
        osp$append_status_file (osc$status_parameter_delimiter, pvt [p$catalog].value^.file_value^, status);
        RETURN; {----->
      IFEND;

      PUSH pf_path: [1 .. evaluated_file_reference.number_of_path_elements];
      fsp$convert_fs_structure_to_pf (evaluated_file_reference, pf_path);

      IF pvt [p$delete_option].value^.keyword_value = 'CATALOG_AND_CONTENTS' THEN
        pfp$purge_catalog_contents (pf_path^, {purge_catalog} TRUE, status);
      ELSEIF pvt [p$delete_option].value^.keyword_value = 'CONTENTS_ONLY' THEN
        pfp$purge_catalog_contents (pf_path^, {purge_catalog} FALSE, status);
      ELSE { ONLY_IF_EMPTY }
        pfp$purge_catalog (pf_path^, status);
      IFEND;
    IFEND;

  PROCEND clp$_delete_catalog;
?? TITLE := 'clp$_create_catalog_permit', EJECT ??

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

{ PROCEDURE (osm$crecp) create_catalog_permit, crecp (
{   catalog, c: file = $required
{   group, g: key
{       public, family, account, project, user, user_account, member
{     keyend = user
{   family_name, fn: name = $optional
{   user, u: name = $optional
{   account, a: name = $optional
{   project, p: name = $optional
{   access_modes, access_mode, am: list of key
{       none, read, execute, append, modify, shorten, write, all, cycle, control
{     keyend = (read, execute)
{   share_modes, share_mode, sm: list of key
{       none, read, execute, append, modify, shorten, write, all
{     keyend = $optional
{   application_information, ai: string 0..osc$max_name_size = ''
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 21] of clt$pdt_parameter_name,
        parameters: array [1 .. 10] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
        recend,
        type2: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 7] of clt$keyword_specification,
          default_value: string (4),
        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$name_type_qualifier,
        recend,
        type7: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 10] of clt$keyword_specification,
          recend,
          default_value: string (15),
        recend,
        type8: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 8] of clt$keyword_specification,
          recend,
        recend,
        type9: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
          default_value: string (2),
        recend,
        type10: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [87, 10, 20, 12, 47, 34, 340], clc$command, 21, 10, 1, 0, 0, 0, 10, 'OSM$CRECP'],
            [['A                              ', clc$abbreviation_entry, 5],
            ['ACCESS_MODE                    ', clc$alias_entry, 7],
            ['ACCESS_MODES                   ', clc$nominal_entry, 7],
            ['ACCOUNT                        ', clc$nominal_entry, 5],
            ['AI                             ', clc$abbreviation_entry, 9],
            ['AM                             ', clc$abbreviation_entry, 7],
            ['APPLICATION_INFORMATION        ', clc$nominal_entry, 9],
            ['C                              ', clc$abbreviation_entry, 1],
            ['CATALOG                        ', clc$nominal_entry, 1],
            ['FAMILY_NAME                    ', clc$nominal_entry, 3],
            ['FN                             ', clc$abbreviation_entry, 3],
            ['G                              ', clc$abbreviation_entry, 2],
            ['GROUP                          ', clc$nominal_entry, 2],
            ['P                              ', clc$abbreviation_entry, 6],
            ['PROJECT                        ', clc$nominal_entry, 6],
            ['SHARE_MODE                     ', clc$alias_entry, 8],
            ['SHARE_MODES                    ', clc$nominal_entry, 8],
            ['SM                             ', clc$abbreviation_entry, 8],
            ['STATUS                         ', clc$nominal_entry, 10],
            ['U                              ', clc$abbreviation_entry, 4],
            ['USER                           ', clc$nominal_entry, 4]], [

{ PARAMETER 1

      [9, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 3, clc$required_parameter, 0, 0],

{ PARAMETER 2

      [13, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 266, clc$optional_default_parameter, 0, 4],

{ PARAMETER 3

      [10, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 5, clc$optional_parameter, 0, 0],

{ PARAMETER 4

      [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, 5, clc$optional_parameter, 0, 0],

{ PARAMETER 5

      [4, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 5, clc$optional_parameter, 0, 0],

{ PARAMETER 6

      [15, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 5, clc$optional_parameter, 0, 0],

{ PARAMETER 7

      [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, 393, clc$optional_default_parameter, 0, 15],

{ PARAMETER 8

      [17, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 319, clc$optional_parameter, 0, 0],

{ PARAMETER 9

      [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, 8, clc$optional_default_parameter, 0, 2],

{ PARAMETER 10

      [19, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name], clc$pass_by_reference, clc$immediate_evaluation,
            clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],

{ PARAMETER 1

      [[1, 0, clc$file_type]],

{ PARAMETER 2

      [[1, 0, clc$keyword_type], [7], [['ACCOUNT                        ', clc$nominal_entry,
            clc$normal_usage_entry, 3], ['FAMILY                         ', clc$nominal_entry,
            clc$normal_usage_entry, 2], ['MEMBER                         ', clc$nominal_entry,
            clc$normal_usage_entry, 7], ['PROJECT                        ', clc$nominal_entry,
            clc$normal_usage_entry, 4], ['PUBLIC                         ', clc$nominal_entry,
            clc$normal_usage_entry, 1], ['USER                           ', clc$nominal_entry,
            clc$normal_usage_entry, 5], ['USER_ACCOUNT                   ', clc$nominal_entry,
            clc$normal_usage_entry, 6]], 'user'],

{ 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$name_type], [1, osc$max_name_size]],

{ PARAMETER 7

      [[1, 0, clc$list_type], [377, 1, clc$max_list_size, FALSE],
            [[1, 0, clc$keyword_type], [10], [['ALL                            ', clc$nominal_entry,
            clc$normal_usage_entry, 8], ['APPEND                         ', clc$nominal_entry,
            clc$normal_usage_entry, 4], ['CONTROL                        ', clc$nominal_entry,
            clc$normal_usage_entry, 10], ['CYCLE                          ', clc$nominal_entry,
            clc$normal_usage_entry, 9], ['EXECUTE                        ', clc$nominal_entry,
            clc$normal_usage_entry, 3], ['MODIFY                         ', clc$nominal_entry,
            clc$normal_usage_entry, 5], ['NONE                           ', clc$nominal_entry,
            clc$normal_usage_entry, 1], ['READ                           ', clc$nominal_entry,
            clc$normal_usage_entry, 2], ['SHORTEN                        ', clc$nominal_entry,
            clc$normal_usage_entry, 6], ['WRITE                          ', clc$nominal_entry,
            clc$normal_usage_entry, 7]]], '(read, execute)'],

{ PARAMETER 8

      [[1, 0, clc$list_type], [303, 1, clc$max_list_size, FALSE],
            [[1, 0, clc$keyword_type], [8], [['ALL                            ', clc$nominal_entry,
            clc$normal_usage_entry, 8], ['APPEND                         ', clc$nominal_entry,
            clc$normal_usage_entry, 4], ['EXECUTE                        ', clc$nominal_entry,
            clc$normal_usage_entry, 3], ['MODIFY                         ', clc$nominal_entry,
            clc$normal_usage_entry, 5], ['NONE                           ', clc$nominal_entry,
            clc$normal_usage_entry, 1], ['READ                           ', clc$nominal_entry,
            clc$normal_usage_entry, 2], ['SHORTEN                        ', clc$nominal_entry,
            clc$normal_usage_entry, 6], ['WRITE                          ', clc$nominal_entry,
            clc$normal_usage_entry, 7]]]],

{ PARAMETER 9

      [[1, 0, clc$string_type], [0, osc$max_name_size, FALSE], ''''''],

{ PARAMETER 10

      [[1, 0, clc$status_type]]];

?? POP ??

    CONST
      p$catalog = 1,
      p$group = 2,
      p$family_name = 3,
      p$user = 4,
      p$account = 5,
      p$project = 6,
      p$access_modes = 7,
      p$share_modes = 8,
      p$application_information = 9,
      p$status = 10;

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

    VAR
      application_info: pft$application_info,
      evaluated_file_reference: fst$evaluated_file_reference,
      first_path_element_is_$local: boolean,
      group: pft$group,
      ignore_permit: pft$permit_selections,
      ignore_usage_share: pft$usage_selections,
      permit: pft$permit_selections,
      pf_path: ^pft$path,
      remote: boolean,
      share: pft$share_selections,
      share_specified: boolean;


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

    evaluate_path_and_handle_remote ('CREATE_CATALOG_PERMIT', pvt [p$catalog].value^.file_value^, ^pvt,
          evaluated_file_reference, first_path_element_is_$local, remote, status);
    IF (NOT status.normal) OR remote THEN
      RETURN; {----->
    IFEND;

    IF evaluated_file_reference.cycle_reference.specification <> fsc$cycle_omitted THEN
      osp$set_status_abnormal ('CL', fse$catalogs_do_not_have_cycles, '', status);
      osp$append_status_file (osc$status_parameter_delimiter, pvt [p$catalog].value^.file_value^, status);
      RETURN; {----->
    IFEND;

    IF evaluated_file_reference.path_handle_info.path_handle.open_position.specified THEN
      osp$set_status_abnormal ('CL', cle$file_position_not_allowed, '', status);
      RETURN; {----->
    IFEND;

    handle_group_specification (^pvt, group, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    handle_access_mode_or_share (pvt [p$access_modes].value, select_permit, ignore_usage_share, permit,
          status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF pvt [p$share_modes].specified THEN
      handle_access_mode_or_share (pvt [p$share_modes].value, select_share, share, ignore_permit, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    ELSEIF (permit * $pft$permit_selections [pfc$append, pfc$shorten,
          pfc$modify]) <> $pft$permit_selections [] THEN
      share := $pft$share_selections [];
    ELSE
      share := $pft$share_selections [pfc$read, pfc$execute];
    IFEND;

    application_info := pvt [p$application_information].value^.string_value^;

    IF first_path_element_is_$local THEN
      IF evaluated_file_reference.number_of_path_elements = 1 THEN
        osp$set_status_abnormal ('CL', cle$not_permitted_on_loc_cat, '', status);
      ELSE
        osp$set_status_abnormal ('CL', cle$not_permitted_on_loc_file, '', status);
      IFEND;
    ELSE
      PUSH pf_path: [1 .. evaluated_file_reference.number_of_path_elements];
      fsp$convert_fs_structure_to_pf (evaluated_file_reference, pf_path);
      pfp$permit_catalog (pf_path^, group, permit, share, application_info, status);
    IFEND;

  PROCEND clp$_create_catalog_permit;
?? TITLE := 'clp$_delete_catalog_permit', EJECT ??

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

{ PROCEDURE (osm$delcp) delete_catalog_permit, delcp (
{   catalog, c: file = $required
{   group, g: key
{       public, family, account, project, user, user_account, member
{     keyend = user
{   family_name, fn: name = $optional
{   user, u: name = $optional
{   account, a: name = $optional
{   project, p: name = $optional
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 13] of clt$pdt_parameter_name,
        parameters: array [1 .. 7] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
        recend,
        type2: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 7] of clt$keyword_specification,
          default_value: string (4),
        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$name_type_qualifier,
        recend,
        type7: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [87, 10, 20, 12, 47, 57, 817], clc$command, 13, 7, 1, 0, 0, 0, 7, 'OSM$DELCP'],
            [['A                              ', clc$abbreviation_entry, 5],
            ['ACCOUNT                        ', clc$nominal_entry, 5],
            ['C                              ', clc$abbreviation_entry, 1],
            ['CATALOG                        ', clc$nominal_entry, 1],
            ['FAMILY_NAME                    ', clc$nominal_entry, 3],
            ['FN                             ', clc$abbreviation_entry, 3],
            ['G                              ', clc$abbreviation_entry, 2],
            ['GROUP                          ', clc$nominal_entry, 2],
            ['P                              ', clc$abbreviation_entry, 6],
            ['PROJECT                        ', clc$nominal_entry, 6],
            ['STATUS                         ', clc$nominal_entry, 7],
            ['U                              ', clc$abbreviation_entry, 4],
            ['USER                           ', clc$nominal_entry, 4]], [

{ PARAMETER 1

      [4, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 3, clc$required_parameter, 0, 0],

{ PARAMETER 2

      [8, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 266, clc$optional_default_parameter, 0, 4],

{ PARAMETER 3

      [5, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 5, clc$optional_parameter, 0, 0],

{ PARAMETER 4

      [13, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 5, clc$optional_parameter, 0, 0],

{ PARAMETER 5

      [2, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 5, clc$optional_parameter, 0, 0],

{ PARAMETER 6

      [10, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 5, clc$optional_parameter, 0, 0],

{ PARAMETER 7

      [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$file_type]],

{ PARAMETER 2

      [[1, 0, clc$keyword_type], [7], [['ACCOUNT                        ', clc$nominal_entry,
            clc$normal_usage_entry, 3], ['FAMILY                         ', clc$nominal_entry,
            clc$normal_usage_entry, 2], ['MEMBER                         ', clc$nominal_entry,
            clc$normal_usage_entry, 7], ['PROJECT                        ', clc$nominal_entry,
            clc$normal_usage_entry, 4], ['PUBLIC                         ', clc$nominal_entry,
            clc$normal_usage_entry, 1], ['USER                           ', clc$nominal_entry,
            clc$normal_usage_entry, 5], ['USER_ACCOUNT                   ', clc$nominal_entry,
            clc$normal_usage_entry, 6]], 'user'],

{ 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$name_type], [1, osc$max_name_size]],

{ PARAMETER 7

      [[1, 0, clc$status_type]]];

?? POP ??

    CONST
      p$catalog = 1,
      p$group = 2,
      p$family_name = 3,
      p$user = 4,
      p$account = 5,
      p$project = 6,
      p$status = 7;

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

    VAR
      evaluated_file_reference: fst$evaluated_file_reference,
      first_path_element_is_$local: boolean,
      group: pft$group,
      pf_path: ^pft$path,
      remote: boolean;


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

    evaluate_path_and_handle_remote ('DELETE_CATALOG_PERMIT', pvt [p$catalog].value^.file_value^, ^pvt,
          evaluated_file_reference, first_path_element_is_$local, remote, status);
    IF (NOT status.normal) OR remote THEN
      RETURN; {----->
    IFEND;

    IF evaluated_file_reference.cycle_reference.specification <> fsc$cycle_omitted THEN
      osp$set_status_abnormal ('CL', fse$catalogs_do_not_have_cycles, '', status);
      osp$append_status_file (osc$status_parameter_delimiter, pvt [p$catalog].value^.file_value^, status);
      RETURN; {----->
    IFEND;

    IF evaluated_file_reference.path_handle_info.path_handle.open_position.specified THEN
      osp$set_status_abnormal ('CL', cle$file_position_not_allowed, '', status);
      RETURN; {----->
    IFEND;

    handle_group_specification (^pvt, group, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF first_path_element_is_$local THEN
      IF evaluated_file_reference.number_of_path_elements = 1 THEN
        osp$set_status_abnormal ('CL', cle$not_permitted_on_loc_cat, '', status);
      ELSE
        osp$set_status_abnormal ('CL', cle$not_permitted_on_loc_file, '', status);
      IFEND;
    ELSE
      PUSH pf_path: [1 .. evaluated_file_reference.number_of_path_elements];
      fsp$convert_fs_structure_to_pf (evaluated_file_reference, pf_path);
      pfp$delete_catalog_permit (pf_path^, group, status);
    IFEND;

  PROCEND clp$_delete_catalog_permit;

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

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


{  PROCEDURE [HIDDEN] flush_catalog, flush_catalogs, fluc (
{    catalog, catalogs, c: list of file = $required
{    status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 4] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [90, 3, 19, 13, 41, 57, 314],
    clc$command, 4, 2, 1, 0, 0, 0, 2, ''], [
    ['C                              ',clc$abbreviation_entry, 1],
    ['CATALOG                        ',clc$nominal_entry, 1],
    ['CATALOGS                       ',clc$alias_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 2]],
    [
{ PARAMETER 1
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 19, clc$required_parameter, 0, 0],
{ PARAMETER 2
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$list_type], [3, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$file_type]]
    ],
{ PARAMETER 2
    [[1, 0, clc$status_type]]];

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

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

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

    VAR
      file_list: ^clt$data_value;


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

    file_list := pvt [p$catalog].value;
    WHILE file_list <> NIL DO
      fsp$flush_catalog (file_list^.element_value^.file_value^, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      file_list := file_list^.link;
    WHILEND;

  PROCEND clp$_flush_catalog;

?? TITLE := 'evaluate_path_and_handle_remote', EJECT ??

{
{ PURPOSE:
{   This procedure parses a path for a command and determines whether it
{   represents a file on a remote system.  If so it performs the appropriate
{   remote operation; otherwise it returns the evaluated_file_reference for the
{   path along with a boolean indicating whether the path is or is in the
{   $LOCAL catalog.
{

  PROCEDURE evaluate_path_and_handle_remote
    (    command_name: ost$name_reference;
         path: fst$file_reference;
         pvt: ^clt$parameter_value_table;
     VAR evaluated_file_reference: fst$evaluated_file_reference;
     VAR first_path_element_is_$local: boolean;
     VAR remote: boolean;
     VAR status: ost$status);

    VAR
      block: ^clt$block,
      family_name: ost$family_name,
      ignore_process_pt_results: bat$process_pt_results,
      remote_parameter: array [1 .. 1] of clt$parameter_substitution,
      work_area: ^^clt$work_area;


    clp$evaluate_file_reference (path, $clt$file_ref_parsing_options [], FALSE, evaluated_file_reference,
          status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    family_name := fsp$path_element (^evaluated_file_reference, 1) ^;

    nfp$check_implicit_access (family_name, remote, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF remote THEN
      clp$get_work_area (#RING (^work_area), work_area, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

      clp$find_current_block (block);

      remote_parameter [1].name := 'STATUS';
      remote_parameter [1].text := NIL;

      nfp$perform_implicit_access (family_name, clc$null_file, path, nfc$null, command_name,
            block^.parameters.unbundled_pdt, pvt, ^remote_parameter, work_area^, status);
      RETURN; {----->
    IFEND;

    first_path_element_is_$local := family_name = fsc$local;

{ Return permanent file path if file is attached as a local file.

    IF first_path_element_is_$local THEN
      bap$process_pt_request ($bat$process_pt_work_list [bac$resolve_path], osc$null_name,
            evaluated_file_reference, ignore_process_pt_results, status);
      family_name := fsp$path_element (^evaluated_file_reference, 1) ^;
      first_path_element_is_$local := family_name = fsc$local;
    IFEND;

  PROCEND evaluate_path_and_handle_remote;
?? TITLE := 'handle_group_specification', EJECT ??

{
{ PURPOSE:
{   This procedure processes permission values for the parameter 'GROUP', based
{   on the assumption that only input pertinent to a particular permission_type
{   will be processed.  Extraneous parameters cause an error status to be
{   generated.
{
{ NOTE:
{   This routine assumes that the group, family_name, user, account, and
{   project parameters are in the same position for all commands that use it.
{

  PROCEDURE handle_group_specification
    (    pvt: ^clt$parameter_value_table;
     VAR group: pft$group;
     VAR status: ost$status);

    CONST
      p$group = 2,
      p$family_name = 3,
      p$user = 4,
      p$account = 5,
      p$project = 6;

    TYPE
      param_value_set = set of (family_param, account_param, project_param, user_param);

    VAR
      group_value: clt$keyword,
      param_values: param_value_set,
      user: ost$user_name,
      family: ost$family_name,
      account: avt$account_name,
      project: avt$project_name;


    param_values := $param_value_set [];

    IF pvt^ [p$family_name].specified THEN
      param_values := param_values + $param_value_set [family_param];
      family := pvt^ [p$family_name].value^.name_value;
    ELSE
      family := osc$null_name;
    IFEND;

    IF pvt^ [p$user].specified THEN
      param_values := param_values + $param_value_set [user_param];
      user := pvt^ [p$user].value^.name_value;
    ELSE
      user := osc$null_name;
    IFEND;

    IF pvt^ [p$account].specified THEN
      param_values := param_values + $param_value_set [account_param];
      account := pvt^ [p$account].value^.name_value;
    ELSE
      account := osc$null_name;
    IFEND;

    IF pvt^ [p$project].specified THEN
      param_values := param_values + $param_value_set [project_param];
      project := pvt^ [p$project].value^.name_value;
    ELSE
      project := osc$null_name;
    IFEND;

    group_value := pvt^ [p$group].value^.keyword_value;
    IF group_value = 'ACCOUNT' THEN
      IF (param_values - $param_value_set [family_param, account_param]) <> $param_value_set [] THEN
        osp$set_status_abnormal ('CL', cle$incompatible_params_given, 'GROUP=ACCOUNT', status);
        RETURN; {----->
      IFEND;
      group.group_type := pfc$account;
      group.account_description.family := family;
      group.account_description.account := account;
    ELSEIF group_value = 'FAMILY' THEN
      IF (param_values - $param_value_set [family_param]) <> $param_value_set [] THEN
        osp$set_status_abnormal ('CL', cle$incompatible_params_given, 'GROUP=FAMILY', status);
        RETURN; {----->
      IFEND;
      group.group_type := pfc$family;
      group.family_description.family := family;
    ELSEIF group_value = 'MEMBER' THEN
      group.group_type := pfc$member;
      group.member_description.family := family;
      group.member_description.account := account;
      group.member_description.project := project;
      group.member_description.user := user;
    ELSEIF group_value = 'PROJECT' THEN
      IF (param_values - $param_value_set [family_param, account_param, project_param]) <> $param_value_set
            [] THEN
        osp$set_status_abnormal ('CL', cle$incompatible_params_given, 'GROUP=PROJECT', status);
        RETURN; {----->
      IFEND;
      group.group_type := pfc$project;
      group.project_description.family := family;
      group.project_description.account := account;
      group.project_description.project := project;
    ELSEIF group_value = 'PUBLIC' THEN
      IF param_values <> $param_value_set [] THEN
        osp$set_status_abnormal ('CL', cle$incompatible_params_given, 'GROUP=PUBLIC', status);
        RETURN; {----->
      IFEND;
      group.group_type := pfc$public;
    ELSEIF group_value = 'USER_ACCOUNT' THEN
      IF (param_values - $param_value_set [family_param, account_param, user_param]) <> $param_value_set
            [] THEN
        osp$set_status_abnormal ('CL', cle$incompatible_params_given, 'GROUP=USER_ACCOUNT', status);
        RETURN; {----->
      IFEND;
      group.group_type := pfc$user_account;
      group.user_account_description.family := family;
      group.user_account_description.account := account;
      group.user_account_description.user := user;
    ELSEIF group_value = 'USER' THEN
      IF (param_values - $param_value_set [family_param, user_param]) <> $param_value_set [] THEN
        osp$set_status_abnormal ('CL', cle$incompatible_params_given, 'GROUP=USER', status);
        RETURN; {----->
      IFEND;
      group.group_type := pfc$user;
      group.user_description.family := family;
      group.user_description.user := user;
    IFEND;

  PROCEND handle_group_specification;
?? TITLE := 'handle_access_mode_or_share', EJECT ??

{
{ PURPOSE:
{   This procedure processes the 'ACCESS_MODE' and 'SHARE_MODE' parameters for
{   all commands that contain  one or both of them.  One of the command
{   parameters is processed on each call to this procedure.  For any given
{   call, the caller will use only one of the output parameters; however, both
{   are always built since this procedure doesn't know which one the caller
{   wants.
{
{ NOTE:
{   The procedure assumes that pft$usage_selections and pft$share_selections
{   are "really" the same type.
{

  PROCEDURE handle_access_mode_or_share
    (    usage_share_value: ^clt$data_value;
         selections_kind: (select_usage, select_share, select_permit);
     VAR usage_share_selections: pft$usage_selections;
     VAR permit_selections: pft$permit_selections;
     VAR status: ost$status);

    VAR
      access_mode_value: clt$keyword,
      local_usage_share_value: ^clt$data_value,
      permit_option: pft$permit_selections;


    usage_share_selections := $pft$usage_selections [];
    permit_selections := $pft$permit_selections [];

    local_usage_share_value := usage_share_value;
    WHILE local_usage_share_value <> NIL DO
      access_mode_value := local_usage_share_value^.element_value^.keyword_value;
      IF access_mode_value = 'ALL' THEN
        IF usage_share_value^.link <> NIL THEN
          IF selections_kind <> select_permit THEN
            osp$set_status_abnormal ('CL', cle$all_must_be_used_alone, access_mode_value, status);
            RETURN; {----->
          IFEND;
        IFEND;
        permit_option := -$pft$permit_selections [pfc$control, pfc$cycle];
        usage_share_selections := -$pft$usage_selections [];
      ELSEIF access_mode_value = 'APPEND' THEN
        permit_option := $pft$permit_selections [pfc$append];
        usage_share_selections := usage_share_selections + $pft$usage_selections [pfc$append];
      ELSEIF access_mode_value = 'CONTROL' THEN
        permit_option := $pft$permit_selections [pfc$control];
      ELSEIF access_mode_value = 'CYCLE' THEN
        permit_option := $pft$permit_selections [pfc$cycle];
      ELSEIF access_mode_value = 'EXECUTE' THEN
        permit_option := $pft$permit_selections [pfc$execute];
        usage_share_selections := usage_share_selections + $pft$usage_selections [pfc$execute];
      ELSEIF access_mode_value = 'MODIFY' THEN
        permit_option := $pft$permit_selections [pfc$modify];
        usage_share_selections := usage_share_selections + $pft$usage_selections [pfc$modify];
      ELSEIF access_mode_value = 'NONE' THEN
        IF usage_share_value^.link <> NIL THEN
          osp$set_status_abnormal ('CL', cle$none_must_be_used_alone, access_mode_value, status);
        IFEND;
        RETURN; {----->
      ELSEIF access_mode_value = 'READ' THEN
        permit_option := $pft$permit_selections [pfc$read];
        usage_share_selections := usage_share_selections + $pft$usage_selections [pfc$read];
      ELSEIF access_mode_value = 'SHORTEN' THEN
        permit_option := $pft$permit_selections [pfc$shorten];
        usage_share_selections := usage_share_selections + $pft$usage_selections [pfc$shorten];
      ELSEIF access_mode_value = 'WRITE' THEN
        permit_option := $pft$permit_selections [pfc$append, pfc$modify, pfc$shorten];
        usage_share_selections := usage_share_selections + $pft$usage_selections
              [pfc$append, pfc$modify, pfc$shorten];
      IFEND;
      IF permit_option <= permit_selections THEN
        osp$set_status_abnormal ('CL', cle$redundancy_in_selections, access_mode_value, status);
        RETURN; {----->
      IFEND;
      permit_selections := permit_selections + permit_option;
      local_usage_share_value := local_usage_share_value^.link;
    WHILEND;

  PROCEND handle_access_mode_or_share;

MODEND clm$permanent_file_commands;
