?? RIGHT := 110 ??
MODULE clm$tape_label_commands;

?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc amc$fap_request_codes
*copyc ame$device_class_validation
*copyc ame$lfn_program_actions
*copyc ame$tape_program_actions
*copyc amt$local_file_name
*copyc amt$term_option
*copyc clt$value
*copyc cle$ecc_parameter_list
*copyc clt$display_control
*copyc clt$work_area
*copyc fme$file_management_errors
*copyc fst$ansi_eof1_label
*copyc fst$ansi_vol1_label
*copyc fst$attachment_option
*copyc fst$tape_attachment_choices
*copyc fst$tape_attachment_information
*copyc fst$tape_label_block_descriptor
*copyc fst$tape_label_sequence_header
*copyc ofe$error_codes
*copyc oss$job_paged_literal
*copyc ost$date
*copyc ost$name
*copyc ost$status
*copyc ost$string
*copyc rme$creblv_errors
*copyc rmt$device_class
?? POP ??

*copyc amv$nil_file_identifier
*copyc avp$removable_media_admin
*copyc bap$fetch_tape_label_attributes
*copyc bap$store_tape_label_attributes
*copyc bap$store_tape_attachment
*copyc clp$close_display
*copyc clp$convert_data_to_string
*copyc clp$convert_date_time_to_string
*copyc clp$convert_string_to_date_time
*copyc clp$convert_string_to_file
*copyc clp$evaluate_parameters
*copyc clp$get_work_area
*copyc clp$make_boolean_value
*copyc clp$make_date_time_value
*copyc clp$make_integer_value
*copyc clp$make_keyword_value
*copyc clp$make_list_value
*copyc clp$make_name_value
*copyc clp$make_record_value
*copyc clp$make_string_value
*copyc clp$make_unspecified_value
*copyc clp$open_display
*copyc clp$put_data_representation
*copyc clp$trimmed_string_size
*copyc clv$nil_display_control
*copyc clv$user_identification
*copyc clv$value_descriptors
*copyc fmv$tape_attachment_information
*copyc fsp$evaluate_file_reference
*copyc fsp$default_tape_label_attrib
*copyc fsp$get_tape_label_attributes
*copyc fsp$locate_tape_label
*copyc fsp$path_element
*copyc fsp$set_evaluated_file_abnormal
*copyc osp$append_status_parameter
*copyc osp$disestablish_cond_handler
*copyc osp$establish_block_exit_hndlr
*copyc osp$generate_message
*copyc osp$set_status_abnormal
*copyc osp$set_status_condition
*copyc pmp$change_legible_date_format
*copyc pmp$compute_date_time
*copyc pmp$get_compact_date_time
*copyc rmp$change_tape_debug_mode_23d
*copyc rmp$validate_ansi_string
*copyc rmp$validate_specified_rmg

?? TITLE := 'Global Declarations Declared by This Module', EJECT ??

  CONST
    max_tape_attachments = fsc$tape_block_count;

  TYPE
    current_tape_attachments = set of fsc$tape_block_type .. max_tape_attachments;

  CONST
    max_block_types_size = 16,
    max_character_sets_size = 13,
    max_file_set_position_size = 24,
    max_record_types_size = 23;

  VAR
    block_types: [STATIC, READ, oss$job_paged_literal] array [amt$block_type] of
          string (max_block_types_size) := ['SYSTEM_SPECIFIED', 'USER_SPECIFIED'],

    character_sets: [STATIC, READ, oss$job_paged_literal] array [amt$internal_code] of
          string (max_character_sets_size)
          := ['A6', 'A8', 'ASCII', 'D64', 'EBCDIC', 'BCD', 'D63',
          'FTAM1 ia5', 'FTAM1 visible', 'FTAM1 graphic', 'FTAM1 general',
          'FTAM2 ia5', 'FTAM2 visible', 'FTAM2 graphic', 'FTAM2 general'],

    file_set_position: [STATIC, READ, oss$job_paged_literal] array [fst$tape_file_set_pos_choices] of
          string (max_file_set_position_size)
          := ['BEGINNING_OF_SET', 'CURRENT_FILE', 'END_OF_SET',
          'FILE_IDENTIFIER_POSITION', 'FILE_SEQUENCE_POSITION', 'NEXT_FILE'],

    record_types: [STATIC, READ, oss$job_paged_literal] array [amt$record_type] of
          string (max_record_types_size)
          := ['VARIABLE', 'UNDEFINED', 'ANSI_FIXED', 'ANSI_SPANNED',
          'ANSI_VARIABLE', 'TRAILING_CHAR_DELIMITED'];

  CONST
    max_displayable_attributes = max_tape_attachments - 1; {removes fsc$tape_null_attachment_option}

  VAR
    tape_attachment_names: [STATIC, READ, oss$job_paged_literal] array [1 .. max_displayable_attributes] OF
      record
        text: ost$name,
        ordinal: fst$tape_attachment_choices,
      recend := [

      ['BLOCK_COUNT                    ', fsc$tape_block_count],
      ['BLOCK_TYPE                     ', fsc$tape_block_type],
      ['BUFFER_OFFSET                  ', fsc$tape_buffer_offset],
      ['CHARACTER_CONVERSION           ', fsc$tape_character_conversion],
      ['CHARACTER_SET                  ', fsc$tape_character_set],
      ['CREATION_DATE                  ', fsc$tape_creation_date],
      ['EXPIRATION_DATE                ', fsc$tape_expiration_date],
      ['FILE_ACCESSIBILITY             ', fsc$tape_file_accessibility],
      ['FILE_IDENTIFIER                ', fsc$tape_file_identifier],
      ['FILE_SECTION_NUMBER            ', fsc$tape_file_section_number],
      ['FILE_SEQUENCE_NUMBER           ', fsc$tape_file_sequence_number],
      ['FILE_SET_IDENTIFIER            ', fsc$tape_file_set_identifier],
      ['FILE_SET_POSITION              ', fsc$tape_file_set_position],
      ['GENERATION_NUMBER              ', fsc$tape_generation_number],
      ['GENERATION_VERSION_NUMBER      ', fsc$tape_generation_version_num],
      ['HEADER_LABELS                  ', fsc$tape_header_labels],
      ['IMPLEMENTATION_IDENTIFIER      ', fsc$tape_implementation_id],
      ['LABEL_STANDARD_VERSION         ', fsc$tape_label_standard_version],
      ['MAXIMUM_BLOCK_LENGTH           ', fsc$tape_max_block_length],
      ['MAXIMUM_RECORD_LENGTH          ', fsc$tape_max_record_length],
      ['OWNER_IDENTIFIER               ', fsc$tape_owner_identification],
      ['PADDING_CHARACTER              ', fsc$tape_padding_character],
      ['RECORD_TYPE                    ', fsc$tape_record_type],
      ['REMOVABLE_MEDIA_GROUP          ', fsc$tape_removable_media_group],
      ['REWRITE_LABELS                 ', fsc$tape_rewrite_labels],
      ['TRAILER_LABELS                 ', fsc$tape_trailer_labels],
      ['VOLUME_ACCESSIBILITY           ', fsc$tape_volume_accessibility]];

?? TITLE := 'PROCEDURE clp$_change_tape_debug_mode', EJECT ??

  PROCEDURE [XDCL, #GATE] clp$_change_tape_debug_mode (
        parameter_list: clt$parameter_list;
    VAR status: ost$status);

