?? RIGHT := 110 ??
?? NEWTITLE := '  NOS/VE Create Blank Volume interfaces.' ??
MODULE rmm$create_blank_volumes;

{ PURPOSE:
{   This module contains the command interfaces for creating blank labeled or
{   unlabeled volumes.

?? NEWTITLE := 'Global Declarations Referenced by This Module.', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc ame$label_validation_errors
*copyc cle$ecc_file_reference
*copyc cle$ecc_parsing
*copyc fsc$version_one_ve_identifier
*copyc fsc$version_two_ve_identifier
*copyc fst$ansi_eof1_label
*copyc fst$ansi_eof2_label
*copyc fst$ansi_hdr1_label
*copyc fst$ansi_hdr2_label
*copyc fst$ansi_vol1_label
*copyc fst$tape_label_block_descriptor
*copyc fst$tape_label_sequence_header
*copyc osd$integer_limits
*copyc ost$help_module
*copyc rmc$initv_menu_names
*copyc rme$robotic_interface_errors
*copyc rme$creblv_errors
?? POP ??
*copyc clp$change_variable
*copyc clp$convert_string_to_integer
*copyc clp$evaluate_parameters
*copyc cmp$get_element_information
*copyc cmp$get_element_r3
*copyc fsp$classify_tape_label
*copyc fsp$close_file
*copyc fsp$default_tape_label_attrib
*copyc fsp$detach_file
*copyc fsp$get_tape_label_attributes
*copyc fsp$locate_tape_label
*copyc fsp$open_file
*copyc i#current_sequence_position
*copyc i#move
*copyc osp$append_status_parameter
*copyc osp$disestablish_cond_handler
*copyc osp$establish_block_exit_hndlr
*copyc osp$set_status_abnormal
*copyc osp$set_status_condition
*copyc oss$job_paged_literal
*copyc pmp$change_legible_date_format
*copyc pmp$generate_unique_name
*copyc pmp$get_date
*copyc rap$prompt_via_menu
*copyc rmp$classify_tape_volume
*copyc rmp$request_tape
*copyc rmp$validate_ansi_string

*copyc amv$nil_file_identifier
*copyc dmv$initialize_tape_volume
*copyc rmv$initv_module_pointers

  VAR
    init_file_attr: [STATIC, READ, oss$job_paged_literal] array
          [1 .. 5] of fst$file_cycle_attribute := [[fsc$block_type, amc$user_specified],
          [fsc$record_type, amc$undefined], [fsc$max_block_length, 80], [fsc$file_label_type, amc$labeled],
          [fsc$forced_write, amc$forced]],

    vol1_label_default: [READ, oss$job_paged_literal] fst$ansi_vol1_label := [
          {label_identifier} 'VOL',
          {label_number} '1',
          {volume_identifier} ' ',
          {accessibility} ' ',
          {reserved_to_ansi1} ' ',
          {implementation_identifier} 'NOS/VE V2.0',
          {owner_identifier} ' ',
          {reserved_to_ansi2} ' ',
          {label_standard_version} '4'];

?? NEWTITLE := 'rmp$create_blank_labeled_volume', EJECT ??

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

{ PROCEDURE create_blank_labeled_volume, creblv (
{   element, elements, e: list of name = $optional
{   recorded_vsn, recorded_vsns, rvsn, rv: list of any of
{       name 1..6
{       string 1..6
{     anyend = $optional
{   character_set, cs: (BY_NAME) key
{       (ascii, a)
{       (ebcdic, e)
{     keyend = ascii
{   density, d: (BY_NAME) key
{       mt9$800, mt9$1600, mt9$6250, mt18$38000
{     keyend = $optional
{   external_vsn, evsn, external_vsns, ev: (BY_NAME) list of any of
{       name 1..6
{       string 1..6
{     anyend = $optional
{   file_accessibility, fa: (BY_NAME, SECURE) any of
{       name 1..1
{       string 1
{     anyend = $optional
{   implementation_identifier, ii: (BY_NAME) any of
{       name 1..13
{       string 1..13
{     anyend = $optional
{   initialized_volume_count, ivc: (VAR, BY_NAME) integer = $optional
{   labeling_convention, lc: (BY_NAME) any of
{       key
{         (ansi, a)
{         (cdc_version_one, cvo)
{         (cdc_version_two, cvt)
{         (label_for_group, lfg)
{         (label_for_user, lfu)
{       keyend
{       list 1..128 of string 1..4128
{     anyend = osd$creblv_labeling_convention, cdc_version_two
{   label_standard_version, lsv: (BY_NAME) any of
{       integer 0..9
{     anyend = 4
{   owner_identifier, oi: (BY_NAME, SECURE) any of
{       name 1..14
{       string 1..14
{     anyend = $optional
{   removable_media_group, rmg: (BY_NAME, SECURE) name 1..13 = $optional
{   unload_volume, uv: (BY_NAME) boolean = true
{   volume_accessibility, va: (BY_NAME, SECURE) any of
{       name 1..1
{       string 1
{     anyend = $optional
{   volume_confirmation, vc: (BY_NAME) any of
{       key
{         all, none
{       keyend
{       list of key
{         (labeled_expired, le)
{         (unreadable_volume, uv)
{         (unlabeled, u)
{         (labeled_unexpired, lu)
{       keyend
{     anyend = osd$volume_confirmation, all
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 36] of clt$pdt_parameter_name,
      parameters: array [1 .. 16] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$union_type_qualifier,
          type_size_1: clt$type_specification_size,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
          type_size_2: clt$type_specification_size,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$string_type_qualifier,
          recend,
        recend,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
        default_value: string (5),
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
      recend,
      type5: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$union_type_qualifier,
          type_size_1: clt$type_specification_size,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
          type_size_2: clt$type_specification_size,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$string_type_qualifier,
          recend,
        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$name_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        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$name_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
      recend,
      type8: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type9: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 10] 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$string_type_qualifier,
          recend,
        recend,
        default_name: string (30),
        default_value: string (15),
      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$integer_type_qualifier,
        recend,
        default_value: string (1),
      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$name_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
      recend,
      type12: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type13: record
        header: clt$type_specification_header,
        default_value: string (4),
      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$name_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$string_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 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 8] of clt$keyword_specification,
          recend,
        recend,
        default_name: string (23),
        default_value: string (3),
      recend,
      type16: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [91, 7, 12, 9, 39, 27, 654],
    clc$command, 36, 16, 0, 0, 0, 1, 16, ''], [
    ['CHARACTER_SET                  ',clc$nominal_entry, 3],
    ['CS                             ',clc$abbreviation_entry, 3],
    ['D                              ',clc$abbreviation_entry, 4],
    ['DENSITY                        ',clc$nominal_entry, 4],
    ['E                              ',clc$abbreviation_entry, 1],
    ['ELEMENT                        ',clc$nominal_entry, 1],
    ['ELEMENTS                       ',clc$alias_entry, 1],
    ['EV                             ',clc$abbreviation_entry, 5],
    ['EVSN                           ',clc$alias_entry, 5],
    ['EXTERNAL_VSN                   ',clc$nominal_entry, 5],
    ['EXTERNAL_VSNS                  ',clc$alias_entry, 5],
    ['FA                             ',clc$abbreviation_entry, 6],
    ['FILE_ACCESSIBILITY             ',clc$nominal_entry, 6],
    ['II                             ',clc$abbreviation_entry, 7],
    ['IMPLEMENTATION_IDENTIFIER      ',clc$nominal_entry, 7],
    ['INITIALIZED_VOLUME_COUNT       ',clc$nominal_entry, 8],
    ['IVC                            ',clc$abbreviation_entry, 8],
    ['LABELING_CONVENTION            ',clc$nominal_entry, 9],
    ['LABEL_STANDARD_VERSION         ',clc$nominal_entry, 10],
    ['LC                             ',clc$abbreviation_entry, 9],
    ['LSV                            ',clc$abbreviation_entry, 10],
    ['OI                             ',clc$abbreviation_entry, 11],
    ['OWNER_IDENTIFIER               ',clc$nominal_entry, 11],
    ['RECORDED_VSN                   ',clc$nominal_entry, 2],
    ['RECORDED_VSNS                  ',clc$alias_entry, 2],
    ['REMOVABLE_MEDIA_GROUP          ',clc$nominal_entry, 12],
    ['RMG                            ',clc$abbreviation_entry, 12],
    ['RV                             ',clc$abbreviation_entry, 2],
    ['RVSN                           ',clc$alias_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 16],
    ['UNLOAD_VOLUME                  ',clc$nominal_entry, 13],
    ['UV                             ',clc$abbreviation_entry, 13],
    ['VA                             ',clc$abbreviation_entry, 14],
    ['VC                             ',clc$abbreviation_entry, 15],
    ['VOLUME_ACCESSIBILITY           ',clc$nominal_entry, 14],
    ['VOLUME_CONFIRMATION            ',clc$nominal_entry, 15]],
    [
{ PARAMETER 1
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 21, clc$optional_parameter,
  0, 0],
{ PARAMETER 2
    [24, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 49, clc$optional_parameter,
  0, 0],
{ PARAMETER 3
    [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, 155,
  clc$optional_default_parameter, 0, 5],
{ PARAMETER 4
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,
  clc$optional_parameter, 0, 0],
{ PARAMETER 5
    [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, 49, clc$optional_parameter,
  0, 0],
{ PARAMETER 6
    [13, clc$normal_usage_entry, clc$secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 33, clc$optional_parameter,
  0, 0],
{ PARAMETER 7
    [15, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 33, clc$optional_parameter,
  0, 0],
{ PARAMETER 8
    [16, 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, 20,
  clc$optional_parameter, 0, 0],
{ PARAMETER 9
    [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, 421,
  clc$optional_default_parameter, 30, 15],
{ PARAMETER 10
    [19, 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, 36,
  clc$optional_default_parameter, 0, 1],
{ PARAMETER 11
    [23, clc$normal_usage_entry, clc$secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 33, clc$optional_parameter,
  0, 0],
{ PARAMETER 12
    [26, clc$normal_usage_entry, clc$secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 5, clc$optional_parameter, 0
  , 0],
{ PARAMETER 13
    [31, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 14
    [35, clc$normal_usage_entry, clc$secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 33, clc$optional_parameter,
  0, 0],
{ PARAMETER 15
    [36, 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, 420,
  clc$optional_default_parameter, 23, 3],
{ PARAMETER 16
    [30, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 2
    [[1, 0, clc$list_type], [33, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$union_type], [[clc$name_type, clc$string_type],
      FALSE, 2],
      5, [[1, 0, clc$name_type], [1, 6]],
      8, [[1, 0, clc$string_type], [1, 6, FALSE]]
      ]
    ],
{ PARAMETER 3
    [[1, 0, clc$keyword_type], [4], [
    ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['ASCII                          ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['E                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['EBCDIC                         ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ,
    'ascii'],
{ PARAMETER 4
    [[1, 0, clc$keyword_type], [4], [
    ['MT18$38000                     ', clc$nominal_entry, clc$normal_usage_entry, 4],
    ['MT9$1600                       ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['MT9$6250                       ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['MT9$800                        ', clc$nominal_entry, clc$normal_usage_entry, 1]]
    ],
{ PARAMETER 5
    [[1, 0, clc$list_type], [33, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$union_type], [[clc$name_type, clc$string_type],
      FALSE, 2],
      5, [[1, 0, clc$name_type], [1, 6]],
      8, [[1, 0, clc$string_type], [1, 6, FALSE]]
      ]
    ],
{ PARAMETER 6
    [[1, 0, clc$union_type], [[clc$name_type, clc$string_type],
    FALSE, 2],
    5, [[1, 0, clc$name_type], [1, 1]],
    8, [[1, 0, clc$string_type], [1, 1, FALSE]]
    ],
{ PARAMETER 7
    [[1, 0, clc$union_type], [[clc$name_type, clc$string_type],
    FALSE, 2],
    5, [[1, 0, clc$name_type], [1, 13]],
    8, [[1, 0, clc$string_type], [1, 13, FALSE]]
    ],
{ PARAMETER 8
    [[1, 0, clc$integer_type], [clc$min_integer, clc$max_integer, 10]],
{ PARAMETER 9
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    377, [[1, 0, clc$keyword_type], [10], [
      ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['ANSI                           ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['CDC_VERSION_ONE                ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['CDC_VERSION_TWO                ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['CVO                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['CVT                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['LABEL_FOR_GROUP                ', clc$nominal_entry, clc$normal_usage_entry, 4],
      ['LABEL_FOR_USER                 ', clc$nominal_entry, clc$normal_usage_entry, 5],
      ['LFG                            ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['LFU                            ', clc$abbreviation_entry, clc$normal_usage_entry, 5]]
      ],
    24, [[1, 0, clc$list_type], [8, 1, 128, 0, FALSE, FALSE],
        [[1, 0, clc$string_type], [1, 4128, FALSE]]
      ]
    ,
    'OSD$CREBLV_LABELING_CONVENTION',
    'cdc_version_two'],
{ PARAMETER 10
    [[1, 0, clc$union_type], [[clc$integer_type],
    TRUE, 1],
    20, [[1, 0, clc$integer_type], [0, 9, 10]]
    ,
    '4'],
{ PARAMETER 11
    [[1, 0, clc$union_type], [[clc$name_type, clc$string_type],
    FALSE, 2],
    5, [[1, 0, clc$name_type], [1, 14]],
    8, [[1, 0, clc$string_type], [1, 14, FALSE]]
    ],
{ PARAMETER 12
    [[1, 0, clc$name_type], [1, 13]],
{ PARAMETER 13
    [[1, 0, clc$boolean_type],
    'true'],
{ PARAMETER 14
    [[1, 0, clc$union_type], [[clc$name_type, clc$string_type],
    FALSE, 2],
    5, [[1, 0, clc$name_type], [1, 1]],
    8, [[1, 0, clc$string_type], [1, 1, FALSE]]
    ],
{ PARAMETER 15
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 2]]
      ],
    319, [[1, 0, clc$list_type], [303, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$keyword_type], [8], [
        ['LABELED_EXPIRED                ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['LABELED_UNEXPIRED              ', clc$nominal_entry, clc$normal_usage_entry, 4],
        ['LE                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['LU                             ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
        ['U                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['UNLABELED                      ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['UNREADABLE_VOLUME              ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['UV                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2]]
        ]
      ]
    ,
    'OSD$VOLUME_CONFIRMATION',
    'all'],
{ PARAMETER 16
    [[1, 0, clc$status_type]]];

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

    CONST
      p$element = 1,
      p$recorded_vsn = 2,
      p$character_set = 3,
      p$density = 4,
      p$external_vsn = 5,
      p$file_accessibility = 6,
      p$implementation_identifier = 7,
      p$initialized_volume_count = 8,
      p$labeling_convention = 9,
      p$label_standard_version = 10,
      p$owner_identifier = 11,
      p$removable_media_group = 12,
      p$unload_volume = 13,
      p$volume_accessibility = 14,
      p$volume_confirmation = 15,
      p$status = 16;

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

?? NEWTITLE := '  create_blank_labeled_volume', EJECT ??

    PROCEDURE create_blank_labeled_volume;

?? NEWTITLE := '    creblv_cond_handler', EJECT ??

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

        VAR
          ignore_status: ost$status;

        IF file_id <> amv$nil_file_identifier THEN
          fsp$close_file (file_id, ignore_status);
        IFEND;

        fsp$detach_file (unique_name.value, {detachment_options} NIL, ignore_status);

      PROCEND creblv_cond_handler;
?? OLDTITLE ??
?? NEWTITLE := '    post_appropriate_menu', EJECT ??

      PROCEDURE post_appropriate_menu
        (    menu_module: pmt$program_name;
             volume_classification: rmt$tape_volume_classification;
         VAR confirmed: boolean;
         VAR status: ost$status);

        VAR
          dt: ost$date,
          hdr1_p: ^fst$ansi_hdr1_label,
          lsv_length: integer,
          menu_selections_p: ^array [ * ] of ost$name,
          menu_parameters_p: rat$message_parameters,
          old_expiration_date: string (10),
          prompting_options: rat$prompting_options,
          proposed_file_accessibility: string (1),
          proposed_hdr1: ^fst$ansi_hdr1_label,
          proposed_label_standard_version: string (2),
          proposed_owner_identifier: string (14),
          proposed_volume_accessibility: string (1),
          selection_chosen: ost$name,
          todays_date: ost$date,
          vol1_p: ^fst$ansi_vol1_label;

        hdr1_p := NIL;
        old_expiration_date := '*NO HDR1*';
        vol1_p := NIL;

        pmp$get_date (osc$iso_date, todays_date, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        IF volume_header_labels <> NIL THEN
          RESET volume_header_labels;
          NEXT sequence_header IN volume_header_labels;

          label_identifier.location_method := fsc$tape_label_locate_by_kind;
          label_identifier.label_kind := fsc$ansi_vol1_label_kind;
          fsp$locate_tape_label (volume_header_labels, label_identifier, label_locator);
          IF label_locator.label_found AND (label_locator.label_block <> NIL) THEN
            NEXT vol1_p IN label_locator.label_block;
          IFEND;

          label_identifier.label_kind := fsc$ansi_hdr1_label_kind;
          fsp$locate_tape_label (volume_header_labels, label_identifier, label_locator);
          IF label_locator.label_found AND (label_locator.label_block <> NIL) THEN
            NEXT hdr1_p IN label_locator.label_block;
            IF hdr1_p^.expiration_date (2, 5) = '00000' THEN
              old_expiration_date := 'EXPIRED';
            ELSE
              dt.date_format := osc$ordinal_date;
              IF hdr1_p^.expiration_date (1) = ' ' THEN
                dt.ordinal (1, 2) := '19';
                dt.ordinal (3, 5) := hdr1_p^.expiration_date (2, 5);
              ELSE
                dt.ordinal (1, 1) := '2';
                dt.ordinal (2, 6) := hdr1_p^.expiration_date (1, 6);
              IFEND;
              pmp$change_legible_date_format (osc$iso_date, dt, local_status);
              IF local_status.normal THEN
                old_expiration_date := dt.iso;
              ELSE
                old_expiration_date := 'EXPIRED';
              IFEND;
            IFEND;
          IFEND;
        IFEND;

        IF pvt [p$file_accessibility].specified THEN
          proposed_file_accessibility := attachment_options^ [ta_fa].tape_attachment.tape_file_accessibility;
        ELSE
          label_identifier.location_method := fsc$tape_label_locate_by_kind;
          label_identifier.label_kind := fsc$ansi_hdr1_label_kind;
          fsp$locate_tape_label (attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.
                blank_label_group, label_identifier, label_locator);
          IF label_locator.label_found THEN
            NEXT proposed_hdr1 IN label_locator.label_block;
            proposed_file_accessibility := proposed_hdr1^.accessibility;
          ELSE
            osp$set_status_abnormal ('RM', ame$hdr1_label_missing, 'FILE_ACCESSIBILITY', status);
          IFEND;
        IFEND;

        STRINGREP (proposed_label_standard_version, lsv_length,
              pvt [p$label_standard_version].value^.integer_value.value);

        IF pvt [p$owner_identifier].specified THEN
          proposed_owner_identifier := attachment_options^ [ta_oi].tape_attachment.tape_owner_identification;
        ELSEIF pvt [p$removable_media_group].specified THEN
          proposed_owner_identifier (1, 1) := '&';
          proposed_owner_identifier (2, 13) := attachment_options^ [ta_rmg].tape_attachment.
                tape_removable_media_group;
        ELSE
          proposed_owner_identifier := proposed_vol1^.owner_identifier;
        IFEND;

        IF pvt [p$volume_accessibility].specified THEN
          proposed_volume_accessibility := attachment_options^ [ta_va].tape_attachment.
                tape_volume_accessibility;
        ELSE
          proposed_volume_accessibility := proposed_vol1^.accessibility;
        IFEND;

        PUSH menu_selections_p: [1 .. 2];
        menu_selections_p^ [1] := 'CONTINUE_INITV';
        menu_selections_p^ [2] := 'ABORT_INITV';
        IF volume_classification.volume_label_type = rmc$labeled_volume_type THEN
          PUSH menu_parameters_p: [1 .. 15];
          menu_parameters_p^ [1] := dmv$initialize_tape_volume.element_name;
          menu_parameters_p^ [2] := volume_classification.labeled.volume_identifier (1, 6);
          IF vol1_p <> NIL THEN
            menu_parameters_p^ [3] := vol1_p^.owner_identifier (1, 14);
          ELSE
            menu_parameters_p^ [3] := '*NO VOL1      *';
          IFEND;
          menu_parameters_p^ [2] (20, 1) := ':';
          menu_parameters_p^ [3] (20, 1) := ':';
          get_character_set_string (sequence_header^.character_set, menu_parameters_p^ [4]);
          menu_parameters_p^ [4] (20, 1) := ':';
          menu_parameters_p^ [5] := old_expiration_date (1, 10);
          menu_parameters_p^ [5] (20, 1) := ':';
          menu_parameters_p^ [6] := volume_classification.labeled.file_accessibility;
          menu_parameters_p^ [6] (20, 1) := ':';
          IF vol1_p <> NIL THEN
            menu_parameters_p^ [7] := vol1_p^.label_standard_version;
          ELSE
            menu_parameters_p^ [7] := ' ';
          IFEND;
          menu_parameters_p^ [7] (20, 1) := ':';
          menu_parameters_p^ [8] := volume_classification.labeled.volume_accessibility;
          menu_parameters_p^ [8] (20, 1) := ':';
          menu_parameters_p^ [9] := volume_list [1].recorded_vsn (1, 6);
          menu_parameters_p^ [10] := proposed_owner_identifier (1, 14);
          menu_parameters_p^ [11] := pvt [p$character_set].value^.keyword_value (1, 6);
          menu_parameters_p^ [12] := todays_date.iso;
          menu_parameters_p^ [13] := proposed_file_accessibility;
          menu_parameters_p^ [14] := proposed_label_standard_version (2, 1);
          menu_parameters_p^ [15] := proposed_volume_accessibility;
        ELSE
          PUSH menu_parameters_p: [1 .. 8];
          menu_parameters_p^ [1] := dmv$initialize_tape_volume.element_name;
          menu_parameters_p^ [2] := volume_list [1].recorded_vsn (1, 6);
          menu_parameters_p^ [3] := proposed_owner_identifier (1, 14);
          menu_parameters_p^ [4] := pvt [p$character_set].value^.keyword_value (1, 6);
          menu_parameters_p^ [5] := todays_date.iso;
          menu_parameters_p^ [6] := proposed_file_accessibility;
          menu_parameters_p^ [7] := proposed_label_standard_version (2, 1);
          menu_parameters_p^ [8] := proposed_volume_accessibility;
        IFEND;

        prompting_options := $rat$prompting_options [];

{ Post menu and see if operator wants to continue

        rap$prompt_via_menu (menu_module, menu_selections_p^, menu_parameters_p, prompting_options,
              selection_chosen, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        confirmed := (selection_chosen = 'CONTINUE_INITV');

      PROCEND post_appropriate_menu;
?? OLDTITLE, EJECT ??

      CONST
        fsp = 1,
        hl = 1,
        rl = 2,
        vi = 3;

      VAR
        confirmed: boolean,
        file_id: amt$file_identifier,
        local_status: ost$status,
        returned_attributes: fst$tla_returned_attributes,
        tape_attributes: array [fsp .. vi] of fst$attachment_option,
        tape_class: rmt$tape_class,
        unique_name: ost$unique_name,
        volume_classification: rmt$tape_volume_classification,
        volume_header_labels: ^SEQ ( * );

      confirmed := FALSE;

      pmp$generate_unique_name (unique_name, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      IF density = rmc$38000 THEN
        tape_class := rmc$mt18;
      ELSE
        tape_class := rmc$mt9;
      IFEND;

      proposed_vol1^.volume_identifier := volume_list [1].recorded_vsn;

      rmp$request_tape (unique_name.value, tape_class, density, rmc$write_ring, volume_list, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      osp$establish_block_exit_hndlr (^creblv_cond_handler);
      file_id := amv$nil_file_identifier;

      tape_attributes [fsp].selector := fsc$tape_attachment;
      tape_attributes [fsp].tape_attachment.selector := fsc$tape_file_set_position;
      tape_attributes [fsp].tape_attachment.tape_file_set_position.position := fsc$tape_beginning_of_set;
      tape_attributes [rl].selector := fsc$tape_attachment;
      tape_attributes [rl].tape_attachment.selector := fsc$tape_rewrite_labels;
      tape_attributes [rl].tape_attachment.tape_rewrite_labels := FALSE;
      tape_attributes [vi].selector := fsc$tape_attachment;
      tape_attributes [vi].tape_attachment.selector := fsc$tape_volume_initialization;
      tape_attributes [vi].tape_attachment.tape_volume_initialization :=
            attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization;

    /initialize/
      BEGIN
        fsp$open_file (unique_name.value, amc$record, ^tape_attributes, NIL, file_attr, NIL, NIL, file_id,
              local_status);
        IF local_status.normal THEN
          fsp$close_file (file_id, status);
          IF NOT status.normal THEN
            EXIT /initialize/;
          IFEND;
        IFEND;
        tape_attributes [hl].selector := fsc$tape_attachment;
        tape_attributes [hl].tape_attachment.selector := fsc$tape_header_labels;
        PUSH tape_attributes [hl].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]];
        tape_attributes [2].selector := fsc$null_attachment_option;
        tape_attributes [3].selector := fsc$null_attachment_option;
        fsp$get_tape_label_attributes (unique_name.value, fsc$tla_last_ansi_file_accessed, tape_attributes,
              returned_attributes, status);
        IF NOT status.normal THEN
          EXIT /initialize/;
        IFEND;
        IF fsc$tape_header_labels IN returned_attributes THEN
          volume_header_labels := tape_attributes [1].tape_attachment.tape_header_labels;
        ELSE
          volume_header_labels := NIL;
        IFEND;
        rmp$classify_tape_volume (local_status, volume_header_labels, volume_classification, status);
        IF status.normal THEN
          confirmed := TRUE;
          IF attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.volume_confirmation <>
                $fst$volume_confirmation_options [] THEN
            IF volume_classification.volume_label_type = rmc$labeled_volume_type THEN
              IF volume_classification.labeled.expired THEN
                IF fsc$confirm_expired_volume IN attachment_options^ [ta_vi].tape_attachment.
                      tape_volume_initialization^.volume_confirmation THEN
                  post_appropriate_menu (rmc$initv_exp_menu, volume_classification, confirmed, status);
                IFEND;
              ELSEIF fsc$confirm_unexpired_volume IN attachment_options^ [ta_vi].tape_attachment.
                    tape_volume_initialization^.volume_confirmation THEN
                post_appropriate_menu (rmc$initv_unexp_menu, volume_classification, confirmed, status);
              IFEND;
            ELSEIF volume_classification.volume_label_type = rmc$indeterminate_volume_type THEN
              IF fsc$confirm_unreadable_volume IN attachment_options^ [ta_vi].tape_attachment.
                    tape_volume_initialization^.volume_confirmation THEN
                post_appropriate_menu (rmc$initv_re_menu, volume_classification, confirmed, status);
              IFEND;
            ELSE { unlabeled }
              IF fsc$confirm_unlabeled_volume IN attachment_options^ [ta_vi].tape_attachment.
                    tape_volume_initialization^.volume_confirmation THEN
                post_appropriate_menu (rmc$initv_ul_menu, volume_classification, confirmed, status);
              IFEND;
            IFEND;
            IF NOT status.normal THEN
              EXIT /initialize/;
            IFEND;
          IFEND;
          IF confirmed THEN
            fsp$open_file (unique_name.value, amc$record, attachment_options, NIL, file_attr, NIL, NIL,
                  file_id, status);
            IF NOT status.normal THEN
              IF (attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.element =
                    osc$null_name) AND (status.condition = rme$volume_not_mounted) THEN
                osp$set_status_abnormal (rmc$resource_management_id, rme$robotic_mount_failure,
                      volume_list [1].external_vsn, status);
              IFEND;
              EXIT /initialize/;
            IFEND;
            initialized_volume_count := initialized_volume_count + 1;
            fsp$close_file (file_id, status);
          IFEND;
        IFEND;
      END /initialize/;

      osp$disestablish_cond_handler;

      IF confirmed THEN
        fsp$detach_file (unique_name.value, detachment_options, local_status);
      ELSE
        fsp$detach_file (unique_name.value, {detachment_options} NIL, local_status);
      IFEND;

      IF (NOT local_status.normal) AND status.normal THEN
        status := local_status;
      IFEND;

    PROCEND create_blank_labeled_volume;
?? OLDTITLE, EJECT ??

    CONST
      number_of_options = 11,
      ta_cs = 1,
      ta_fa = 2,
      ta_fsp = 3,
      ta_ii = 4,
      ta_lsv = 5,
      ta_oi = 6,
      ta_rl = 7,
      ta_rmg = 8,
      ta_va = 9,
      ta_vi = 10,
      teo = 11;

    VAR
      attachment_options: ^fst$attachment_options,
      blank_label_group: ^SEQ ( * ),
      blank_label_group_size: ost$positive_integers,
      block_descriptor: ^fst$tape_label_block_descriptor,
      default_attributes: array [1 .. 2] of fst$attachment_option,
      density: rmt$density,
      detachment_options: ^fst$detachment_options,
      eof1_block: ^fst$ansi_hdr1_label,
      eof2_block: ^fst$ansi_hdr2_label,
      evsn_node: ^clt$data_value,
      file_accessibility: string (1),
      file_attr: ^array [1 .. * ] of fst$file_cycle_attribute,
      hdr1_block: ^fst$ansi_hdr1_label,
      hdr2_block: ^fst$ansi_hdr2_label,
      initialized_volume_count: ost$non_negative_integers,
      int: clt$integer,
      ivc_value: ^clt$data_value,
      label_block: ^string ( * ),
      label_classification: fst$tape_label_classification,
      label_identifier: fst$tape_label_identifier,
      label_length: ost$positive_integers,
      label_locator: fst$tape_label_locator,
      list_node: ^clt$data_value,
      local_status: ost$status,
      proposed_vol1: ^fst$ansi_vol1_label,
      returned_default_attributes: fst$tla_returned_attributes,
      rvsn_node: ^clt$data_value,
      seq_ptr: ^SEQ ( * ),
      sequence_header: ^fst$tape_label_sequence_header,
      string_count: ost$non_negative_integers,
      trailer_labels: ^SEQ ( * ),
      volume_accessibility: string (1),
      volume_list: array [1 .. 1] of rmt$volume_descriptor,
      vsn_specified: boolean;

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

    IF pvt [p$unload_volume].value^.boolean_value.value THEN
      detachment_options := NIL;
    ELSE
      PUSH detachment_options: [1 .. 1];
      detachment_options^ [1].selector := fsc$do_unload_volume;
      detachment_options^ [1].unload_volume := FALSE;
    IFEND;

    vsn_specified := pvt [p$external_vsn].specified OR pvt [p$recorded_vsn].specified;
    determine_density (pvt [p$density], pvt [p$element], vsn_specified, density, status);
    IF NOT status.normal THEN
      IF status.condition = rme$vsn_density_mismatch THEN
        osp$append_status_parameter (osc$status_parameter_delimiter, ' or RECORDED_VSN', status);
      IFEND;
      RETURN;
    IFEND;
    IF (density <> rmc$38000) AND vsn_specified AND (NOT pvt [p$element].specified) THEN
      osp$set_status_abnormal ('RM', rme$vsn_density_mismatch, ' or RECORDED_VSN', status);
      RETURN;
    IFEND;

    PUSH attachment_options: [1 .. number_of_options];

    attachment_options^ [ta_cs].selector := fsc$tape_attachment;
    attachment_options^ [ta_cs].tape_attachment.selector := fsc$tape_character_set;
    IF pvt [p$character_set].value^.keyword_value = 'ASCII' THEN
      attachment_options^ [ta_cs].tape_attachment.tape_character_set := amc$ascii;
    ELSE
      attachment_options^ [ta_cs].tape_attachment.tape_character_set := amc$ebcdic;
    IFEND;

    IF pvt [p$file_accessibility].specified THEN
      IF pvt [p$file_accessibility].value^.kind = clc$name THEN
        file_accessibility := pvt [p$file_accessibility].value^.name_value;
      ELSE
        file_accessibility := pvt [p$file_accessibility].value^.string_value^;
      IFEND;
      rmp$validate_ansi_string (file_accessibility, attachment_options^ [ta_fa].tape_attachment.
            tape_file_accessibility, status);
      IF NOT status.normal THEN
        osp$append_status_parameter (osc$status_parameter_delimiter, ' for parameter FILE_ACCESSIBILITY',
              status);
        RETURN;
      IFEND;
      attachment_options^ [ta_fa].selector := fsc$tape_attachment;
      attachment_options^ [ta_fa].tape_attachment.selector := fsc$tape_file_accessibility;
    ELSE
      attachment_options^ [ta_fa].selector := fsc$null_attachment_option;
    IFEND;

    attachment_options^ [ta_fsp].selector := fsc$tape_attachment;
    attachment_options^ [ta_fsp].tape_attachment.selector := fsc$tape_file_set_position;
    attachment_options^ [ta_fsp].tape_attachment.tape_file_set_position.position := fsc$tape_beginning_of_set;

    IF pvt [p$implementation_identifier].specified THEN
      attachment_options^ [ta_ii].selector := fsc$tape_attachment;
      attachment_options^ [ta_ii].tape_attachment.selector := fsc$tape_implementation_id;
      IF pvt [p$implementation_identifier].value^.kind = clc$name THEN
        attachment_options^ [ta_ii].tape_attachment.tape_implementation_id :=
              pvt [p$implementation_identifier].value^.name_value;
      ELSEIF pvt [p$implementation_identifier].value^.kind = clc$string THEN
        attachment_options^ [ta_ii].tape_attachment.tape_implementation_id :=
              pvt [p$implementation_identifier].value^.string_value^;
      IFEND;
    ELSE
      attachment_options^ [ta_ii].selector := fsc$null_attachment_option;
    IFEND;

    attachment_options^ [ta_lsv].selector := fsc$tape_attachment;
    attachment_options^ [ta_lsv].tape_attachment.selector := fsc$tape_label_standard_version;
    attachment_options^ [ta_lsv].tape_attachment.tape_label_standard_version :=
          pvt [p$label_standard_version].value^.integer_value.value;

    IF pvt [p$owner_identifier].specified THEN
      IF pvt [p$removable_media_group].specified THEN
        osp$set_status_abnormal ('RM', rme$ambiguous_specifications, '', status);
        RETURN;
      IFEND;
      attachment_options^ [ta_oi].selector := fsc$tape_attachment;
      attachment_options^ [ta_oi].tape_attachment.selector := fsc$tape_owner_identification;
      IF pvt [p$owner_identifier].value^.kind = clc$keyword THEN { NONE }
        attachment_options^ [ta_oi].tape_attachment.tape_owner_identification := osc$null_name;
      ELSEIF pvt [p$owner_identifier].value^.kind = clc$name THEN
        attachment_options^ [ta_oi].tape_attachment.tape_owner_identification :=
              pvt [p$owner_identifier].value^.name_value;
      ELSEIF pvt [p$owner_identifier].value^.kind = clc$string THEN
        attachment_options^ [ta_oi].tape_attachment.tape_owner_identification :=
              pvt [p$owner_identifier].value^.string_value^;
      IFEND;
    ELSE
      attachment_options^ [ta_oi].selector := fsc$null_attachment_option;
    IFEND;

    IF pvt [p$removable_media_group].specified THEN
      attachment_options^ [ta_rmg].selector := fsc$tape_attachment;
      attachment_options^ [ta_rmg].tape_attachment.selector := fsc$tape_removable_media_group;
      attachment_options^ [ta_rmg].tape_attachment.tape_removable_media_group :=
            pvt [p$removable_media_group].value^.name_value;
    ELSE
      attachment_options^ [ta_rmg].selector := fsc$null_attachment_option;
    IFEND;

    attachment_options^ [ta_rl].selector := fsc$tape_attachment;
    attachment_options^ [ta_rl].tape_attachment.selector := fsc$tape_rewrite_labels;
    attachment_options^ [ta_rl].tape_attachment.tape_rewrite_labels := TRUE;

    IF pvt [p$volume_accessibility].specified THEN
      IF pvt [p$volume_accessibility].value^.kind = clc$name THEN
        volume_accessibility := pvt [p$volume_accessibility].value^.name_value;
      ELSE
        volume_accessibility := pvt [p$volume_accessibility].value^.string_value^;
      IFEND;
      rmp$validate_ansi_string (volume_accessibility, attachment_options^ [ta_va].tape_attachment.
            tape_volume_accessibility, status);
      IF NOT status.normal THEN
        osp$append_status_parameter (osc$status_parameter_delimiter, ' for parameter VOLUME_ACCESSIBILITY',
              status);
        RETURN;
      IFEND;
      attachment_options^ [ta_va].selector := fsc$tape_attachment;
      attachment_options^ [ta_va].tape_attachment.selector := fsc$tape_volume_accessibility;
    ELSE
      attachment_options^ [ta_va].selector := fsc$null_attachment_option;
    IFEND;

    attachment_options^ [ta_vi].selector := fsc$tape_attachment;
    attachment_options^ [ta_vi].tape_attachment.selector := fsc$tape_volume_initialization;
    PUSH attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization;
    IF NOT pvt [p$element].specified THEN
      attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.element := osc$null_name;
    IFEND;
    IF pvt [p$volume_confirmation].value^.kind = clc$keyword THEN
      IF pvt [p$volume_confirmation].value^.keyword_value = 'ALL' THEN
        attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.volume_confirmation :=
              -$fst$volume_confirmation_options [];
      ELSE { NONE }
        attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.volume_confirmation :=
              $fst$volume_confirmation_options [];
      IFEND;
    ELSE { list of key }
      attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.volume_confirmation :=
            $fst$volume_confirmation_options [];
      list_node := pvt [p$volume_confirmation].value;
      WHILE list_node <> NIL DO
        IF list_node^.element_value^.keyword_value = 'LABELED_EXPIRED' THEN
          attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.volume_confirmation :=
                attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.
                volume_confirmation + $fst$volume_confirmation_options [fsc$confirm_expired_volume];
        ELSEIF list_node^.element_value^.keyword_value = 'UNREADABLE_VOLUME' THEN
          attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.volume_confirmation :=
                attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.
                volume_confirmation + $fst$volume_confirmation_options [fsc$confirm_unreadable_volume];
        ELSEIF list_node^.element_value^.keyword_value = 'UNLABELED' THEN
          attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.volume_confirmation :=
                attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.
                volume_confirmation + $fst$volume_confirmation_options [fsc$confirm_unlabeled_volume];
        ELSEIF list_node^.element_value^.keyword_value = 'LABELED_UNEXPIRED' THEN
          attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.volume_confirmation :=
                attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.
                volume_confirmation + $fst$volume_confirmation_options [fsc$confirm_unexpired_volume];
        IFEND;
        list_node := list_node^.link;
      WHILEND;
    IFEND;

{ Build blank label group.

    IF pvt [p$labeling_convention].value^.kind = clc$keyword THEN
      IF pvt [p$labeling_convention].value^.keyword_value = 'ANSI' THEN
        IF pvt [p$file_accessibility].specified THEN
          osp$set_status_abnormal ('RM', rme$ansi_label_conflict, 'FILE_ACCESSIBILITY', status);
          RETURN;
        IFEND;
        IF pvt [p$implementation_identifier].specified THEN
          osp$set_status_abnormal ('RM', rme$ansi_label_conflict, 'IMPLEMENTATION_IDENTIFIER', status);
          RETURN;
        IFEND;
        blank_label_group_size := #SIZE (fst$tape_label_sequence_header) +
              (3 * #SIZE (fst$tape_label_block_descriptor)) + #SIZE (fst$ansi_vol1_label);
        PUSH blank_label_group: [[REP blank_label_group_size OF cell]];
        NEXT sequence_header IN blank_label_group;
        sequence_header^.character_set := attachment_options^ [ta_cs].tape_attachment.tape_character_set;
        sequence_header^.label_kinds := $fst$ansi_label_kinds [fsc$ansi_vol1_label_kind];
        sequence_header^.sequence_size := blank_label_group_size;
        sequence_header^.label_count := 3;
        NEXT block_descriptor IN blank_label_group;
        block_descriptor^.label_block_type := fsc$normal_tape_label_block;
        block_descriptor^.normal_label_actual_length := #SIZE (fst$ansi_vol1_label);
        block_descriptor^.normal_label_character_set := sequence_header^.character_set;
        block_descriptor^.normal_label_kind := fsc$ansi_vol1_label_kind;
        block_descriptor^.normal_label_transfer_length := #SIZE (fst$ansi_vol1_label);
        NEXT proposed_vol1 IN blank_label_group;
        proposed_vol1^ := vol1_label_default;
        NEXT block_descriptor IN blank_label_group;
        block_descriptor^.label_block_type := fsc$tapemark_tape_label_block;
        NEXT block_descriptor IN blank_label_group;
        block_descriptor^.label_block_type := fsc$tapemark_tape_label_block;

      ELSE { version 1, version 2, label_for_group, or label_for_user }
        default_attributes [1].selector := fsc$tape_attachment;
        default_attributes [1].tape_attachment.selector := fsc$tape_header_labels;
        PUSH default_attributes [1].tape_attachment.tape_header_labels:
              [[REP 1 OF fst$tape_label_sequence_header, REP 4 OF fst$tape_label_block_descriptor,
              REP 1 OF fst$ansi_vol1_label, REP 1 OF fst$ansi_hdr1_label, REP 1 OF fst$ansi_hdr2_label]];
        default_attributes [2].selector := fsc$tape_attachment;
        default_attributes [2].tape_attachment.selector := fsc$tape_trailer_labels;
        PUSH default_attributes [2].tape_attachment.tape_trailer_labels:
              [[REP 1 OF fst$tape_label_sequence_header, REP 4 OF fst$tape_label_block_descriptor,
              REP 1 OF fst$ansi_eof1_label, REP 1 OF fst$ansi_eof2_label]];
        fsp$default_tape_label_attrib (fsc$tla_system_default, default_attributes,
              returned_default_attributes, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
        blank_label_group_size := #SIZE (default_attributes [1].tape_attachment.tape_header_labels^) +
              #SIZE (default_attributes [2].tape_attachment.tape_trailer_labels^) -
              #SIZE (fst$tape_label_sequence_header) + (2 * #SIZE (fst$tape_label_block_descriptor));
        PUSH blank_label_group: [[REP blank_label_group_size OF cell]];
        NEXT seq_ptr: [[REP #SIZE (default_attributes [1].tape_attachment.tape_header_labels^) OF cell]] IN
              blank_label_group;
        seq_ptr^ := default_attributes [1].tape_attachment.tape_header_labels^;
        label_length := #SIZE (default_attributes [2].tape_attachment.tape_trailer_labels^) -
              #SIZE (fst$tape_label_sequence_header);
        NEXT seq_ptr: [[REP label_length OF cell]] IN blank_label_group;
        NEXT sequence_header IN default_attributes [2].tape_attachment.tape_trailer_labels;
        NEXT trailer_labels: [[REP label_length OF cell]] IN default_attributes [2].
              tape_attachment.tape_trailer_labels;
        seq_ptr^ := trailer_labels^;
        NEXT block_descriptor IN blank_label_group;
        block_descriptor^.label_block_type := fsc$tapemark_tape_label_block;
        NEXT block_descriptor IN blank_label_group;
        block_descriptor^.label_block_type := fsc$tapemark_tape_label_block;
        RESET blank_label_group;
        NEXT sequence_header IN blank_label_group;
        sequence_header^.label_kinds := $fst$ansi_label_kinds
              [fsc$ansi_vol1_label_kind, fsc$ansi_hdr1_label_kind, fsc$ansi_hdr2_label_kind,
              fsc$ansi_eof1_label_kind, fsc$ansi_eof2_label_kind];
        sequence_header^.sequence_size := blank_label_group_size;
        sequence_header^.label_count := 10;
        NEXT block_descriptor IN blank_label_group;
        NEXT proposed_vol1 IN blank_label_group;
        NEXT block_descriptor IN blank_label_group;
        NEXT hdr1_block IN blank_label_group;
        NEXT block_descriptor IN blank_label_group;
        NEXT hdr2_block IN blank_label_group;
        NEXT block_descriptor IN blank_label_group; {First Tapemark}
        NEXT block_descriptor IN blank_label_group; {Second Tapemark}
        NEXT block_descriptor IN blank_label_group;
        NEXT eof1_block IN blank_label_group;
        NEXT block_descriptor IN blank_label_group;
        NEXT eof2_block IN blank_label_group;

        proposed_vol1^.accessibility := ' ';
        {Ensure VE reserved fields in HDR2 are set to space to ensure "blank" classification
        hdr2_block^.label_string (16, 35) := ' ';
        eof2_block^.label_string (16, 35) := ' ';

        IF pvt [p$labeling_convention].value^.keyword_value = 'CDC_VERSION_ONE' THEN
          IF pvt [p$implementation_identifier].specified AND
                (attachment_options^ [ta_ii].tape_attachment.tape_implementation_id <>
                fsc$version_one_ve_identifier) THEN
            osp$set_status_abnormal ('RM', rme$lc_parameter_conflict, 'IMPLEMENTATION_IDENTIFIER', status);
            osp$append_status_parameter (osc$status_parameter_delimiter,
                  pvt [p$labeling_convention].value^.keyword_value, status);
            RETURN;
          IFEND;
          proposed_vol1^.implementation_identifier := fsc$version_one_ve_identifier;
          hdr1_block^.system_code := fsc$version_one_ve_identifier;
        ELSE
          IF pvt [p$implementation_identifier].specified AND
                (attachment_options^ [ta_ii].tape_attachment.tape_implementation_id <>
                fsc$version_two_ve_identifier) THEN
            osp$set_status_abnormal ('RM', rme$lc_parameter_conflict, 'IMPLEMENTATION_IDENTIFIER', status);
            osp$append_status_parameter (osc$status_parameter_delimiter,
                  pvt [p$labeling_convention].value^.keyword_value, status);
            RETURN;
          IFEND;
          IF pvt [p$labeling_convention].value^.keyword_value = 'LABEL_FOR_GROUP' THEN
            IF NOT pvt [p$removable_media_group].specified THEN
              osp$set_status_abnormal ('RM', rme$lc_value_requires_parameter, 'REMOVABLE_MEDIA_GROUP',
                    status);
              osp$append_status_parameter (osc$status_parameter_delimiter, 'LABEL_FOR_GROUP', status);
              RETURN;
            IFEND;
          ELSEIF pvt [p$labeling_convention].value^.keyword_value = 'LABEL_FOR_USER' THEN
            IF NOT pvt [p$owner_identifier].specified THEN
              osp$set_status_abnormal ('RM', rme$lc_value_requires_parameter, 'OWNER_IDENTIFIER', status);
              osp$append_status_parameter (osc$status_parameter_delimiter, 'LABEL_FOR_USER', status);
              RETURN;
            IFEND;
            IF pvt [p$volume_accessibility].specified THEN
              IF volume_accessibility <> 'A' THEN
                osp$set_status_abnormal ('RM', rme$lc_parameter_conflict, 'VOLUME_ACCESSIBILITY', status);
                osp$append_status_parameter (osc$status_parameter_delimiter, 'LABEL_FOR_USER', status);
                RETURN;
              IFEND;
            ELSE
              proposed_vol1^.accessibility := 'A';
            IFEND;
          IFEND;
        IFEND;
      IFEND;
      RESET blank_label_group;
      attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.blank_label_group :=
            blank_label_group;

    ELSE { list of string }
      string_count := 0;
      PUSH blank_label_group: [[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]];
      NEXT sequence_header IN blank_label_group;
      sequence_header^.character_set := attachment_options^ [ta_cs].tape_attachment.tape_character_set;
      sequence_header^.label_kinds := $fst$ansi_label_kinds [];
      list_node := pvt [p$labeling_convention].value;
      WHILE list_node <> NIL DO
        string_count := string_count + 1;
        IF list_node^.element_value^.string_value^ = '*' THEN { tapemark }
          NEXT block_descriptor IN blank_label_group;
          block_descriptor^.label_block_type := fsc$tapemark_tape_label_block;
        ELSE
          fsp$classify_tape_label (list_node^.element_value^.string_value^, label_classification);
          label_length := #SIZE (list_node^.element_value^.string_value^);
          NEXT block_descriptor IN blank_label_group;
          IF label_classification.valid_label THEN
            block_descriptor^.label_block_type := fsc$normal_tape_label_block;
            block_descriptor^.normal_label_actual_length := label_length;
            block_descriptor^.normal_label_character_set := label_classification.character_set;
            block_descriptor^.normal_label_kind := label_classification.label_kind;
            block_descriptor^.normal_label_transfer_length := label_length;
            sequence_header^.label_kinds := sequence_header^.label_kinds +
                  $fst$ansi_label_kinds [label_classification.label_kind];
          ELSE
            block_descriptor^.label_block_type := fsc$non_tape_label_block;
            block_descriptor^.non_label_actual_length := label_length;
            block_descriptor^.non_label_transfer_length := label_length;
          IFEND;
          NEXT label_block: [label_length] IN blank_label_group;
          label_block^ := list_node^.element_value^.string_value^;
        IFEND;
        list_node := list_node^.link;
      WHILEND;
      blank_label_group_size := i#current_sequence_position (blank_label_group);
      sequence_header^.sequence_size := blank_label_group_size;
      sequence_header^.label_count := string_count;
      PUSH attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.blank_label_group:
            [[REP blank_label_group_size OF cell]];
      RESET blank_label_group;
      i#move (blank_label_group, attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.
            blank_label_group, blank_label_group_size);

      label_identifier.location_method := fsc$tape_label_locate_by_kind;
      label_identifier.label_kind := fsc$ansi_vol1_label_kind;
      fsp$locate_tape_label (attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.
            blank_label_group, label_identifier, label_locator);
      IF label_locator.label_found THEN
        NEXT proposed_vol1 IN label_locator.label_block;
      ELSE
        osp$set_status_condition (ame$vol1_label_missing, status);
        RETURN;
      IFEND;
    IFEND;

    IF pvt [p$removable_media_group].specified THEN
      IF pvt [p$implementation_identifier].specified AND (attachment_options^ [ta_ii].tape_attachment.
            tape_implementation_id <> fsc$version_two_ve_identifier) THEN
        osp$set_status_abnormal ('RM', rme$rmg_parameter_conflict, 'IMPLEMENTATION_IDENTIFIER', status);
        RETURN;
      IFEND;
      IF pvt [p$volume_accessibility].specified THEN
        IF volume_accessibility <> 'A' THEN
          osp$set_status_abnormal ('RM', rme$rmg_parameter_conflict, 'VOLUME_ACCESSIBILITY', status);
          RETURN;
        IFEND;
      ELSE
        proposed_vol1^.accessibility := 'A';
      IFEND;
    IFEND;

    attachment_options^ [teo].selector := fsc$tape_error_options;
    attachment_options^ [teo].tape_error_options.perform_failure_recovery := FALSE;
    attachment_options^ [teo].tape_error_options.error_action := amc$terminate_file_access;

    PUSH file_attr: [1 .. 5];
    file_attr^ := init_file_attr;

    list_node := NIL;
    initialized_volume_count := 0;
    IF pvt [p$initialized_volume_count].specified THEN
      PUSH ivc_value;
      ivc_value^.kind := clc$integer;
      ivc_value^.integer_value.radix := 10;
      ivc_value^.integer_value.radix_specified := FALSE;
      ivc_value^.integer_value.value := initialized_volume_count;
      clp$change_variable (pvt [p$initialized_volume_count].variable^, ivc_value, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
    ELSE
      ivc_value := NIL;
    IFEND;

    IF (NOT pvt [p$recorded_vsn].specified) AND (NOT pvt [p$external_vsn].specified) THEN
      osp$set_status_abnormal ('CL', cle$required_parameter_omitted, 'RECORDED_VSN or EXTERNAL_VSN', status);
      RETURN;
    IFEND;

    IF pvt [p$recorded_vsn].specified THEN
      IF pvt [p$external_vsn].specified THEN
        evsn_node := pvt [p$external_vsn].value;
      ELSE
        evsn_node := NIL;
      IFEND;
      rvsn_node := pvt [p$recorded_vsn].value;
      WHILE (rvsn_node <> NIL) AND status.normal DO
        validate_vsn (rvsn_node^.element_value, volume_list [1].recorded_vsn, status);
        IF NOT status.normal THEN
          osp$append_status_parameter (osc$status_parameter_delimiter, 'RECORDED_VSN', status);
          RETURN;
        IFEND;
        rvsn_node := rvsn_node^.link;
        IF evsn_node = NIL THEN
          volume_list [1].external_vsn := volume_list [1].recorded_vsn;
        ELSE
          validate_vsn (evsn_node^.element_value, volume_list [1].external_vsn, status);
          IF NOT status.normal THEN
            osp$append_status_parameter (osc$status_parameter_delimiter, 'EXTERNAL_VSN', status);
            RETURN;
          IFEND;
          evsn_node := evsn_node^.link;
        IFEND;
        IF pvt [p$element].specified THEN
          IF list_node = NIL THEN { first time through loop or end of list }
            list_node := pvt [p$element].value;
          IFEND;
          attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.element :=
                list_node^.element_value^.name_value;
          list_node := list_node^.link;
        IFEND;
        create_blank_labeled_volume;
        IF ivc_value <> NIL THEN
          ivc_value^.integer_value.value := initialized_volume_count;
          clp$change_variable (pvt [p$initialized_volume_count].variable^, ivc_value, local_status);
          IF NOT local_status.normal and status.normal THEN
            status := local_status;
          IFEND;
        IFEND;
      WHILEND;
    ELSE { only evsn specified }
      evsn_node := pvt [p$external_vsn].value;
    IFEND;
    WHILE (evsn_node <> NIL) AND status.normal DO
      validate_vsn (evsn_node^.element_value, volume_list [1].external_vsn, status);
      IF NOT status.normal THEN
        osp$append_status_parameter (osc$status_parameter_delimiter, 'EXTERNAL_VSN', status);
        RETURN;
      IFEND;
      volume_list [1].recorded_vsn := volume_list [1].external_vsn;
      evsn_node := evsn_node^.link;
      IF pvt [p$element].specified THEN
        IF list_node = NIL THEN
          list_node := pvt [p$element].value;
        IFEND;
        attachment_options^ [ta_vi].tape_attachment.tape_volume_initialization^.element :=
              list_node^.element_value^.name_value;
        list_node := list_node^.link;
      IFEND;
      create_blank_labeled_volume;
      IF ivc_value <> NIL THEN
        ivc_value^.integer_value.value := initialized_volume_count;
        clp$change_variable (pvt [p$initialized_volume_count].variable^, ivc_value, local_status);
        IF NOT local_status.normal and status.normal THEN
          status := local_status;
        IFEND;
      IFEND;
    WHILEND;


  PROCEND rmp$create_blank_labeled_volume;
?? OLDTITLE ??
?? NEWTITLE := 'rmp$create_blank_unlabeled_vol', EJECT ??

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

{ PROCEDURE create_blank_unlabeled_volume, crebuv (
{   element, elements, e: list of name = $optional
{   external_vsn, evsn, external_vsns, ev: (BY_NAME) list of any of
{       name 1..6
{       string 1..6
{     anyend = $optional
{   density, d: (BY_NAME) key
{       mt9$800, mt9$1600, mt9$6250, mt18$38000
{     keyend = $optional
{   initialized_volume_count, ivc: (VAR, BY_NAME) integer = $optional
{   unload_volume, uv: (BY_NAME) boolean = true
{   volume_confirmation, vc: (BY_NAME) any of
{       key
{         all, none
{       keyend
{       list of key
{         (labeled_expired, le)
{         (unreadable_volume, uv)
{         (unlabeled, u)
{         (labeled_unexpired, lu)
{       keyend
{     anyend = osd$volume_confirmation, all
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 16] of clt$pdt_parameter_name,
      parameters: array [1 .. 7] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$union_type_qualifier,
          type_size_1: clt$type_specification_size,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
          type_size_2: clt$type_specification_size,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$string_type_qualifier,
          recend,
        recend,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type5: record
        header: clt$type_specification_header,
        default_value: string (4),
      recend,
      type6: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 8] of clt$keyword_specification,
          recend,
        recend,
        default_name: string (23),
        default_value: string (3),
      recend,
      type7: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [91, 7, 12, 9, 40, 27, 859],
    clc$command, 16, 7, 0, 0, 0, 1, 7, ''], [
    ['D                              ',clc$abbreviation_entry, 3],
    ['DENSITY                        ',clc$nominal_entry, 3],
    ['E                              ',clc$abbreviation_entry, 1],
    ['ELEMENT                        ',clc$nominal_entry, 1],
    ['ELEMENTS                       ',clc$alias_entry, 1],
    ['EV                             ',clc$abbreviation_entry, 2],
    ['EVSN                           ',clc$alias_entry, 2],
    ['EXTERNAL_VSN                   ',clc$nominal_entry, 2],
    ['EXTERNAL_VSNS                  ',clc$alias_entry, 2],
    ['INITIALIZED_VOLUME_COUNT       ',clc$nominal_entry, 4],
    ['IVC                            ',clc$abbreviation_entry, 4],
    ['STATUS                         ',clc$nominal_entry, 7],
    ['UNLOAD_VOLUME                  ',clc$nominal_entry, 5],
    ['UV                             ',clc$abbreviation_entry, 5],
    ['VC                             ',clc$abbreviation_entry, 6],
    ['VOLUME_CONFIRMATION            ',clc$nominal_entry, 6]],
    [
{ PARAMETER 1
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 21, clc$optional_parameter,
  0, 0],
{ PARAMETER 2
    [8, 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, 49, clc$optional_parameter,
  0, 0],
{ PARAMETER 3
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,
  clc$optional_parameter, 0, 0],
{ PARAMETER 4
    [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, 20,
  clc$optional_parameter, 0, 0],
{ PARAMETER 5
    [13, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 6
    [16, 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, 420,
  clc$optional_default_parameter, 23, 3],
{ PARAMETER 7
    [12, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 2
    [[1, 0, clc$list_type], [33, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$union_type], [[clc$name_type, clc$string_type],
      FALSE, 2],
      5, [[1, 0, clc$name_type], [1, 6]],
      8, [[1, 0, clc$string_type], [1, 6, FALSE]]
      ]
    ],
{ PARAMETER 3
    [[1, 0, clc$keyword_type], [4], [
    ['MT18$38000                     ', clc$nominal_entry, clc$normal_usage_entry, 4],
    ['MT9$1600                       ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['MT9$6250                       ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['MT9$800                        ', clc$nominal_entry, clc$normal_usage_entry, 1]]
    ],
{ PARAMETER 4
    [[1, 0, clc$integer_type], [clc$min_integer, clc$max_integer, 10]],
{ PARAMETER 5
    [[1, 0, clc$boolean_type],
    'true'],
{ PARAMETER 6
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 2]]
      ],
    319, [[1, 0, clc$list_type], [303, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$keyword_type], [8], [
        ['LABELED_EXPIRED                ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['LABELED_UNEXPIRED              ', clc$nominal_entry, clc$normal_usage_entry, 4],
        ['LE                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['LU                             ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
        ['U                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['UNLABELED                      ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['UNREADABLE_VOLUME              ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['UV                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2]]
        ]
      ]
    ,
    'OSD$VOLUME_CONFIRMATION',
    'all'],
{ PARAMETER 7
    [[1, 0, clc$status_type]]];

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

    CONST
      p$element = 1,
      p$external_vsn = 2,
      p$density = 3,
      p$initialized_volume_count = 4,
      p$unload_volume = 5,
      p$volume_confirmation = 6,
      p$status = 7;

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

?? NEWTITLE := '  create_blank_unlabeled_volume', EJECT ??

    PROCEDURE create_blank_unlabeled_volume;

?? NEWTITLE := '    crebuv_cond_handler', EJECT ??

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

        VAR
          ignore_status: ost$status;

        IF file_id <> amv$nil_file_identifier THEN
          fsp$close_file (file_id, ignore_status);
        IFEND;

        fsp$detach_file (unique_name.value, {detachment_options} NIL, ignore_status);

      PROCEND crebuv_cond_handler;
?? OLDTITLE ??
?? NEWTITLE := '    post_appropriate_menu', EJECT ??

      PROCEDURE post_appropriate_menu
        (    menu_module: pmt$program_name;
             volume_classification: rmt$tape_volume_classification;
         VAR confirmed: boolean;
         VAR status: ost$status);

        VAR
          dt: ost$date,
          hdr1_p: ^fst$ansi_hdr1_label,
          label_identifier: fst$tape_label_identifier,
          label_locator: fst$tape_label_locator,
          menu_selections_p: ^array [ * ] of ost$name,
          menu_parameters_p: rat$message_parameters,
          old_expiration_date: string (10),
          prompting_options: rat$prompting_options,
          selection_chosen: ost$name,
          sequence_header: ^fst$tape_label_sequence_header,
          todays_date: ost$date,
          vol1_p: ^fst$ansi_vol1_label;

        hdr1_p := NIL;
        old_expiration_date := '*NO HDR1*';
        vol1_p := NIL;

        PUSH menu_selections_p: [1 .. 2];
        menu_selections_p^ [1] := 'CONTINUE_CREBUV';
        menu_selections_p^ [2] := 'ABORT_CREBUV';
        IF volume_classification.volume_label_type = rmc$labeled_volume_type THEN
          pmp$get_date (osc$iso_date, todays_date, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;

          RESET tape_attributes [1].tape_attachment.tape_header_labels;
          NEXT sequence_header IN tape_attributes [1].tape_attachment.tape_header_labels;

          label_identifier.location_method := fsc$tape_label_locate_by_kind;
          label_identifier.label_kind := fsc$ansi_vol1_label_kind;
          fsp$locate_tape_label (tape_attributes [1].tape_attachment.tape_header_labels, label_identifier,
                label_locator);
          IF label_locator.label_found THEN
            NEXT vol1_p IN label_locator.label_block;
          IFEND;

          label_identifier.label_kind := fsc$ansi_hdr1_label_kind;
          fsp$locate_tape_label (tape_attributes [1].tape_attachment.tape_header_labels, label_identifier,
                label_locator);
          IF label_locator.label_found AND (label_locator.label_block <> NIL) THEN
            NEXT hdr1_p IN label_locator.label_block;
            IF hdr1_p^.expiration_date (2, 5) = '00000' THEN
              old_expiration_date := 'EXPIRED';
            ELSE
              dt.date_format := osc$ordinal_date;
              IF hdr1_p^.expiration_date (1) = ' ' THEN
                dt.ordinal (1, 2) := '19';
                dt.ordinal (3, 5) := hdr1_p^.expiration_date (2, 5);
              ELSE
                dt.ordinal (1, 1) := '2';
                dt.ordinal (2, 6) := hdr1_p^.expiration_date (1, 6);
              IFEND;
              pmp$change_legible_date_format (osc$iso_date, dt, local_status);
              IF local_status.normal THEN
                old_expiration_date := dt.iso;
              ELSE
                old_expiration_date := 'EXPIRED';
              IFEND;
            IFEND;
          IFEND;

          PUSH menu_parameters_p: [1 .. 8];
          menu_parameters_p^ [1] := dmv$initialize_tape_volume.element_name;
          menu_parameters_p^ [2] := volume_classification.labeled.volume_identifier (1, 6);
          IF vol1_p <> NIL THEN
            menu_parameters_p^ [3] := vol1_p^.owner_identifier (1, 14);
          ELSE
            menu_parameters_p^ [3] := '*NO VOL1*      ';
          IFEND;
          get_character_set_string (sequence_header^.character_set, menu_parameters_p^ [4]);
          menu_parameters_p^ [5] := old_expiration_date (1, 10);
          menu_parameters_p^ [6] := volume_classification.labeled.file_accessibility;
          IF vol1_p <> NIL THEN
            menu_parameters_p^ [7] := vol1_p^.label_standard_version;
          ELSE
            menu_parameters_p^ [7] := ' ';
          IFEND;
          menu_parameters_p^ [8] := volume_classification.labeled.volume_accessibility;
        ELSE
          PUSH menu_parameters_p: [1 .. 1];
          menu_parameters_p^ [1] := dmv$initialize_tape_volume.element_name;
        IFEND;

        prompting_options := $rat$prompting_options [];

{ Post menu and see if operator wants to continue

        rap$prompt_via_menu (menu_module, menu_selections_p^, menu_parameters_p, prompting_options,
              selection_chosen, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        confirmed := (selection_chosen = 'CONTINUE_CREBUV');

      PROCEND post_appropriate_menu;
?? OLDTITLE, EJECT ??

      VAR
        confirmed: boolean,
        file_id: amt$file_identifier,
        local_status: ost$status,
        returned_attributes: fst$tla_returned_attributes,
        tape_attributes: array [1 .. 1] of fst$attachment_option,
        tape_class: rmt$tape_class,
        unique_name: ost$unique_name,
        volume_classification: rmt$tape_volume_classification,
        volume_header_labels: ^SEQ ( * );

      confirmed := FALSE;

      pmp$generate_unique_name (unique_name, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      IF density = rmc$38000 THEN
        tape_class := rmc$mt18;
      ELSE
        tape_class := rmc$mt9;
      IFEND;

      rmp$request_tape (unique_name.value, tape_class, density, rmc$write_ring, volume_list, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      osp$establish_block_exit_hndlr (^crebuv_cond_handler);
      file_id := amv$nil_file_identifier;

    /initialize/
      BEGIN
        fsp$open_file (unique_name.value, amc$record, attachment_options, NIL, file_attr, NIL, NIL, file_id,
              local_status);
        IF local_status.normal THEN
          fsp$close_file (file_id, status);
          IF NOT status.normal THEN
            EXIT /initialize/;
          IFEND;
        IFEND;
        tape_attributes [1].selector := fsc$tape_attachment;
        tape_attributes [1].tape_attachment.selector := fsc$tape_header_labels;
        PUSH tape_attributes [1].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]];
        fsp$get_tape_label_attributes (unique_name.value, fsc$tla_last_ansi_file_accessed, tape_attributes,
              returned_attributes, status);
        IF NOT status.normal THEN
          EXIT /initialize/;
        IFEND;
        IF fsc$tape_header_labels IN returned_attributes THEN
          volume_header_labels := tape_attributes [1].tape_attachment.tape_header_labels;
        ELSE
          volume_header_labels := NIL;
        IFEND;
        rmp$classify_tape_volume (local_status, volume_header_labels, volume_classification, status);
        IF status.normal THEN
          confirmed := TRUE;
          IF attachment_options^ [vi].tape_attachment.tape_volume_initialization^.volume_confirmation <>
                $fst$volume_confirmation_options [] THEN
            IF volume_classification.volume_label_type = rmc$labeled_volume_type THEN
              IF volume_classification.labeled.expired THEN
                IF fsc$confirm_expired_volume IN attachment_options^ [vi].tape_attachment.
                      tape_volume_initialization^.volume_confirmation THEN
                  post_appropriate_menu (rmc$crebuv_le_menu, volume_classification, confirmed, status);
                IFEND;
              ELSEIF fsc$confirm_unexpired_volume IN attachment_options^ [vi].tape_attachment.
                    tape_volume_initialization^.volume_confirmation THEN
                post_appropriate_menu (rmc$crebuv_lu_menu, volume_classification, confirmed, status);
              IFEND;
            ELSEIF volume_classification.volume_label_type = rmc$indeterminate_volume_type THEN
              IF fsc$confirm_unreadable_volume IN attachment_options^ [vi].tape_attachment.
                    tape_volume_initialization^.volume_confirmation THEN
                post_appropriate_menu (rmc$crebuv_urv_menu, volume_classification, confirmed, status);
              IFEND;
            ELSE { unlabeled }
              IF volume_classification.blank THEN
                post_appropriate_menu (rmc$crebuv_buv_menu, volume_classification, confirmed, status);
              ELSEIF fsc$confirm_unlabeled_volume IN attachment_options^ [vi].tape_attachment.
                    tape_volume_initialization^.volume_confirmation THEN
                post_appropriate_menu (rmc$crebuv_uv_menu, volume_classification, confirmed, status);
              IFEND;
            IFEND;
            IF NOT status.normal THEN
              EXIT /initialize/;
            IFEND;
          IFEND;
          IF confirmed THEN
            attachment_options^ [rl].tape_attachment.tape_rewrite_labels := TRUE;
            fsp$open_file (unique_name.value, amc$record, attachment_options, NIL, file_attr, NIL, NIL,
                  file_id, status);
            IF NOT status.normal THEN
              EXIT /initialize/;
            IFEND;
            initialized_volume_count := initialized_volume_count + 1;
            attachment_options^ [rl].tape_attachment.tape_rewrite_labels := FALSE;
            fsp$close_file (file_id, status);
          IFEND;
        IFEND;
      END /initialize/;

      osp$disestablish_cond_handler;

      IF confirmed THEN
        fsp$detach_file (unique_name.value, detachment_options, local_status);
      ELSE
        fsp$detach_file (unique_name.value, {detachment_options} NIL, local_status);
      IFEND;

      IF (NOT local_status.normal) AND status.normal THEN
        status := local_status;
      IFEND;

    PROCEND create_blank_unlabeled_volume;
?? OLDTITLE, EJECT ??

    CONST
      fsp = 1,
      rl = 2,
      vi = 3,

      number_of_options = 3;

    VAR
      attachment_options: ^fst$attachment_options,
      block_descriptor: ^fst$tape_label_block_descriptor,
      density: rmt$density,
      detachment_options: ^fst$detachment_options,
      evsn_node: ^clt$data_value,
      file_attr: ^array [1 .. * ] of fst$file_cycle_attribute,
      initialized_volume_count: ost$non_negative_integers,
      ivc_value: ^clt$data_value,
      list_node: ^clt$data_value,
      sequence_header: ^fst$tape_label_sequence_header,
      tapemark: 1 .. 3,
      volume_list: array [1 .. 1] of rmt$volume_descriptor;

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

    IF pvt [p$unload_volume].value^.boolean_value.value THEN
      detachment_options := NIL;
    ELSE
      PUSH detachment_options: [1 .. 1];
      detachment_options^ [1].selector := fsc$do_unload_volume;
      detachment_options^ [1].unload_volume := FALSE;
    IFEND;

    determine_density (pvt [p$density], pvt [p$element], pvt [p$external_vsn].specified, density, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    IF (density <> rmc$38000) AND pvt [p$external_vsn].specified AND (NOT pvt [p$element].specified) THEN
      osp$set_status_condition (rme$vsn_density_mismatch, status);
      RETURN;
    IFEND;

    PUSH attachment_options: [1 .. number_of_options];

    attachment_options^ [fsp].selector := fsc$tape_attachment;
    attachment_options^ [fsp].tape_attachment.selector := fsc$tape_file_set_position;
    attachment_options^ [fsp].tape_attachment.tape_file_set_position.position := fsc$tape_beginning_of_set;
    attachment_options^ [rl].selector := fsc$tape_attachment;
    attachment_options^ [rl].tape_attachment.selector := fsc$tape_rewrite_labels;
    attachment_options^ [rl].tape_attachment.tape_rewrite_labels := FALSE;
    attachment_options^ [vi].selector := fsc$tape_attachment;
    attachment_options^ [vi].tape_attachment.selector := fsc$tape_volume_initialization;
    PUSH attachment_options^ [vi].tape_attachment.tape_volume_initialization;

    PUSH attachment_options^ [vi].tape_attachment.tape_volume_initialization^.blank_label_group:
          [[REP 1 OF fst$tape_label_sequence_header, REP 3 OF fst$tape_label_block_descriptor]];
    NEXT sequence_header IN attachment_options^ [vi].tape_attachment.tape_volume_initialization^.
          blank_label_group;
    sequence_header^.character_set := amc$ascii;
    sequence_header^.label_kinds := $fst$ansi_label_kinds [];
    sequence_header^.sequence_size := #SIZE (fst$tape_label_sequence_header) +
          (3 * #SIZE (fst$tape_label_block_descriptor));
    sequence_header^.label_count := 3;
    FOR tapemark := 1 TO 3 DO
      NEXT block_descriptor IN attachment_options^ [vi].tape_attachment.tape_volume_initialization^.
            blank_label_group;
      block_descriptor^.label_block_type := fsc$tapemark_tape_label_block;
    FOREND;

    IF NOT pvt [p$element].specified THEN
      attachment_options^ [vi].tape_attachment.tape_volume_initialization^.element := osc$null_name;
    IFEND;

    IF pvt [p$volume_confirmation].value^.kind = clc$keyword THEN
      IF pvt [p$volume_confirmation].value^.keyword_value = 'ALL' THEN
        attachment_options^ [vi].tape_attachment.tape_volume_initialization^.volume_confirmation :=
              -$fst$volume_confirmation_options [];
      ELSE
        attachment_options^ [vi].tape_attachment.tape_volume_initialization^.volume_confirmation :=
              $fst$volume_confirmation_options [];
      IFEND;
    ELSE { list of key }
      attachment_options^ [vi].tape_attachment.tape_volume_initialization^.volume_confirmation :=
            $fst$volume_confirmation_options [];
      list_node := pvt [p$volume_confirmation].value;
      WHILE list_node <> NIL DO
        IF list_node^.element_value^.keyword_value = 'LABELED_EXPIRED' THEN
          attachment_options^ [vi].tape_attachment.tape_volume_initialization^.volume_confirmation :=
                attachment_options^ [vi].tape_attachment.tape_volume_initialization^.volume_confirmation +
                $fst$volume_confirmation_options [fsc$confirm_expired_volume];
        ELSEIF list_node^.element_value^.keyword_value = 'UNREADABLE_VOLUME' THEN
          attachment_options^ [vi].tape_attachment.tape_volume_initialization^.volume_confirmation :=
                attachment_options^ [vi].tape_attachment.tape_volume_initialization^.volume_confirmation +
                $fst$volume_confirmation_options [fsc$confirm_unreadable_volume];
        ELSEIF list_node^.element_value^.keyword_value = 'UNLABELED' THEN
          attachment_options^ [vi].tape_attachment.tape_volume_initialization^.volume_confirmation :=
                attachment_options^ [vi].tape_attachment.tape_volume_initialization^.volume_confirmation +
                $fst$volume_confirmation_options [fsc$confirm_unlabeled_volume];
        ELSEIF list_node^.element_value^.keyword_value = 'LABELED_UNEXPIRED' THEN
          attachment_options^ [vi].tape_attachment.tape_volume_initialization^.volume_confirmation :=
                attachment_options^ [vi].tape_attachment.tape_volume_initialization^.volume_confirmation +
                $fst$volume_confirmation_options [fsc$confirm_unexpired_volume];
        IFEND;
        list_node := list_node^.link;
      WHILEND;
    IFEND;

    PUSH file_attr: [1 .. 5];
    file_attr^ := init_file_attr;

    list_node := NIL;
    initialized_volume_count := 0;

    IF pvt [p$external_vsn].specified THEN
      evsn_node := pvt [p$external_vsn].value;
      WHILE evsn_node <> NIL DO
        validate_vsn (evsn_node^.element_value, volume_list [1].external_vsn, status);
        IF NOT status.normal THEN
          osp$append_status_parameter (osc$status_parameter_delimiter, 'EXTERNAL_VSN', status);
          RETURN;
        IFEND;
        volume_list [1].recorded_vsn := volume_list [1].external_vsn;
        evsn_node := evsn_node^.link;
        IF pvt [p$element].specified THEN
          IF list_node = NIL THEN
            list_node := pvt [p$element].value;
          IFEND;
          attachment_options^ [3].tape_attachment.tape_volume_initialization^.element :=
                list_node^.element_value^.name_value;
          list_node := list_node^.link;
        IFEND;
        create_blank_unlabeled_volume;
      WHILEND;
    ELSE { element must have been specified or else an error would have occurred earlier }
      list_node := pvt [p$element].value;
      WHILE list_node <> NIL DO
        attachment_options^ [3].tape_attachment.tape_volume_initialization^.element :=
              list_node^.element_value^.name_value;
        volume_list [1].external_vsn := rmc$unspecified_vsn;
        volume_list [1].recorded_vsn := rmc$unspecified_vsn;
        create_blank_unlabeled_volume;
        list_node := list_node^.link;
      WHILEND;
    IFEND;

    IF status.normal AND pvt [p$initialized_volume_count].specified THEN
      PUSH ivc_value;
      ivc_value^.kind := clc$integer;
      ivc_value^.integer_value.value := initialized_volume_count;
      ivc_value^.integer_value.radix := 10;
      ivc_value^.integer_value.radix_specified := FALSE;
      clp$change_variable (pvt [p$initialized_volume_count].variable^, ivc_value, status);
    IFEND;

  PROCEND rmp$create_blank_unlabeled_vol;
?? OLDTITLE ??
?? NEWTITLE := 'determine_density', EJECT ??

  PROCEDURE [INLINE] determine_density
    (    density_parameter: clt$parameter_value;
         element_parameter: clt$parameter_value;
         vsn_specified: boolean;
     VAR density: rmt$density;
     VAR status: ost$status);

    VAR
      candidate_densities: cmt$densities,
      element: cmt$element_descriptor,
      element_definition: ^cmt$element_definition,
      element_info: array [1 .. 2] of cmt$element_info_item,
      element_name: cmt$element_name,
      list_node: ^clt$data_value,
      unused_iou_name: cmt$element_name;

    IF density_parameter.specified THEN
      IF density_parameter.value^.keyword_value = 'MT9$800' THEN
        candidate_densities := $cmt$densities [rmc$800];
      ELSEIF density_parameter.value^.keyword_value = 'MT9$1600' THEN
        candidate_densities := $cmt$densities [rmc$1600];
      ELSEIF density_parameter.value^.keyword_value = 'MT9$6250' THEN
        candidate_densities := $cmt$densities [rmc$6250];
      ELSEIF density_parameter.value^.keyword_value = 'MT18$38000' THEN
        candidate_densities := $cmt$densities [rmc$38000];
      IFEND;
    ELSEIF NOT element_parameter.specified AND vsn_specified THEN
      osp$set_status_abnormal ('RM', rme$vsn_density_mismatch, ' or RECORDED_VSN', status);
      RETURN;
    ELSE
      candidate_densities := -$cmt$densities [];
    IFEND;
    IF element_parameter.specified THEN
      list_node := element_parameter.value;
      WHILE list_node <> NIL DO
        element_name := list_node^.element_value^.name_value;
        PUSH element_definition;
        cmp$get_element_r3 (element_name, unused_iou_name, element_definition, status);
        IF NOT status.normal OR (element_definition^.element_type <> cmc$storage_device_element) THEN
          osp$set_status_abnormal (cmc$configuration_management_id, cme$lcm_element_not_found, element_name,
                status);
          RETURN;
        IFEND;

        element.element_type := element_definition^.element_type;
        element.peripheral_descriptor.use_logical_identification := TRUE;
        element.peripheral_descriptor.element_name := element_name;
        element_info [1].selector := cmc$device_class;
        element_info [2].selector := cmc$element_capability;
        cmp$get_element_information (element, element_info, status);
        IF NOT status.normal OR (element_info [1].device_class <> rmc$magnetic_tape_device) THEN
          osp$set_status_abnormal (cmc$configuration_management_id, cme$lcm_element_not_found, element_name,
                status);
          RETURN;
        IFEND;
        candidate_densities := candidate_densities * element_info [2].element_capability.densities;
        list_node := list_node^.link;
      WHILEND;
    ELSEIF NOT vsn_specified THEN
      osp$set_status_condition (rme$element_or_vsn_required, status);
      RETURN;
    IFEND;

    IF candidate_densities = $cmt$densities [] THEN
      osp$set_status_condition (rme$supported_densities_differ, status);
      RETURN;
    IFEND;

    IF rmc$38000 IN candidate_densities THEN
      density := rmc$38000;
    ELSEIF rmc$6250 IN candidate_densities THEN
      density := rmc$6250;
    ELSEIF rmc$1600 IN candidate_densities THEN
      density := rmc$1600;
    ELSE
      density := rmc$800;
    IFEND;

  PROCEND determine_density;
?? OLDTITLE ??
?? NEWTITLE := 'get_character_set_string', EJECT ??

  PROCEDURE [INLINE] get_character_set_string
    (    character_set: amt$internal_code;
     VAR menu_parameter: rat$message_parameter);

    IF character_set = amc$ascii THEN
      menu_parameter := 'ASCII';
    ELSEIF character_set = amc$ebcdic THEN
      menu_parameter := 'EBCDIC';
    ELSE
      menu_parameter := ' ';
    IFEND;

  PROCEND get_character_set_string;
?? OLDTITLE ??
?? NEWTITLE := 'validate_vsn', EJECT ??

  PROCEDURE [INLINE] validate_vsn
    (    value: ^clt$data_value;
     VAR vsn: rmt$recorded_vsn;
     VAR status: ost$status);

    IF value^.kind = clc$string THEN
      vsn := value^.string_value^;
    ELSEIF value^.kind = clc$name THEN
      vsn := value^.name_value;
    IFEND;
    rmp$validate_ansi_string (vsn, vsn, status);
    IF NOT status.normal OR (vsn = rmc$unspecified_vsn) THEN
      osp$set_status_abnormal (rmc$resource_management_id, cle$improper_vsn_value, vsn, status);
    IFEND;

  PROCEND validate_vsn;
?? OLDTITLE ??
MODEND rmm$create_blank_volumes;