{ PROCEDURE change_tape_debug_mode (
{   debug_mode, dm: boolean = $optional
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 3] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [90, 7, 5, 10, 56, 0, 107],
    clc$command, 3, 2, 0, 0, 0, 0, 2, ''], [
    ['DEBUG_MODE                     ',clc$nominal_entry, 1],
    ['DM                             ',clc$abbreviation_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 2]],
    [
{ PARAMETER 1
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0],
{ PARAMETER 2
    [3, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$boolean_type]],
{ PARAMETER 2
    [[1, 0, clc$status_type]]];

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

    CONST
      p$debug_mode = 1,
      p$status = 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;

    IF pvt [p$debug_mode].specified THEN
      rmp$change_tape_debug_mode_23d (pvt [p$debug_mode].value^.boolean_value.value);
    IFEND;

  PROCEND clp$_change_tape_debug_mode;

?? TITLE := 'PROCEDURE clp$display_tape_label_attr_cmd', EJECT ??

  PROCEDURE [XDCL, #GATE] clp$display_tape_label_attr_cmd (
        parameter_list: clt$parameter_list;
    VAR status: ost$status);

{ PROCEDURE display_tape_label_attributes, display_tape_label_attribute, distla (
{   file, f: any of
{       key
{         (system_default_values, system_default_value, sdv)
{       keyend
{       file
{     anyend = $required
{   display_options, display_option, do: any of
{       key
{         all
{       keyend
{       list of key
{         (block_count, bc)
{         (block_type, bt)
{         (buffer_offset, bo)
{         (character_conversion, cc)
{         (character_set, cs)
{         (creation_date, cd)
{         (expiration_date, ed)
{         (file_identifier, fi)
{         (file_sequence_number, fsn)
{         (file_set_identifier, fsi)
{         (file_set_position, fsp)
{         (generation_number, gn)
{         (generation_version_number, gvn)
{         (header_labels, hl)
{         (maximum_block_length, maxbl)
{         (maximum_record_length, maxrl)
{         (padding_character, pc)
{         (record_type, rt)
{         (rewrite_labels, rl)
{         (trailer_labels, tl)
{       advanced_key
{         (file_accessibility, fa, file_accessibility_code, fac)
{         (file_section_number, fsen)
{         (implementation_identifier, ii)
{         (label_standard_version, lsv)
{         (owner_identifier, oi)
{         (removable_media_group, rmg)
{         (volume_accessibility, va)
{       hidden_key
{         (current_file, cf)
{         (next_file, nf)
{         (source, s)
{       keyend
{     anyend = osd$distla_display_options, all
{   output, o: file = $output
{   source, s: (BY_NAME) key
{       (explicit_specification, es)
{       (last_accessed, la)
{       (next_position, np)
{     keyend = next_position
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 10] of clt$pdt_parameter_name,
      parameters: array [1 .. 5] 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 .. 3] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: 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$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 62] of clt$keyword_specification,
          recend,
        recend,
        default_name: string (26),
        default_value: string (3),
      recend,
      type3: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type4: 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,
      type5: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [91, 4, 5, 17, 3, 53, 708],
    clc$command, 10, 5, 1, 0, 0, 0, 5, ''], [
    ['DISPLAY_OPTION                 ',clc$alias_entry, 2],
    ['DISPLAY_OPTIONS                ',clc$nominal_entry, 2],
    ['DO                             ',clc$abbreviation_entry, 2],
    ['F                              ',clc$abbreviation_entry, 1],
    ['FILE                           ',clc$nominal_entry, 1],
    ['O                              ',clc$abbreviation_entry, 3],
    ['OUTPUT                         ',clc$nominal_entry, 3],
    ['S                              ',clc$abbreviation_entry, 4],
    ['SOURCE                         ',clc$nominal_entry, 4],
    ['STATUS                         ',clc$nominal_entry, 5]],
    [
{ 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, 141,
  clc$required_parameter, 0, 0],
{ PARAMETER 2
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 2381,
  clc$optional_default_parameter, 26, 3],
{ PARAMETER 3
    [7, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 7],
{ PARAMETER 4
    [9, 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, 229,
  clc$optional_default_parameter, 0, 13],
{ PARAMETER 5
    [10, 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$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    118, [[1, 0, clc$keyword_type], [3], [
      ['SDV                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['SYSTEM_DEFAULT_VALUE           ', clc$alias_entry, clc$normal_usage_entry, 1],
      ['SYSTEM_DEFAULT_VALUES          ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ],
{ PARAMETER 2
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    2317, [[1, 0, clc$list_type], [2301, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$keyword_type], [62], [
        ['BC                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['BLOCK_COUNT                    ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['BLOCK_TYPE                     ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['BO                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['BT                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['BUFFER_OFFSET                  ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['CC                             ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
        ['CD                             ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
        ['CF                             ', clc$abbreviation_entry, clc$hidden_entry, 28],
        ['CHARACTER_CONVERSION           ', clc$nominal_entry, clc$normal_usage_entry, 4],
        ['CHARACTER_SET                  ', clc$nominal_entry, clc$normal_usage_entry, 5],
        ['CREATION_DATE                  ', clc$nominal_entry, clc$normal_usage_entry, 6],
        ['CS                             ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
        ['CURRENT_FILE                   ', clc$nominal_entry, clc$hidden_entry, 28],
        ['ED                             ', clc$abbreviation_entry, clc$normal_usage_entry, 7],
        ['EXPIRATION_DATE                ', clc$nominal_entry, clc$normal_usage_entry, 7],
        ['FA                             ', clc$alias_entry, clc$advanced_usage_entry, 21],
        ['FAC                            ', clc$abbreviation_entry, clc$advanced_usage_entry, 21],
        ['FI                             ', clc$abbreviation_entry, clc$normal_usage_entry, 8],
        ['FILE_ACCESSIBILITY             ', clc$nominal_entry, clc$advanced_usage_entry, 21],
        ['FILE_ACCESSIBILITY_CODE        ', clc$alias_entry, clc$advanced_usage_entry, 21],
        ['FILE_IDENTIFIER                ', clc$nominal_entry, clc$normal_usage_entry, 8],
        ['FILE_SECTION_NUMBER            ', clc$nominal_entry, clc$advanced_usage_entry, 22],
        ['FILE_SEQUENCE_NUMBER           ', clc$nominal_entry, clc$normal_usage_entry, 9],
        ['FILE_SET_IDENTIFIER            ', clc$nominal_entry, clc$normal_usage_entry, 10],
        ['FILE_SET_POSITION              ', clc$nominal_entry, clc$normal_usage_entry, 11],
        ['FSEN                           ', clc$abbreviation_entry, clc$advanced_usage_entry, 22],
        ['FSI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 10],
        ['FSN                            ', clc$abbreviation_entry, clc$normal_usage_entry, 9],
        ['FSP                            ', clc$abbreviation_entry, clc$normal_usage_entry, 11],
        ['GENERATION_NUMBER              ', clc$nominal_entry, clc$normal_usage_entry, 12],
        ['GENERATION_VERSION_NUMBER      ', clc$nominal_entry, clc$normal_usage_entry, 13],
        ['GN                             ', clc$abbreviation_entry, clc$normal_usage_entry, 12],
        ['GVN                            ', clc$abbreviation_entry, clc$normal_usage_entry, 13],
        ['HEADER_LABELS                  ', clc$nominal_entry, clc$normal_usage_entry, 14],
        ['HL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 14],
        ['II                             ', clc$abbreviation_entry, clc$advanced_usage_entry, 23],
        ['IMPLEMENTATION_IDENTIFIER      ', clc$nominal_entry, clc$advanced_usage_entry, 23],
        ['LABEL_STANDARD_VERSION         ', clc$nominal_entry, clc$advanced_usage_entry, 24],
        ['LSV                            ', clc$abbreviation_entry, clc$advanced_usage_entry, 24],
        ['MAXBL                          ', clc$abbreviation_entry, clc$normal_usage_entry, 15],
        ['MAXIMUM_BLOCK_LENGTH           ', clc$nominal_entry, clc$normal_usage_entry, 15],
        ['MAXIMUM_RECORD_LENGTH          ', clc$nominal_entry, clc$normal_usage_entry, 16],
        ['MAXRL                          ', clc$abbreviation_entry, clc$normal_usage_entry, 16],
        ['NEXT_FILE                      ', clc$nominal_entry, clc$hidden_entry, 29],
        ['NF                             ', clc$abbreviation_entry, clc$hidden_entry, 29],
        ['OI                             ', clc$abbreviation_entry, clc$advanced_usage_entry, 25],
        ['OWNER_IDENTIFIER               ', clc$nominal_entry, clc$advanced_usage_entry, 25],
        ['PADDING_CHARACTER              ', clc$nominal_entry, clc$normal_usage_entry, 17],
        ['PC                             ', clc$abbreviation_entry, clc$normal_usage_entry, 17],
        ['RECORD_TYPE                    ', clc$nominal_entry, clc$normal_usage_entry, 18],
        ['REMOVABLE_MEDIA_GROUP          ', clc$nominal_entry, clc$advanced_usage_entry, 26],
        ['REWRITE_LABELS                 ', clc$nominal_entry, clc$normal_usage_entry, 19],
        ['RL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 19],
        ['RMG                            ', clc$abbreviation_entry, clc$advanced_usage_entry, 26],
        ['RT                             ', clc$abbreviation_entry, clc$normal_usage_entry, 18],
        ['S                              ', clc$abbreviation_entry, clc$hidden_entry, 30],
        ['SOURCE                         ', clc$nominal_entry, clc$hidden_entry, 30],
        ['TL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 20],
        ['TRAILER_LABELS                 ', clc$nominal_entry, clc$normal_usage_entry, 20],
        ['VA                             ', clc$abbreviation_entry, clc$advanced_usage_entry, 27],
        ['VOLUME_ACCESSIBILITY           ', clc$nominal_entry, clc$advanced_usage_entry, 27]]
        ]
      ]
    ,
    'OSD$DISTLA_DISPLAY_OPTIONS',
    'all'],
{ PARAMETER 3
    [[1, 0, clc$file_type],
    '$output'],
{ PARAMETER 4
    [[1, 0, clc$keyword_type], [6], [
    ['ES                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['EXPLICIT_SPECIFICATION         ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['LA                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['LAST_ACCESSED                  ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['NEXT_POSITION                  ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['NP                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3]]
    ,
    'next_position'],
{ PARAMETER 5
    [[1, 0, clc$status_type]]];

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

    CONST
      p$file = 1,
      p$display_options = 2,
      p$output = 3,
      p$source = 4,
      p$status = 5;

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

?? NEWTITLE := 'PROCEDURE abort_handler', EJECT ??

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

      VAR
        ignore_status: ost$status;

      clp$close_display (display_control, ignore_status);

    PROCEND abort_handler;

?? TITLE := 'PROCEDURE put_subtitle', EJECT ??
{ The following XREFs are required by clp$put_path_subtitle and should be
{ copyc'd in that deck but are not.

*copyc clp$build_path_subtitle
*copyc clp$horizontal_tab_display
*copyc clp$get_path_name
*copyc clp$put_partial_display

*copyc clp$put_path_subtitle
*copyc clv$display_variables

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

      clv$subtitles_built := FALSE;
      clp$put_path_subtitle (output_file, 'FILE', status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

    PROCEND put_subtitle;

{ The following XREFs are required by clp$new_page_procedure and should be
{ copyc'd in that deck but are not.

*copyc clp$build_standard_title
*copyc clp$convert_integer_to_string
*copyc clp$new_display_line
*copyc clp$put_display
*copyc clp$reset_for_next_display_page

*copy clp$new_page_procedure
?? OLDTITLE, EJECT ??

 {  Begin main procedure  }

    VAR
      attributes: array [1 .. max_tape_attachments] of fst$attachment_option,
      attributes_requested: current_tape_attachments,
      current_file_selected: boolean,
      current_option: ^clt$data_value,
      data_representation: ^clt$data_representation,
      display_control: clt$display_control,
      local_status: ost$status,
      next_file_selected: boolean,
      number_of_attributes_requested: ost$non_negative_integers,
      output_file: clt$file,
      result: ^clt$data_value,
      returned_attributes: fst$tla_returned_attributes,
      source: fst$tape_attribute_source,
      source_selected: boolean,
      tape_attachment_choice: fst$tape_attachment_choices,
      work_area: ^^clt$work_area;

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

    current_file_selected := FALSE;
    next_file_selected := FALSE;
    source_selected:= FALSE;

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

    attributes_requested := $current_tape_attachments [];

    current_option := pvt [p$display_options].value;

    IF current_option^.kind = clc$keyword THEN { ALL selected }
      enforce_security (number_of_attributes_requested, attributes_requested);
    ELSE
      number_of_attributes_requested := 0;
      WHILE current_option <> NIL DO
        IF (current_option^.element_value^.keyword_value = 'CURRENT_FILE') THEN
          current_file_selected := TRUE;
        ELSEIF (current_option^.element_value^.keyword_value = 'NEXT_FILE') THEN
          next_file_selected := TRUE;
        ELSEIF (current_option^.element_value^.keyword_value = 'SOURCE') THEN
          source_selected := TRUE;
        ELSE
          get_tape_attachment_choice (current_option^.element_value^.keyword_value, tape_attachment_choice);
          IF NOT (tape_attachment_choice IN attributes_requested) THEN
            attributes_requested := attributes_requested +
                  $current_tape_attachments [tape_attachment_choice];
            number_of_attributes_requested := number_of_attributes_requested + 1;
          IFEND;
        IFEND;
        current_option := current_option^.link;
      WHILEND;

      IF (source_selected OR current_file_selected OR next_file_selected) AND
            (attributes_requested = $current_tape_attachments []) THEN
        enforce_security (number_of_attributes_requested, attributes_requested);
      IFEND;
    IFEND;

    IF number_of_attributes_requested = 0 THEN
      RETURN;
    IFEND;

    FOR tape_attachment_choice := 1 TO max_tape_attachments DO
      IF tape_attachment_choice IN attributes_requested THEN
        attributes [tape_attachment_choice].selector := fsc$tape_attachment;
        attributes [tape_attachment_choice].tape_attachment.selector := tape_attachment_choice;
      ELSE
        attributes [tape_attachment_choice].selector := fsc$null_attachment_option;
      IFEND;
    FOREND;

    IF fsc$tape_header_labels IN attributes_requested THEN
      PUSH attributes [fsc$tape_header_labels].tape_attachment.tape_header_labels:
            [[REP 1 OF fst$tape_label_sequence_header, REP (fsc$max_tape_labels *
            (#SIZE (fst$tape_label_block_descriptor) + fsc$max_tape_label_length)) OF cell]];
    IFEND;
    IF fsc$tape_trailer_labels IN attributes_requested THEN
      PUSH attributes [fsc$tape_trailer_labels].tape_attachment.tape_trailer_labels:
            [[REP 1 OF fst$tape_label_sequence_header, REP (fsc$max_tape_labels *
            (#SIZE (fst$tape_label_block_descriptor) + fsc$max_tape_label_length)) OF cell]];
    IFEND;

    IF pvt [p$file].value^.kind = clc$keyword THEN { system_default_values }
      fsp$default_tape_label_attrib (fsc$tla_system_default, attributes, returned_attributes, status);
    ELSE
      IF (pvt [p$source].value^.keyword_value = 'LAST_ACCESSED') OR current_file_selected THEN
        source := fsc$tla_last_ansi_file_accessed;
      ELSEIF (pvt [p$source].value^.keyword_value = 'NEXT_POSITION') OR next_file_selected THEN
        source := fsc$tla_next_position;
      ELSE
        source := fsc$tla_explicit_specification;
      IFEND;
      fsp$get_tape_label_attributes (pvt [p$file].value^.file_value^, source, attributes,
            returned_attributes, status);
    IFEND;
    IF NOT status.normal THEN
      RETURN;
    IFEND;

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

    clp$make_record_value (number_of_attributes_requested, work_area^, result);

    build_display_record (attributes, attributes_requested, returned_attributes, work_area^, result,
          status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    display_control := clv$nil_display_control;
    #spoil (display_control);
    osp$establish_block_exit_hndlr (^abort_handler);

    clp$convert_string_to_file (pvt [p$output].value^.file_value^, output_file, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  /form_display/
    BEGIN
      clp$open_display (output_file, ^clp$new_page_procedure, display_control, status);
      IF NOT status.normal THEN
        EXIT /form_display/;
      IFEND;
      clv$titles_built := FALSE;
      clv$subtitles_built := FALSE;
      clv$command_name := 'display_tape_label_attributes';

      IF display_control.page_width < clc$narrow_page_width THEN
        clv$page_width := clc$narrow_page_width;
      ELSEIF display_control.page_width > clc$wide_page_width THEN
        clv$page_width := clc$wide_page_width;
      ELSE
        clv$page_width := display_control.page_width;
      IFEND;

      clp$convert_data_to_string (result, clc$labeled_elem_representation, clv$page_width, work_area^,
            data_representation, status);
      IF NOT status.normal THEN
        EXIT /form_display/;
      IFEND;

      clp$put_data_representation (display_control, data_representation, status);
      IF NOT status.normal THEN
        EXIT /form_display/;
      IFEND;
    END /form_display/;

    IF display_control.file_id <> amv$nil_file_identifier THEN
      clp$close_display (display_control, local_status);
      IF status.normal AND NOT local_status.normal THEN
        status := local_status;
      IFEND;
    IFEND;

    osp$disestablish_cond_handler;

  PROCEND clp$display_tape_label_attr_cmd;

?? TITLE := 'PROCEDURE clp$change_tape_label_attr_cmd', EJECT ??
  PROCEDURE [XDCL, #GATE] clp$change_tape_label_attr_cmd (
        parameter_list: clt$parameter_list;
    VAR status: ost$status);

{ PROCEDURE (osm$chatla) change_tape_label_attribute, change_tape_label_attributes, chatla (
{   file, f: file = $required
{   block_type, bt: (BY_NAME) key
{       $unspecified
{       (system_specified, ss)
{       (user_specified, us)
{     keyend = $optional
{   character_conversion, cc: (BY_NAME) any of
{       key
{         $unspecified
{       keyend
{       boolean
{     anyend = $optional
{   character_set, ic, internal_code, cs: (BY_NAME) key
{       $unspecified
{       (ascii, a)
{       (ebcdic, e)
{     keyend = $optional
{   creation_date, cd: (BY_NAME) any of
{       key
{         $unspecified
{       keyend
{       date
{     anyend = $optional
{   expiration_date, ed: (BY_NAME) any of
{       key
{         $unspecified
{         (expired, e)
{       keyend
{       date
{       time_increment
{     anyend = $optional
{   file_accessibility, fac, file_accessibility_code, fa: (BY_NAME, ADVANCED, SECURE) any of
{       key
{         $unspecified, none
{       keyend
{       string 1
{       name 1..1
{     anyend = $optional
{   file_identifier, fi: (BY_NAME) any of
{       key
{         $unspecified
{       keyend
{       string 1..17
{       name 1..17
{     anyend = $optional
{   file_sequence_number, fsn: (BY_NAME, HIDDEN) integer 1..9999 = $optional
{   file_set_identifier, fsi: (BY_NAME) any of
{       key
{         $unspecified
{       keyend
{       string 1..6
{       name 1..6
{     anyend = $optional
{   file_set_position, fsp: (BY_NAME) any of
{       key
{         $unspecified
{         (beginning_of_set, bos)
{         (current_file, cf)
{         (end_of_set, eos)
{         (next_file, nf)
{       keyend
{       record
{         method: key
{           (file_identifier_position, fip)
{         keyend
{         file_identifier: any of
{           string 1..17
{           name 1..17
{         anyend = $optional
{         generation_number: integer 1..9999 = $optional
{       recend
{       record
{         method: key
{           (file_sequence_position, fsp)
{         keyend
{         file_sequence_number: integer 1..9999 = $optional
{       recend
{     anyend = $optional
{   generation_number, gn: (BY_NAME) any of
{       key
{         $unspecified
{       keyend
{       integer 1..9999
{     anyend = $optional
{   generation_version_number, gvn: (BY_NAME) any of
{       key
{         $unspecified
{       keyend
{       integer 0..99
{     anyend = $optional
{   maximum_block_length, maxbl: (BY_NAME) any of
{       key
{         $unspecified
{       keyend
{       integer 1..2147483615
{     anyend = $optional
{   maximum_record_length, maxrl: (BY_NAME) any of
{       key
{         $unspecified
{       keyend
{       integer 0..4398046511103
{     anyend = $optional
{   owner_identifier, oi: (BY_NAME, ADVANCED, SECURE) any of
{       key
{         $unspecified, none
{       keyend
{       string 1..14
{       name 1..14
{     anyend = $optional
{   padding_character, pc: (BY_NAME) any of
{       key
{         $unspecified
{       keyend
{       string 1
{       name 1..1
{     anyend = $optional
{   record_type, rt: (BY_NAME) key
{       $unspecified
{       (ansi_fixed, f, fixed, af)
{       (ansi_spanned, s, as)
{       (ansi_variable, d, av)
{       (undefined, u)
{       (variable, v)
{     keyend = $optional
{   removable_media_group, rmg: (BY_NAME, ADVANCED, SECURE) any of
{       key
{         $unspecified
{       keyend
{       name 1..13
{     anyend = $optional
{   rewrite_labels, rl: (BY_NAME) any of
{       key
{         $unspecified
{       keyend
{       boolean
{     anyend = $optional
{   volume_accessibility, va: (BY_NAME, ADVANCED, SECURE) any of
{       key
{         $unspecified, none
{       keyend
{       string 1
{       name 1..1
{     anyend = $optional
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 47] of clt$pdt_parameter_name,
      parameters: array [1 .. 22] 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 .. 5] of clt$keyword_specification,
      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,
        recend,
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 5] of clt$keyword_specification,
      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$date_time_type_qualifier,
        recend,
      recend,
      type6: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 3] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$date_time_type_qualifier,
        recend,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
        recend,
      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$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type8: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type9: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type10: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      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 .. 9] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$record_type_qualifier,
          field_spec_1: clt$field_specification,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 2] of clt$keyword_specification,
          recend,
          field_spec_2: clt$field_specification,
          element_type_spec_2: 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,
          field_spec_3: clt$field_specification,
          element_type_spec_3: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
        recend,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$record_type_qualifier,
          field_spec_1: clt$field_specification,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 2] of clt$keyword_specification,
          recend,
          field_spec_2: clt$field_specification,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
        recend,
      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$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      type13: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      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$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      type15: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      type16: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type17: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type18: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 15] of clt$keyword_specification,
      recend,
      type19: 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,
      type20: 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,
      type21: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type22: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [91, 10, 30, 9, 43, 47, 221],
    clc$command, 47, 22, 1, 4, 1, 0, 22, 'OSM$CHATLA'], [
    ['BLOCK_TYPE                     ',clc$nominal_entry, 2],
    ['BT                             ',clc$abbreviation_entry, 2],
    ['CC                             ',clc$abbreviation_entry, 3],
    ['CD                             ',clc$abbreviation_entry, 5],
    ['CHARACTER_CONVERSION           ',clc$nominal_entry, 3],
    ['CHARACTER_SET                  ',clc$nominal_entry, 4],
    ['CREATION_DATE                  ',clc$nominal_entry, 5],
    ['CS                             ',clc$abbreviation_entry, 4],
    ['ED                             ',clc$abbreviation_entry, 6],
    ['EXPIRATION_DATE                ',clc$nominal_entry, 6],
    ['F                              ',clc$abbreviation_entry, 1],
    ['FA                             ',clc$abbreviation_entry, 7],
    ['FAC                            ',clc$alias_entry, 7],
    ['FI                             ',clc$abbreviation_entry, 8],
    ['FILE                           ',clc$nominal_entry, 1],
    ['FILE_ACCESSIBILITY             ',clc$nominal_entry, 7],
    ['FILE_ACCESSIBILITY_CODE        ',clc$alias_entry, 7],
    ['FILE_IDENTIFIER                ',clc$nominal_entry, 8],
    ['FILE_SEQUENCE_NUMBER           ',clc$nominal_entry, 9],
    ['FILE_SET_IDENTIFIER            ',clc$nominal_entry, 10],
    ['FILE_SET_POSITION              ',clc$nominal_entry, 11],
    ['FSI                            ',clc$abbreviation_entry, 10],
    ['FSN                            ',clc$abbreviation_entry, 9],
    ['FSP                            ',clc$abbreviation_entry, 11],
    ['GENERATION_NUMBER              ',clc$nominal_entry, 12],
    ['GENERATION_VERSION_NUMBER      ',clc$nominal_entry, 13],
    ['GN                             ',clc$abbreviation_entry, 12],
    ['GVN                            ',clc$abbreviation_entry, 13],
    ['IC                             ',clc$alias_entry, 4],
    ['INTERNAL_CODE                  ',clc$alias_entry, 4],
    ['MAXBL                          ',clc$abbreviation_entry, 14],
    ['MAXIMUM_BLOCK_LENGTH           ',clc$nominal_entry, 14],
    ['MAXIMUM_RECORD_LENGTH          ',clc$nominal_entry, 15],
    ['MAXRL                          ',clc$abbreviation_entry, 15],
    ['OI                             ',clc$abbreviation_entry, 16],
    ['OWNER_IDENTIFIER               ',clc$nominal_entry, 16],
    ['PADDING_CHARACTER              ',clc$nominal_entry, 17],
    ['PC                             ',clc$abbreviation_entry, 17],
    ['RECORD_TYPE                    ',clc$nominal_entry, 18],
    ['REMOVABLE_MEDIA_GROUP          ',clc$nominal_entry, 19],
    ['REWRITE_LABELS                 ',clc$nominal_entry, 20],
    ['RL                             ',clc$abbreviation_entry, 20],
    ['RMG                            ',clc$abbreviation_entry, 19],
    ['RT                             ',clc$abbreviation_entry, 18],
    ['STATUS                         ',clc$nominal_entry, 22],
    ['VA                             ',clc$abbreviation_entry, 21],
    ['VOLUME_ACCESSIBILITY           ',clc$nominal_entry, 21]],
    [
{ 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
    [1, 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, 192,
  clc$optional_parameter, 0, 0],
{ PARAMETER 3
    [5, 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, 67, clc$optional_parameter,
  0, 0],
{ PARAMETER 4
    [6, 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, 192,
  clc$optional_parameter, 0, 0],
{ PARAMETER 5
    [7, 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, 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$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 150,
  clc$optional_parameter, 0, 0],
{ PARAMETER 7
    [16, clc$advanced_usage_entry, clc$secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 118,
  clc$optional_parameter, 0, 0],
{ PARAMETER 8
    [18, 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, 81, clc$optional_parameter,
  0, 0],
{ PARAMETER 9
    [19, clc$hidden_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 10
    [20, 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, 81, clc$optional_parameter,
  0, 0],
{ PARAMETER 11
    [21, 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, 793,
  clc$optional_parameter, 0, 0],
{ PARAMETER 12
    [25, 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, 84, clc$optional_parameter,
  0, 0],
{ PARAMETER 13
    [26, 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, 84, clc$optional_parameter,
  0, 0],
{ PARAMETER 14
    [32, 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, 84, clc$optional_parameter,
  0, 0],
{ PARAMETER 15
    [33, 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, 84, clc$optional_parameter,
  0, 0],
{ PARAMETER 16
    [36, clc$advanced_usage_entry, clc$secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 118,
  clc$optional_parameter, 0, 0],
{ PARAMETER 17
    [37, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 81, clc$optional_parameter,
  0, 0],
{ PARAMETER 18
    [39, 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, 562,
  clc$optional_parameter, 0, 0],
{ PARAMETER 19
    [40, clc$advanced_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_parameter,
  0, 0],
{ PARAMETER 20
    [41, 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, 67, clc$optional_parameter,
  0, 0],
{ PARAMETER 21
    [47, clc$advanced_usage_entry, clc$secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 118,
  clc$optional_parameter, 0, 0],
{ PARAMETER 22
    [45, 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], [5], [
    ['$UNSPECIFIED                   ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['SS                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['SYSTEM_SPECIFIED               ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['US                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['USER_SPECIFIED                 ', clc$nominal_entry, clc$normal_usage_entry, 3]]
    ],
{ PARAMETER 3
    [[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]]
    ],
{ PARAMETER 4
    [[1, 0, clc$keyword_type], [5], [
    ['$UNSPECIFIED                   ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['ASCII                          ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['E                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['EBCDIC                         ', clc$nominal_entry, clc$normal_usage_entry, 3]]
    ],
{ PARAMETER 5
    [[1, 0, clc$union_type], [[clc$date_time_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['$UNSPECIFIED                   ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    5, [[1, 0, clc$date_time_type], [$clt$date_and_or_time [clc$date], $clt$date_time_tenses [clc$past,
  clc$present, clc$future]]]
    ],
{ PARAMETER 6
    [[1, 0, clc$union_type], [[clc$date_time_type, clc$keyword_type, clc$time_increment_type],
    FALSE, 3],
    118, [[1, 0, clc$keyword_type], [3], [
      ['$UNSPECIFIED                   ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['E                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['EXPIRED                        ', clc$nominal_entry, clc$normal_usage_entry, 2]]
      ],
    5, [[1, 0, clc$date_time_type], [$clt$date_and_or_time [clc$date], $clt$date_time_tenses [clc$past,
  clc$present, clc$future]]],
    3, [[1, 0, clc$time_increment_type]]
    ],
{ PARAMETER 7
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type, clc$string_type],
    FALSE, 3],
    81, [[1, 0, clc$keyword_type], [2], [
      ['$UNSPECIFIED                   ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 2]]
      ],
    8, [[1, 0, clc$string_type], [1, 1, FALSE]],
    5, [[1, 0, clc$name_type], [1, 1]]
    ],
{ PARAMETER 8
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type, clc$string_type],
    FALSE, 3],
    44, [[1, 0, clc$keyword_type], [1], [
      ['$UNSPECIFIED                   ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    8, [[1, 0, clc$string_type], [1, 17, FALSE]],
    5, [[1, 0, clc$name_type], [1, 17]]
    ],
{ PARAMETER 9
    [[1, 0, clc$integer_type], [1, 9999, 10]],
{ PARAMETER 10
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type, clc$string_type],
    FALSE, 3],
    44, [[1, 0, clc$keyword_type], [1], [
      ['$UNSPECIFIED                   ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    8, [[1, 0, clc$string_type], [1, 6, FALSE]],
    5, [[1, 0, clc$name_type], [1, 6]]
    ],
{ PARAMETER 11
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$record_type],
    FALSE, 3],
    340, [[1, 0, clc$keyword_type], [9], [
      ['$UNSPECIFIED                   ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['BEGINNING_OF_SET               ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['BOS                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['CF                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['CURRENT_FILE                   ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['END_OF_SET                     ', clc$nominal_entry, clc$normal_usage_entry, 4],
      ['EOS                            ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['NEXT_FILE                      ', clc$nominal_entry, clc$normal_usage_entry, 5],
      ['NF                             ', clc$abbreviation_entry, clc$normal_usage_entry, 5]]
      ],
    249, [[1, 0, clc$record_type], [3],
      ['METHOD                         ', clc$required_field, 81], [[1, 0, clc$keyword_type], [2], [
        ['FILE_IDENTIFIER_POSITION       ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['FIP                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1]]
        ],
      ['FILE_IDENTIFIER                ', clc$optional_field, 33], [[1, 0, clc$union_type], [[
        clc$name_type, clc$string_type],
        TRUE, 2],
        8, [[1, 0, clc$string_type], [1, 17, FALSE]],
        5, [[1, 0, clc$name_type], [1, 17]]
        ],
      ['GENERATION_NUMBER              ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1, 9999, 10]]
      ],
    180, [[1, 0, clc$record_type], [2],
      ['METHOD                         ', clc$required_field, 81], [[1, 0, clc$keyword_type], [2], [
        ['FILE_SEQUENCE_POSITION         ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['FSP                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1]]
        ],
      ['FILE_SEQUENCE_NUMBER           ', clc$optional_field, 20], [[1, 0, clc$integer_type], [1, 9999, 10]]
      ]
    ],
{ PARAMETER 12
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['$UNSPECIFIED                   ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [1, 9999, 10]]
    ],
{ PARAMETER 13
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['$UNSPECIFIED                   ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [0, 99, 10]]
    ],
{ PARAMETER 14
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['$UNSPECIFIED                   ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [1, 2147483615, 10]]
    ],
{ PARAMETER 15
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['$UNSPECIFIED                   ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [0, 4398046511103, 10]]
    ],
{ PARAMETER 16
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type, clc$string_type],
    FALSE, 3],
    81, [[1, 0, clc$keyword_type], [2], [
      ['$UNSPECIFIED                   ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 2]]
      ],
    8, [[1, 0, clc$string_type], [1, 14, FALSE]],
    5, [[1, 0, clc$name_type], [1, 14]]
    ],
{ PARAMETER 17
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type, clc$string_type],
    FALSE, 3],
    44, [[1, 0, clc$keyword_type], [1], [
      ['$UNSPECIFIED                   ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    8, [[1, 0, clc$string_type], [1, 1, FALSE]],
    5, [[1, 0, clc$name_type], [1, 1]]
    ],
{ PARAMETER 18
    [[1, 0, clc$keyword_type], [15], [
    ['$UNSPECIFIED                   ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['AF                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['ANSI_FIXED                     ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['ANSI_SPANNED                   ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['ANSI_VARIABLE                  ', clc$nominal_entry, clc$normal_usage_entry, 4],
    ['AS                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['AV                             ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
    ['D                              ', clc$alias_entry, clc$normal_usage_entry, 4],
    ['F                              ', clc$alias_entry, clc$normal_usage_entry, 2],
    ['FIXED                          ', clc$alias_entry, clc$normal_usage_entry, 2],
    ['S                              ', clc$alias_entry, clc$normal_usage_entry, 3],
    ['U                              ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
    ['UNDEFINED                      ', clc$nominal_entry, clc$normal_usage_entry, 5],
    ['V                              ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
    ['VARIABLE                       ', clc$nominal_entry, clc$normal_usage_entry, 6]]
    ],
{ PARAMETER 19
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['$UNSPECIFIED                   ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    5, [[1, 0, clc$name_type], [1, 13]]
    ],
{ PARAMETER 20
    [[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]]
    ],
{ PARAMETER 21
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type, clc$string_type],
    FALSE, 3],
    81, [[1, 0, clc$keyword_type], [2], [
      ['$UNSPECIFIED                   ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 2]]
      ],
    8, [[1, 0, clc$string_type], [1, 1, FALSE]],
    5, [[1, 0, clc$name_type], [1, 1]]
    ],
{ PARAMETER 22
    [[1, 0, clc$status_type]]];

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

    CONST
      p$file = 1,
      p$block_type = 2,
      p$character_conversion = 3,
      p$character_set = 4,
      p$creation_date = 5,
      p$expiration_date = 6,
      p$file_accessibility = 7,
      p$file_identifier = 8,
      p$file_sequence_number = 9,
      p$file_set_identifier = 10,
      p$file_set_position = 11,
      p$generation_number = 12,
      p$generation_version_number = 13,
      p$maximum_block_length = 14,
      p$maximum_record_length = 15,
      p$owner_identifier = 16,
      p$padding_character = 17,
      p$record_type = 18,
      p$removable_media_group = 19,
      p$rewrite_labels = 20,
      p$volume_accessibility = 21,
      p$status = 22;

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

    VAR
      attachment_option_keys: [STATIC, READ, oss$job_paged_literal] array
            [p$block_type .. p$volume_accessibility] of fst$tape_attachment_choices :=
        [fsc$tape_block_type,
         fsc$tape_character_conversion,
         fsc$tape_character_set,
         fsc$tape_creation_date,
         fsc$tape_expiration_date,
         fsc$tape_file_accessibility,
         fsc$tape_file_identifier,
         fsc$tape_file_sequence_number,
         fsc$tape_file_set_identifier,
         fsc$tape_file_set_position,
         fsc$tape_generation_number,
         fsc$tape_generation_version_num,
         fsc$tape_max_block_length,
         fsc$tape_max_record_length,
         fsc$tape_owner_identification,
         fsc$tape_padding_character,
         fsc$tape_record_type,
         fsc$tape_removable_media_group,
         fsc$tape_rewrite_labels,
         fsc$tape_volume_accessibility];

?? NEWTITLE := 'validate_tape_attachments', EJECT ??
    PROCEDURE validate_tape_attachments
      (VAR status: ost$status);

      VAR
        file_set_position: [STATIC, READ, oss$job_paged_literal] array
              [fsc$tape_beginning_of_set .. fsc$tape_next_file] of ost$name :=
          ['BEGINNING_OF_SET',
           'CURRENT_FILE',
           'END_OF_SET',
           'FILE_IDENTIFIER_POSITION',
           'FILE_SEQUENCE_POSITION',
           'NEXT_FILE'];

      VAR
        authorized_access: fst$file_access_options,
        local_status: ost$status,
        message_status: ost$status,
        temp_attachments: fst$tape_attachment_information;

      status.normal := TRUE;

      bap$fetch_tape_label_attributes (evaluated_file_reference, temp_attachments, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      {  Merge old and new tape attachment values into temp_attachments  }

      bap$store_tape_attachment (attachment_options, fsc$tape_label_attr_command, ^temp_attachments,  status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      bap$store_tape_attachment (undo_options, fsc$tape_label_attr_default, ^temp_attachments,  status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      IF NOT temp_attachments.rewrite_labels THEN
        IF specified [fsc$tape_file_identifier] AND specified [fsc$tape_file_set_position] AND
              (attachment_options [fsc$tape_file_set_position].tape_attachment.tape_file_set_position.position
              = fsc$tape_file_identifier_pos) AND (fsc$fsp_file_identifier IN supplied_file_set_pos_fields)
              AND (attachment_options [fsc$tape_file_identifier].tape_attachment.tape_file_identifier <>
              attachment_options [fsc$tape_file_set_position].tape_attachment.tape_file_set_position.
              file_identifier) THEN
          attachment_options [fsc$tape_file_identifier].tape_attachment.selector :=
                fsc$tape_null_attachment_option;
          fsp$set_evaluated_file_abnormal (evaluated_file_reference, ame$file_identifier_ignored,
                fmc$change_tape_label_attr_cmd, '', message_status);
          osp$generate_message (message_status, local_status);
        IFEND;
        IF specified [fsc$tape_generation_number] AND specified [fsc$tape_file_set_position] AND
              (attachment_options [fsc$tape_file_set_position].tape_attachment.tape_file_set_position.position
              = fsc$tape_file_identifier_pos) AND (fsc$fsp_generation_number IN supplied_file_set_pos_fields)
              AND (attachment_options [fsc$tape_generation_number].tape_attachment.tape_generation_number <>
              attachment_options [fsc$tape_file_set_position].tape_attachment.tape_file_set_position.
              generation_number) THEN
          attachment_options [fsc$tape_generation_number].tape_attachment.selector :=
                fsc$tape_null_attachment_option;
          fsp$set_evaluated_file_abnormal (evaluated_file_reference, ame$generation_number_ignored,
                fmc$change_tape_label_attr_cmd, '', message_status);
          osp$generate_message (message_status, local_status);
        IFEND;
      IFEND;

      IF temp_attachments.file_set_position.position <> fsc$tape_file_sequence_pos THEN
        IF specified [fsc$tape_file_sequence_number] THEN
          attachment_options [fsc$tape_file_sequence_number].tape_attachment.selector :=
                fsc$tape_null_attachment_option;
          fsp$set_evaluated_file_abnormal (evaluated_file_reference,
                ame$file_seq_number_ignored, fmc$change_tape_label_attr_cmd, '', message_status);
          osp$generate_message (message_status, local_status);
        IFEND;
      IFEND;

      IF specified [fsc$tape_owner_identification] AND (specified [fsc$tape_removable_media_group] OR
            (temp_attachments.removable_media_group_source <> fsc$tape_label_attr_default)) THEN
        osp$set_status_condition (rme$ambiguous_specifications, status);
        RETURN;
      IFEND;

      IF specified [fsc$tape_removable_media_group] THEN
        IF temp_attachments.owner_identifier_source = fsc$tape_label_attr_default THEN
          rmp$validate_specified_rmg (evaluated_file_reference,
                attachment_options [fsc$tape_removable_media_group].tape_attachment.
                tape_removable_media_group, authorized_access, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
        ELSE
          osp$set_status_condition (rme$ambiguous_specifications, status);
          RETURN;
        IFEND;
      IFEND;

      IF specified [fsc$tape_block_type] OR specified [fsc$tape_record_type] OR
            (undo_options [fsc$tape_block_type].tape_attachment.selector = fsc$tape_block_type) OR
            (undo_options [fsc$tape_record_type].tape_attachment.selector = fsc$tape_record_type) THEN
        IF temp_attachments.block_type = amc$system_specified THEN
          IF temp_attachments.record_type = amc$ansi_fixed THEN
            fsp$set_evaluated_file_abnormal (evaluated_file_reference,
                 ame$unsupported_tape_bt_rt, fmc$change_tape_label_attr_cmd,
                'Block type SYSTEM_SPECIFIED (SS), record type FIXED (F)', status);
            RETURN;
          ELSEIF temp_attachments.record_type = amc$ansi_variable THEN
            fsp$set_evaluated_file_abnormal (evaluated_file_reference,
                 ame$unsupported_tape_bt_rt, fmc$change_tape_label_attr_cmd,
                 'Block type SYSTEM_SPECIFIED (SS), record type ANSI_VARIABLE (D)', status);
            RETURN;
          ELSEIF temp_attachments.record_type = amc$ansi_spanned THEN
            fsp$set_evaluated_file_abnormal (evaluated_file_reference,
                 ame$unsupported_tape_bt_rt, fmc$change_tape_label_attr_cmd,
                 'Block type SYSTEM_SPECIFIED (SS), record type ANSI_SPANNED (S)', status);
            RETURN;
          IFEND;
        IFEND;
      IFEND;

    PROCEND validate_tape_attachments;
?? OLDTITLE, EJECT ??

 {  Begin main procedure  }

    VAR
      attachment_options: array [1 .. max_tape_attachments] of fst$attachment_option,
      current_date: ost$date_time,
      date_string: ost$string,
      evaluated_file_reference: fst$evaluated_file_reference,
      expiration_date: clt$date_time,
      index: 0 .. max_tape_attachments,
      local_status: ost$status,
      message_status: ost$status,
      returned_attributes: fst$tla_returned_attributes,
      specified: array [1 .. max_tape_attachments] of boolean,
      supplied_file_set_pos_fields: fst$supplied_file_set_positions,
      tape_attachment_specified: boolean,
      undo_option_specified: boolean,
      undo_options: array [1 .. max_tape_attachments] of fst$attachment_option;

    status.normal := TRUE;

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

    FOR index := 1 TO max_tape_attachments DO
      attachment_options [index].selector := fsc$tape_attachment;
      attachment_options [index].tape_attachment.selector := fsc$tape_null_attachment_option;
      specified [index] := FALSE;
    FOREND;

    FOR index := 1 TO max_tape_attachments DO
      undo_options [index].selector := fsc$tape_attachment;
      undo_options [index].tape_attachment.selector := fsc$tape_null_attachment_option;
    FOREND;

    fsp$evaluate_file_reference (pvt [p$file].value^.file_value^, FALSE {command_file_reference_allowed},
          evaluated_file_reference, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    supplied_file_set_pos_fields := $fst$supplied_file_set_positions [];

    FOR index := p$block_type TO p$volume_accessibility DO
      IF pvt [index].specified THEN
        IF (pvt [index].value^.kind = clc$keyword) AND
              (pvt [index].value^.keyword_value = '$UNSPECIFIED') THEN
          undo_options [attachment_option_keys [index]].tape_attachment.selector :=
                attachment_option_keys [index];
        ELSE
          specified [attachment_option_keys [index]] := TRUE;
          attachment_options [attachment_option_keys [index]].tape_attachment.selector :=
                attachment_option_keys [index];
          CASE index OF
          = p$block_type =
            IF pvt [p$block_type].value^.keyword_value = 'SYSTEM_SPECIFIED' THEN
              attachment_options [fsc$tape_block_type].tape_attachment.tape_block_type :=
                    amc$system_specified;
            ELSE
              attachment_options [fsc$tape_block_type].tape_attachment.tape_block_type :=
                    amc$user_specified;
            IFEND;
          = p$character_conversion =
            attachment_options [fsc$tape_character_conversion].tape_attachment.tape_character_conversion :=
                  pvt [p$character_conversion].value^.boolean_value.value;
          = p$character_set =
            IF pvt [p$character_set].value^.keyword_value = 'ASCII' THEN
              attachment_options [fsc$tape_character_set].tape_attachment.tape_character_set := amc$ascii;
            ELSE
              attachment_options [fsc$tape_character_set].tape_attachment.tape_character_set := amc$ebcdic;
            IFEND;
          = p$creation_date =
            clp$convert_date_time_to_string (pvt [p$creation_date].value^.date_time_value,
                  'Y4J3', date_string, status);
            IF NOT status.normal THEN
              RETURN;
            IFEND;
            attachment_options [fsc$tape_creation_date].tape_attachment.tape_creation_date :=
                  date_string.value (1, 7);
          = p$expiration_date =
            IF pvt [p$expiration_date].value^.kind = clc$keyword THEN { EXPIRED }
              attachment_options [fsc$tape_expiration_date].tape_attachment.tape_expiration_date := '  00000';
            ELSEIF pvt [p$expiration_date].value^.kind = clc$date_time THEN
              clp$convert_date_time_to_string (pvt [p$expiration_date].value^.date_time_value,
                    'Y4J3', date_string, status);
              IF NOT status.normal THEN
                RETURN;
              IFEND;
              attachment_options [fsc$tape_expiration_date].tape_attachment.tape_expiration_date :=
                    date_string.value (1, 7);
            ELSE { time_increment }
              pmp$get_compact_date_time (current_date, status);
              IF NOT status.normal THEN
                RETURN;
              IFEND;
              pmp$compute_date_time (current_date, pvt [p$expiration_date].value^.time_increment_value^,
                    expiration_date.value, status);
              IF NOT status.normal THEN
                RETURN;
              IFEND;
              expiration_date.date_specified := TRUE;
              clp$convert_date_time_to_string (expiration_date, 'Y4J3', date_string, status);
              IF NOT status.normal THEN
                RETURN;
              IFEND;
              attachment_options [fsc$tape_expiration_date].tape_attachment.tape_expiration_date :=
                    date_string.value (1, 7);
            IFEND;
          = p$file_accessibility =
            IF pvt [index].value^.kind = clc$keyword THEN { NONE }
              attachment_options [fsc$tape_file_accessibility].tape_attachment.tape_file_accessibility := ' ';
            ELSEIF pvt [index].value^.kind = clc$name THEN
              rmp$validate_ansi_string (pvt [index].value^.name_value,
                    attachment_options [fsc$tape_file_accessibility].tape_attachment.tape_file_accessibility,
                    status);
            ELSE { string }
              rmp$validate_ansi_string (pvt [index].value^.string_value^,
                    attachment_options [fsc$tape_file_accessibility].tape_attachment.tape_file_accessibility,
                    status);
            IFEND;
            IF NOT status.normal THEN
              osp$append_status_parameter (osc$status_parameter_delimiter,
                    ' for FILE_ACCESSIBILITY parameter', status);
              RETURN;
            IFEND;
          = p$file_identifier =
            IF pvt [index].value^.kind = clc$name THEN
              rmp$validate_ansi_string (pvt [index].value^.name_value,
                    attachment_options [fsc$tape_file_identifier].tape_attachment.tape_file_identifier,
                    status);
            ELSE { string }
              rmp$validate_ansi_string (pvt [index].value^.string_value^,
                    attachment_options [fsc$tape_file_identifier].tape_attachment.tape_file_identifier,
                    status);
            IFEND;
            IF NOT status.normal THEN
              osp$append_status_parameter (osc$status_parameter_delimiter,
                    ' for FILE_IDENTIFIER parameter', status);
              RETURN;
            IFEND;
          = p$file_sequence_number =
            attachment_options [fsc$tape_file_sequence_number].tape_attachment.tape_file_sequence_number :=
                  pvt [index].value^.integer_value.value;
          = p$file_set_identifier =
            IF pvt [index].value^.kind = clc$name THEN
              rmp$validate_ansi_string (pvt [index].value^.name_value,
                    attachment_options [fsc$tape_file_set_identifier].tape_attachment.
                    tape_file_set_identifier, status);
            ELSE { string }
              rmp$validate_ansi_string (pvt [index].value^.string_value^,
                    attachment_options [fsc$tape_file_set_identifier].tape_attachment.
                    tape_file_set_identifier, status);
            IFEND;
            IF NOT status.normal THEN
              osp$append_status_parameter (osc$status_parameter_delimiter,
                    ' for FILE_SET_IDENTIFIER parameter', status);
              RETURN;
            IFEND;
          = p$file_set_position =
            IF pvt [index].value^.kind = clc$keyword THEN
              IF pvt [index].value^.keyword_value = 'BEGINNING_OF_SET' THEN
                attachment_options [fsc$tape_file_set_position].tape_attachment.tape_file_set_position.
                     position := fsc$tape_beginning_of_set;
              ELSEIF pvt [index].value^.keyword_value = 'CURRENT_FILE' THEN
                attachment_options [fsc$tape_file_set_position].tape_attachment.tape_file_set_position.
                     position := fsc$tape_current_file;
              ELSEIF pvt [index].value^.keyword_value = 'END_OF_SET' THEN
                attachment_options [fsc$tape_file_set_position].tape_attachment.tape_file_set_position.
                     position := fsc$tape_end_of_set;
              ELSE { NEXT_FILE }
                attachment_options [fsc$tape_file_set_position].tape_attachment.tape_file_set_position.
                     position := fsc$tape_next_file;
              IFEND;
            ELSE { clc$record }
              IF pvt [index].value^.field_values^ [1].value^.keyword_value = 'FILE_IDENTIFIER_POSITION' THEN
                attachment_options [fsc$tape_file_set_position].tape_attachment.tape_file_set_position.
                      position := fsc$tape_file_identifier_pos;
                IF pvt [index].value^.field_values^ [2].value <> NIL THEN
                  IF pvt [index].value^.field_values^ [2].value^.kind = clc$name THEN
                    rmp$validate_ansi_string (pvt [index].value^.field_values^ [2].value^.name_value,
                          attachment_options [fsc$tape_file_set_position].tape_attachment.
                          tape_file_set_position.file_identifier, status);
                    supplied_file_set_pos_fields := supplied_file_set_pos_fields +
                          $fst$supplied_file_set_positions [fsc$fsp_file_identifier];
                  ELSE { string }
                    rmp$validate_ansi_string (pvt [index].value^.field_values^ [2].value^.string_value^,
                          attachment_options [fsc$tape_file_set_position].tape_attachment.
                          tape_file_set_position.file_identifier, status);
                    supplied_file_set_pos_fields := supplied_file_set_pos_fields +
                          $fst$supplied_file_set_positions [fsc$fsp_file_identifier];
                  IFEND;
                  IF NOT status.normal THEN
                    osp$append_status_parameter (osc$status_parameter_delimiter,
                          ' for FILE_IDENTIFIER field of FILE_SET_POSITION parameter', status);
                    RETURN;
                  IFEND;
                IFEND;
                IF pvt [index].value^.field_values^ [3].value <> NIL THEN
                  attachment_options [fsc$tape_file_set_position].tape_attachment.tape_file_set_position.
                        generation_number := pvt [index].value^.field_values^ [3].value^.integer_value.value;
                  supplied_file_set_pos_fields := supplied_file_set_pos_fields +
                        $fst$supplied_file_set_positions [fsc$fsp_generation_number];
                IFEND;
              ELSE { FILE_SEQUENCE_POSITION }
                attachment_options [fsc$tape_file_set_position].tape_attachment.tape_file_set_position.
                      position := fsc$tape_file_sequence_pos;
                IF pvt [index].value^.field_values^ [2].value <> NIL THEN
                  attachment_options [fsc$tape_file_set_position].tape_attachment.tape_file_set_position.
                        file_sequence_number := pvt [index].value^.field_values^ [2].value^.integer_value.
                        value;
                  supplied_file_set_pos_fields := supplied_file_set_pos_fields +
                        $fst$supplied_file_set_positions [fsc$fsp_file_sequence_number];
                  IF specified [fsc$tape_file_sequence_number] THEN
                    fsp$set_evaluated_file_abnormal (evaluated_file_reference,
                          ame$redundant_file_seq_number, fmc$change_tape_label_attr_cmd, '', message_status);
                    osp$generate_message (message_status, local_status);
                  IFEND;
                IFEND;
              IFEND;
            IFEND;
          = p$generation_number =
            attachment_options [fsc$tape_generation_number].tape_attachment.tape_generation_number :=
                 pvt [index].value^.integer_value.value;
          = p$generation_version_number =
            attachment_options [fsc$tape_generation_version_num].tape_attachment.tape_generation_version_num
                  := pvt [index].value^.integer_value.value;
          = p$maximum_block_length =
            attachment_options [fsc$tape_max_block_length].tape_attachment.tape_max_block_length :=
                  pvt [index].value^.integer_value.value;
          = p$maximum_record_length =
            attachment_options [fsc$tape_max_record_length].tape_attachment.tape_max_record_length :=
                 pvt [index].value^.integer_value.value;
          = p$owner_identifier =
            IF pvt [index].value^.kind = clc$keyword THEN { NONE }
              attachment_options [fsc$tape_owner_identification].tape_attachment.tape_owner_identification :=
                    ' ';
            ELSEIF pvt [index].value^.kind = clc$name THEN
              rmp$validate_ansi_string (pvt [index].value^.name_value,
                    attachment_options [fsc$tape_owner_identification].tape_attachment.
                    tape_owner_identification, status);
            ELSE { string }
              rmp$validate_ansi_string (pvt [index].value^.string_value^,
                    attachment_options [fsc$tape_owner_identification].tape_attachment.
                    tape_owner_identification, status);
            IFEND;
            IF NOT status.normal THEN
              osp$append_status_parameter (osc$status_parameter_delimiter,
                    ' for OWNER_IDENTIFIER parameter', status);
              RETURN;
            IFEND;
          = p$padding_character =
            IF pvt [index].value^.kind = clc$name THEN
              attachment_options [fsc$tape_padding_character].tape_attachment.tape_padding_character :=
                    pvt [index].value^.name_value (1);
            ELSE
              attachment_options [fsc$tape_padding_character].tape_attachment.tape_padding_character :=
                    pvt [index].value^.string_value^ (1);
            IFEND;
          = p$record_type =
            IF pvt [index].value^.keyword_value = 'ANSI_FIXED' THEN
              attachment_options [fsc$tape_record_type].tape_attachment.tape_record_type :=
                    amc$ansi_fixed;
            ELSEIF pvt [index].value^.keyword_value = 'ANSI_SPANNED' THEN
              attachment_options [fsc$tape_record_type].tape_attachment.tape_record_type :=
                    amc$ansi_spanned;
            ELSEIF pvt [index].value^.keyword_value = 'ANSI_VARIABLE' THEN
              attachment_options [fsc$tape_record_type].tape_attachment.tape_record_type :=
                    amc$ansi_variable;
            ELSEIF pvt [index].value^.keyword_value = 'UNDEFINED' THEN
              attachment_options [fsc$tape_record_type].tape_attachment.tape_record_type :=
                    amc$undefined;
            ELSEIF pvt [index].value^.keyword_value = 'VARIABLE' THEN
              attachment_options [fsc$tape_record_type].tape_attachment.tape_record_type :=
                    amc$variable;
            IFEND;
          = p$removable_media_group =
            attachment_options [fsc$tape_removable_media_group].tape_attachment.tape_removable_media_group :=
                  pvt [index].value^.name_value;
          = p$rewrite_labels =
            attachment_options [fsc$tape_rewrite_labels].tape_attachment.tape_rewrite_labels :=
                  pvt [p$rewrite_labels].value^.boolean_value.value;
          = p$volume_accessibility =
            IF pvt [index].value^.kind = clc$keyword THEN { NONE }
              attachment_options [fsc$tape_volume_accessibility].tape_attachment.tape_volume_accessibility :=
                    ' ';
            ELSEIF pvt [index].value^.kind = clc$name THEN
              rmp$validate_ansi_string (pvt [index].value^.name_value,
                    attachment_options [fsc$tape_volume_accessibility].tape_attachment.
                    tape_volume_accessibility, status);
            ELSE { string }
              rmp$validate_ansi_string (pvt [index].value^.string_value^,
                    attachment_options [fsc$tape_volume_accessibility].tape_attachment.
                    tape_volume_accessibility, status);
            IFEND;
            IF NOT status.normal THEN
              osp$append_status_parameter (osc$status_parameter_delimiter,
                    ' for VOLUME_ACCESSIBILITY parameter', status);
              RETURN;
            IFEND;

          ELSE
          CASEND;
        IFEND;
      IFEND;
    FOREND;

    tape_attachment_specified := FALSE;
  /search_specified/
    FOR index := 1 TO max_tape_attachments DO
      IF specified [index] THEN
        tape_attachment_specified := TRUE;
        EXIT /search_specified/;
      IFEND;
    FOREND /search_specified/;

    undo_option_specified := FALSE;
  /search_undo/
    FOR index := 1 TO max_tape_attachments DO
      IF undo_options [index].tape_attachment.selector <> fsc$tape_null_attachment_option THEN
        undo_option_specified := TRUE;
        fsp$default_tape_label_attrib (fsc$tla_system_default, undo_options, returned_attributes, status);
        EXIT /search_undo/;
      IFEND;
    FOREND /search_undo/;

    fsp$evaluate_file_reference (pvt [p$file].value^.file_value^, FALSE {command_file_reference_allowed},
          evaluated_file_reference, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    validate_tape_attachments (status);

    IF status.normal THEN
      IF tape_attachment_specified THEN
        bap$store_tape_label_attributes (evaluated_file_reference, attachment_options,
            supplied_file_set_pos_fields, fsc$tape_label_attr_command, status);
      IFEND;
      IF status.normal AND undo_option_specified THEN
        bap$store_tape_label_attributes (evaluated_file_reference, undo_options,
            supplied_file_set_pos_fields, fsc$tape_label_attr_default, status);
      IFEND;
    IFEND;

    IF NOT status.normal THEN
      IF status.condition = ame$improper_device_class THEN
        fsp$set_evaluated_file_abnormal (evaluated_file_reference, ame$improper_device_class,
              fmc$change_tape_label_attr_cmd, 'MASS_STORAGE/NULL/TERMINAL', status);
      ELSEIF status.condition = ame$file_not_known THEN
        fsp$set_evaluated_file_abnormal (evaluated_file_reference, ame$file_not_known,
              fmc$change_tape_label_attr_cmd, 'CHANGE_TAPE_LABEL_ATTRIBUTES', status);
      ELSEIF status.condition = ame$file_attachment_required THEN
        fsp$set_evaluated_file_abnormal (evaluated_file_reference, ame$file_attachment_required,
              fmc$change_tape_label_attr_cmd, 'CHANGE_TAPE_LABEL_ATTRIBUTES', status);
      ELSEIF status.condition = fme$no_cycle_description THEN
        fsp$set_evaluated_file_abnormal (evaluated_file_reference, ame$file_not_known,
              fmc$change_tape_label_attr_cmd, 'CHANGE_TAPE_LABEL_ATTRIBUTES', status);
      IFEND;
    IFEND;

  PROCEND clp$change_tape_label_attr_cmd;

?? TITLE := 'PROCEDURE clp$$tape_label_attributes', EJECT ??

  PROCEDURE [XDCL, #GATE] clp$$tape_label_attributes
    (    parameter_list: clt$parameter_list;
     VAR work_area: ^clt$work_area;
     VAR result: ^clt$data_value;
     VAR status: ost$status);

{ FUNCTION (osm$$tape_label_attributes) $tape_label_attributes (
{   file: any of
{       key
{         (system_default_values, system_default_value, sdv)
{       keyend
{       file
{     anyend = $required
{   source: key
{       (explicit_specification, es)
{       (last_accessed, la)
{       (next_position, np)
{     keyend = next_position
{   attributes: list rest of key
{       all
{       (block_count, bc)
{       (block_type, bt)
{       (buffer_offset, bo)
{       (character_conversion, cc)
{       (character_set, cs)
{       (creation_date, cd)
{       (expiration_date, ed)
{       (file_identifier, fi)
{       (file_sequence_number, fsn)
{       (file_set_identifier, fsi)
{       (file_set_position, fsp)
{       (generation_number, gn)
{       (generation_version_number, gvn)
{       (header_labels, hl)
{       (maximum_block_length, maxbl)
{       (maximum_record_length, maxrl)
{       (padding_character, pc)
{       (record_type, rt)
{       (rewrite_labels, rl)
{       (trailer_labels, tl)
{     advanced_key
{       (file_accessibility, fa)
{       (file_section_number, fsen)
{       (implementation_identifier, ii)
{       (label_standard_version, lsv)
{       (owner_identifier, oi)
{       (removable_media_group, rmg)
{       (volume_accessibility, va)
{     keyend = all
{   )

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 3] of clt$pdt_parameter_name,
      parameters: array [1 .. 3] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 3] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
      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,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 55] of clt$keyword_specification,
        recend,
        default_value: string (3),
      recend,
    recend := [
    [1,
    [91, 4, 5, 17, 2, 48, 347],
    clc$function, 3, 3, 1, 0, 0, 0, 0, ''], [
    ['ATTRIBUTES                     ',clc$nominal_entry, 3],
    ['FILE                           ',clc$nominal_entry, 1],
    ['SOURCE                         ',clc$nominal_entry, 2]],
    [
{ PARAMETER 1
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 141,
  clc$required_parameter, 0, 0],
{ PARAMETER 2
    [3, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 229,
  clc$optional_default_parameter, 0, 13],
{ PARAMETER 3
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 2058,
  clc$optional_default_parameter, 0, 3]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    118, [[1, 0, clc$keyword_type], [3], [
      ['SDV                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['SYSTEM_DEFAULT_VALUE           ', clc$alias_entry, clc$normal_usage_entry, 1],
      ['SYSTEM_DEFAULT_VALUES          ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ],
{ PARAMETER 2
    [[1, 0, clc$keyword_type], [6], [
    ['ES                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['EXPLICIT_SPECIFICATION         ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['LA                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['LAST_ACCESSED                  ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['NEXT_POSITION                  ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['NP                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3]]
    ,
    'next_position'],
{ PARAMETER 3
    [[1, 0, clc$list_type], [2042, 1, clc$max_list_size, 0, FALSE, TRUE],
      [[1, 0, clc$keyword_type], [55], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['BC                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['BLOCK_COUNT                    ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['BLOCK_TYPE                     ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['BO                             ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['BT                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['BUFFER_OFFSET                  ', clc$nominal_entry, clc$normal_usage_entry, 4],
      ['CC                             ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
      ['CD                             ', clc$abbreviation_entry, clc$normal_usage_entry, 7],
      ['CHARACTER_CONVERSION           ', clc$nominal_entry, clc$normal_usage_entry, 5],
      ['CHARACTER_SET                  ', clc$nominal_entry, clc$normal_usage_entry, 6],
      ['CREATION_DATE                  ', clc$nominal_entry, clc$normal_usage_entry, 7],
      ['CS                             ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
      ['ED                             ', clc$abbreviation_entry, clc$normal_usage_entry, 8],
      ['EXPIRATION_DATE                ', clc$nominal_entry, clc$normal_usage_entry, 8],
      ['FA                             ', clc$abbreviation_entry, clc$advanced_usage_entry, 22],
      ['FI                             ', clc$abbreviation_entry, clc$normal_usage_entry, 9],
      ['FILE_ACCESSIBILITY             ', clc$nominal_entry, clc$advanced_usage_entry, 22],
      ['FILE_IDENTIFIER                ', clc$nominal_entry, clc$normal_usage_entry, 9],
      ['FILE_SECTION_NUMBER            ', clc$nominal_entry, clc$advanced_usage_entry, 23],
      ['FILE_SEQUENCE_NUMBER           ', clc$nominal_entry, clc$normal_usage_entry, 10],
      ['FILE_SET_IDENTIFIER            ', clc$nominal_entry, clc$normal_usage_entry, 11],
      ['FILE_SET_POSITION              ', clc$nominal_entry, clc$normal_usage_entry, 12],
      ['FSEN                           ', clc$abbreviation_entry, clc$advanced_usage_entry, 23],
      ['FSI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 11],
      ['FSN                            ', clc$abbreviation_entry, clc$normal_usage_entry, 10],
      ['FSP                            ', clc$abbreviation_entry, clc$normal_usage_entry, 12],
      ['GENERATION_NUMBER              ', clc$nominal_entry, clc$normal_usage_entry, 13],
      ['GENERATION_VERSION_NUMBER      ', clc$nominal_entry, clc$normal_usage_entry, 14],
      ['GN                             ', clc$abbreviation_entry, clc$normal_usage_entry, 13],
      ['GVN                            ', clc$abbreviation_entry, clc$normal_usage_entry, 14],
      ['HEADER_LABELS                  ', clc$nominal_entry, clc$normal_usage_entry, 15],
      ['HL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 15],
      ['II                             ', clc$abbreviation_entry, clc$advanced_usage_entry, 24],
      ['IMPLEMENTATION_IDENTIFIER      ', clc$nominal_entry, clc$advanced_usage_entry, 24],
      ['LABEL_STANDARD_VERSION         ', clc$nominal_entry, clc$advanced_usage_entry, 25],
      ['LSV                            ', clc$abbreviation_entry, clc$advanced_usage_entry, 25],
      ['MAXBL                          ', clc$abbreviation_entry, clc$normal_usage_entry, 16],
      ['MAXIMUM_BLOCK_LENGTH           ', clc$nominal_entry, clc$normal_usage_entry, 16],
      ['MAXIMUM_RECORD_LENGTH          ', clc$nominal_entry, clc$normal_usage_entry, 17],
      ['MAXRL                          ', clc$abbreviation_entry, clc$normal_usage_entry, 17],
      ['OI                             ', clc$abbreviation_entry, clc$advanced_usage_entry, 26],
      ['OWNER_IDENTIFIER               ', clc$nominal_entry, clc$advanced_usage_entry, 26],
      ['PADDING_CHARACTER              ', clc$nominal_entry, clc$normal_usage_entry, 18],
      ['PC                             ', clc$abbreviation_entry, clc$normal_usage_entry, 18],
      ['RECORD_TYPE                    ', clc$nominal_entry, clc$normal_usage_entry, 19],
      ['REMOVABLE_MEDIA_GROUP          ', clc$nominal_entry, clc$advanced_usage_entry, 27],
      ['REWRITE_LABELS                 ', clc$nominal_entry, clc$normal_usage_entry, 20],
      ['RL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 20],
      ['RMG                            ', clc$abbreviation_entry, clc$advanced_usage_entry, 27],
      ['RT                             ', clc$abbreviation_entry, clc$normal_usage_entry, 19],
      ['TL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 21],
      ['TRAILER_LABELS                 ', clc$nominal_entry, clc$normal_usage_entry, 21],
      ['VA                             ', clc$abbreviation_entry, clc$advanced_usage_entry, 28],
      ['VOLUME_ACCESSIBILITY           ', clc$nominal_entry, clc$advanced_usage_entry, 28]]
      ]
    ,
    'all']];

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

    CONST
      p$file = 1,
      p$source = 2,
      p$attributes = 3;

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

    VAR
      attributes_requested: current_tape_attachments,
      attributes: array [1 .. max_tape_attachments] of fst$attachment_option,
      current_option: ^clt$data_value,
      number_of_attributes_requested: ost$non_negative_integers,
      result_node: ^^clt$data_value,
      returned_attributes: fst$tla_returned_attributes,
      source: fst$tape_attribute_source,
      tape_attachment_choice: fst$tape_attachment_choices;

    status.normal := TRUE;

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

    attributes_requested :=  $current_tape_attachments [];
    number_of_attributes_requested := 0;
    current_option := pvt [p$attributes].value;

  /determine_attributes_requested/
    WHILE current_option <> NIL DO
      IF current_option^.element_value^.keyword_value = 'ALL' THEN
        enforce_security (number_of_attributes_requested, attributes_requested);
        EXIT /determine_attributes_requested/;
      ELSE
        get_tape_attachment_choice (current_option^.element_value^.keyword_value, tape_attachment_choice);
        IF NOT (tape_attachment_choice IN attributes_requested) THEN
          attributes_requested := attributes_requested + $current_tape_attachments [tape_attachment_choice];
          number_of_attributes_requested := number_of_attributes_requested + 1;
        IFEND;
      IFEND;
      current_option := current_option^.link;
    WHILEND /determine_attributes_requested/;

    FOR tape_attachment_choice := 1 TO max_tape_attachments DO
      IF tape_attachment_choice IN attributes_requested THEN
        attributes [tape_attachment_choice].selector := fsc$tape_attachment;
        attributes [tape_attachment_choice].tape_attachment.selector := tape_attachment_choice;
      ELSE
        attributes [tape_attachment_choice].selector := fsc$null_attachment_option;
      IFEND;
    FOREND;

    IF pvt [p$file].value^.kind = clc$keyword THEN { system_default_values }
      fsp$default_tape_label_attrib (fsc$tla_system_default, attributes, returned_attributes, status);
    ELSE
      IF pvt [p$source].value^.keyword_value = 'LAST_ACCESSED' THEN
        source := fsc$tla_last_ansi_file_accessed;
      ELSEIF pvt [p$source].value^.keyword_value = 'EXPLICIT_SPECIFICATION' THEN
        source := fsc$tla_explicit_specification;
      ELSE
        source := fsc$tla_next_position;
      IFEND;
      IF fsc$tape_header_labels IN attributes_requested THEN
        PUSH attributes [fsc$tape_header_labels].tape_attachment.tape_header_labels:
              [[REP 1 OF fst$tape_label_sequence_header, REP (fsc$max_tape_labels *
              (#SIZE (fst$tape_label_block_descriptor) + fsc$max_tape_label_length)) OF cell]];
      IFEND;
      IF fsc$tape_trailer_labels IN attributes_requested THEN
        PUSH attributes [fsc$tape_trailer_labels].tape_attachment.tape_header_labels:
              [[REP 1 OF fst$tape_label_sequence_header, REP (fsc$max_tape_labels *
              (#SIZE (fst$tape_label_block_descriptor) + fsc$max_tape_label_length)) OF cell]];
      IFEND;
      fsp$get_tape_label_attributes (pvt [p$file].value^.file_value^, source, attributes,
            returned_attributes, status);
    IFEND;
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$make_record_value (number_of_attributes_requested, work_area, result);

    build_display_record (attributes, attributes_requested, returned_attributes, work_area, result, status);

  PROCEND clp$$tape_label_attributes;

?? TITLE := 'PROCEDURE build_display_record', EJECT ??

  PROCEDURE build_display_record
    (   attributes: fst$attachment_options;
        attributes_requested: current_tape_attachments;
        returned_attributes: fst$tla_returned_attributes;
    VAR work_area: ^clt$work_area;
    VAR result: ^clt$data_value;
    VAR status: ost$status);

?? NEWTITLE := 'convert_labels', EJECT ??
    PROCEDURE [INLINE] convert_labels
      (    label_sequence: ^SEQ ( * );
       VAR result: ^clt$data_value);

     VAR
       block_number: fst$tape_label_count,
       label_identifier: fst$tape_label_identifier,
       label_locator: fst$tape_label_locator,
       label_string: ^string (* <= fsc$max_tape_label_length),
       local_sequence: ^SEQ ( * ),
       result_p: ^^clt$data_value,
       sequence_header: ^fst$tape_label_sequence_header;

      result_p := ^result;
      result := NIL;
      local_sequence := label_sequence;

      NEXT sequence_header IN local_sequence;
      label_identifier.location_method := fsc$tape_label_locate_by_index;
      FOR block_number := 1 TO sequence_header^.label_count DO
        label_identifier.label_index := block_number;
        fsp$locate_tape_label (local_sequence, label_identifier, label_locator);
        IF label_locator.label_found AND (label_locator.label_block_descriptor^.label_block_type =
              fsc$normal_tape_label_block) THEN
          clp$make_list_value (work_area, result_p^);
          NEXT label_string: [label_locator.label_block_descriptor^.normal_label_transfer_length] IN
                label_locator.label_block;
          clp$make_string_value (label_string^, work_area, result_p^^.element_value);
          result_p := ^result_p^^.link;
        IFEND;
      FOREND;

      IF result = NIL THEN
        clp$make_list_value (work_area, result);
      IFEND;

    PROCEND convert_labels;
?? OLDTITLE, EJECT ??

    VAR
      character_string: string (1),
      current_field_number: ost$positive_integers,
      date: clt$date_time,
      fsp_value_pp: ^^clt$data_value,
      tape_option: 1 .. max_displayable_attributes;

    status.normal := TRUE;
    current_field_number := 1;

    FOR tape_option := 1 TO max_displayable_attributes DO
      IF tape_attachment_names [tape_option].ordinal IN attributes_requested THEN
        result^.field_values^[current_field_number].name := tape_attachment_names [tape_option].text;
        IF NOT (tape_attachment_names [tape_option].ordinal IN returned_attributes) THEN
          clp$make_unspecified_value (work_area, result^.field_values^[current_field_number].value);
        ELSE
          CASE tape_attachment_names [tape_option].ordinal OF
          = fsc$tape_block_count =
            clp$make_integer_value (attributes [fsc$tape_block_count].tape_attachment.tape_block_count,
                  10, FALSE, work_area, result^.field_values^[current_field_number].value);

          = fsc$tape_block_type =
            clp$make_keyword_value (block_types [attributes [fsc$tape_block_type].tape_attachment.
                  tape_block_type], work_area, result^.field_values^ [current_field_number].value);

          = fsc$tape_buffer_offset =
            clp$make_integer_value (attributes [fsc$tape_buffer_offset].tape_attachment.tape_buffer_offset,
                  10, FALSE, work_area, result^.field_values^[current_field_number].value);

          = fsc$tape_character_conversion =
            clp$make_boolean_value (attributes [fsc$tape_character_conversion].tape_attachment.
                  tape_character_conversion, clc$yes_no_boolean, work_area,
                  result^.field_values^[current_field_number].value);

          = fsc$tape_character_set =
            clp$make_keyword_value (character_sets [attributes [fsc$tape_character_set].tape_attachment.
                  tape_character_set], work_area, result^.field_values^[current_field_number].value);

          = fsc$tape_creation_date =
            clp$convert_string_to_date_time (attributes [fsc$tape_creation_date].tape_attachment.
                  tape_creation_date, 'Y4J3', date, status);
            IF NOT status.normal THEN
              RETURN;
            IFEND;
            clp$make_date_time_value (date, work_area, result^.field_values^[current_field_number].value);

          = fsc$tape_expiration_date =
            IF attributes [fsc$tape_expiration_date].tape_attachment.tape_expiration_date = '  00000' THEN
              clp$make_keyword_value ('EXPIRED', work_area,
                    result^.field_values^[current_field_number].value);
            ELSE
              clp$convert_string_to_date_time (attributes [fsc$tape_expiration_date].tape_attachment.
                    tape_expiration_date, 'Y4J3', date, status);
              IF NOT status.normal THEN
                RETURN;
              IFEND;
              clp$make_date_time_value (date, work_area, result^.field_values^[current_field_number].value);
            IFEND;

          = fsc$tape_file_accessibility =
            clp$make_string_value (attributes [fsc$tape_file_accessibility].tape_attachment.
                  tape_file_accessibility, work_area, result^.field_values^ [current_field_number].value);

          = fsc$tape_file_identifier =
            clp$make_string_value (attributes [fsc$tape_file_identifier].tape_attachment.tape_file_identifier,
                  work_area, result^.field_values^ [current_field_number].value);

          = fsc$tape_file_section_number =
            clp$make_integer_value (attributes [fsc$tape_file_section_number].tape_attachment.
                  tape_file_section_number, 10, FALSE, work_area,
                  result^.field_values^[current_field_number].value);

          = fsc$tape_file_sequence_number =
            clp$make_integer_value (attributes [fsc$tape_file_sequence_number].tape_attachment.
                  tape_file_sequence_number, 10, FALSE, work_area,
                  result^.field_values^[current_field_number].value);

          = fsc$tape_file_set_identifier =
            clp$make_string_value (attributes [fsc$tape_file_set_identifier].tape_attachment.
                  tape_file_set_identifier, work_area, result^.field_values
                  ^[current_field_number].value);

          = fsc$tape_file_set_position =
            fsp_value_pp := ^result^.field_values^ [current_field_number].value;
            IF attributes [fsc$tape_file_set_position].tape_attachment.tape_file_set_position.position =
                  fsc$tape_file_identifier_pos THEN
              clp$make_record_value (3, work_area, fsp_value_pp^);
              fsp_value_pp^^.field_values^[1].name := 'METHOD';
              clp$make_keyword_value (file_set_position [attributes [fsc$tape_file_set_position].
                    tape_attachment.tape_file_set_position.position], work_area,
                    fsp_value_pp^^.field_values^[1].value);
              fsp_value_pp^^.field_values^[2].name := 'FILE_IDENTIFIER';
              clp$make_string_value (attributes [fsc$tape_file_set_position].tape_attachment.
                    tape_file_set_position.file_identifier, work_area, fsp_value_pp^^.
                    field_values^[2].value);
              fsp_value_pp^^.field_values^[3].name := 'GENERATION_NUMBER';
              clp$make_integer_value (attributes [fsc$tape_file_set_position].tape_attachment.
                    tape_file_set_position.generation_number, 10, FALSE, work_area,
                    fsp_value_pp^^.field_values^[3].value);

            ELSEIF attributes [fsc$tape_file_set_position].tape_attachment.tape_file_set_position.position =
                  fsc$tape_file_sequence_pos THEN
              clp$make_record_value (2, work_area, fsp_value_pp^);
              fsp_value_pp^^.field_values^[1].name := 'METHOD';
              clp$make_keyword_value (file_set_position [attributes [fsc$tape_file_set_position].
                    tape_attachment.tape_file_set_position.position], work_area,
                    fsp_value_pp^^.field_values^[1].value);
              fsp_value_pp^^.field_values^[2].name := 'FILE_SEQUENCE_NUMBER';
              clp$make_integer_value (attributes [fsc$tape_file_set_position].tape_attachment.
                    tape_file_set_position.file_sequence_number, 10, FALSE, work_area,
                    fsp_value_pp^^.field_values^[2].value);

            ELSE
              clp$make_keyword_value (file_set_position [attributes [fsc$tape_file_set_position].
                    tape_attachment.tape_file_set_position.position], work_area, fsp_value_pp^);
            IFEND;

          = fsc$tape_generation_number =
            clp$make_integer_value (attributes [fsc$tape_generation_number].tape_attachment.
                  tape_generation_number, 10, FALSE, work_area,
                  result^.field_values^[current_field_number].value);

          = fsc$tape_generation_version_num =
            clp$make_integer_value (attributes [fsc$tape_generation_version_num].tape_attachment.
                  tape_generation_version_num, 10, FALSE, work_area,
                  result^.field_values^[current_field_number].value);

          = fsc$tape_header_labels =
            convert_labels (attributes [fsc$tape_header_labels].tape_attachment.tape_header_labels,
                  result^.field_values^[current_field_number].value);

          = fsc$tape_implementation_id =
            clp$make_string_value (attributes [fsc$tape_implementation_id].tape_attachment.
                  tape_implementation_id, work_area, result^.field_values^[current_field_number].value);

          = fsc$tape_label_standard_version =
            clp$make_integer_value (attributes [fsc$tape_label_standard_version].tape_attachment.
                  tape_label_standard_version, 10, FALSE, work_area,
                  result^.field_values^[current_field_number].value);

          = fsc$tape_max_block_length =
            clp$make_integer_value (attributes [fsc$tape_max_block_length].tape_attachment.
                  tape_max_block_length, 10, FALSE, work_area,
                  result^.field_values^[current_field_number].value);

          = fsc$tape_max_record_length =
            clp$make_integer_value (attributes [fsc$tape_max_record_length].tape_attachment.
                  tape_max_record_length, 10, FALSE, work_area,
                  result^.field_values^[current_field_number].value);

          = fsc$tape_owner_identification =
            clp$make_string_value (attributes [fsc$tape_owner_identification].tape_attachment.
                  tape_owner_identification, work_area, result^.field_values^[current_field_number].value);

          = fsc$tape_padding_character =
            character_string := attributes [fsc$tape_padding_character].tape_attachment.
                  tape_padding_character;
            clp$make_string_value (character_string, work_area,
                  result^.field_values^ [current_field_number].value);

          = fsc$tape_record_type =
            clp$make_keyword_value (record_types [attributes [fsc$tape_record_type].tape_attachment.
                  tape_record_type], work_area, result^.field_values^[current_field_number].value);

          = fsc$tape_removable_media_group =
            clp$make_name_value (attributes [fsc$tape_removable_media_group].tape_attachment.
                  tape_removable_media_group, work_area, result^.field_values^[current_field_number].value);

          = fsc$tape_rewrite_labels =
            clp$make_boolean_value (attributes [fsc$tape_rewrite_labels].tape_attachment.tape_rewrite_labels,
                  clc$yes_no_boolean, work_area, result^.field_values^[current_field_number].value);

          = fsc$tape_trailer_labels =
            convert_labels (attributes [fsc$tape_trailer_labels].tape_attachment.tape_header_labels,
                  result^.field_values^[current_field_number].value);

          = fsc$tape_volume_accessibility =
            clp$make_string_value (attributes [fsc$tape_volume_accessibility].tape_attachment.
                  tape_volume_accessibility, work_area, result^.field_values^[current_field_number].value);

          ELSE
            ;
          CASEND;
        IFEND;
        current_field_number := current_field_number + 1;
      IFEND;
    FOREND;

  PROCEND build_display_record;

?? TITLE := 'PROCEDURE enforce_security', EJECT ??
  PROCEDURE enforce_security
    (VAR number_of_attributes_requested: ost$non_negative_integers;
     VAR attributes_requested: current_tape_attachments);

    IF avp$removable_media_admin () THEN
      number_of_attributes_requested := max_displayable_attributes;
      attributes_requested := -$current_tape_attachments [fsc$tape_null_attachment_option];
    ELSE
      number_of_attributes_requested := max_displayable_attributes - 4;
      attributes_requested := -$current_tape_attachments [fsc$tape_null_attachment_option,
            fsc$tape_file_accessibility, fsc$tape_owner_identification, fsc$tape_removable_media_group,
            fsc$tape_volume_accessibility];
    IFEND;

  PROCEND enforce_security;

?? TITLE := 'PROCEDURE get_tape_attachment_choice', EJECT ??

  PROCEDURE get_tape_attachment_choice (
        text: ost$name;
    VAR tape_attachment_choice: fst$tape_attachment_choices);

    VAR
      i: 1 .. max_displayable_attributes;

    FOR i := 1 TO max_displayable_attributes DO
      IF (tape_attachment_names [i].text = text) THEN
        tape_attachment_choice := tape_attachment_names [i].ordinal;
        RETURN;
      IFEND;
    FOREND;

  PROCEND get_tape_attachment_choice;
?? OLDTITLE ??
MODEND clm$tape_label_commands;
