?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Resource Manager : Request Mass Storage Command' ??
MODULE rmm$request_mass_storage_cmd;
?? NEWTITLE := 'Global Declarations', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc fse$system_conditions
*copyc rme$request_mass_storage
?? POP ??
*copyc clp$evaluate_parameters
*copyc clp$trimmed_string_size
*copyc clp$verify_time_increment
*copyc cmp$get_sys_dev_rec_vsn
*copyc fsp$create_file
*copyc osp$set_status_abnormal
*copyc pmp$compute_date_time
*copyc pmp$get_compact_date_time
*copyc pmp$verify_compact_date
*copyc pmp$verify_compact_time

?? TITLE := 'PROCEDURE [XDCL, #GATE] rmp$convert_keyword_to_class', EJECT ??

  PROCEDURE [XDCL, #GATE] rmp$convert_keyword_to_class
    (    keyword: ost$name;
     VAR file_class: rmt$mass_storage_class;
     VAR status: ost$status);

    status.normal := TRUE;

    IF (keyword = 'PRODUCT') THEN
      file_class := 'P';
    ELSEIF (keyword = 'USER_PERMANENT_FILE') THEN
      file_class := 'M';
    ELSEIF (keyword = 'SERVICE_CRITICAL_PRODUCT') OR (keyword = 'SYSTEM_PERMANENT_FILE') THEN
      file_class := 'K';
    ELSEIF keyword = 'SYSTEM_CRITICAL_FILE' THEN
      file_class := 'Q';
    ELSEIF keyword = 'TEMPORARY_FILE' THEN
      file_class := 'N';
    ELSE
      osp$set_status_abnormal (rmc$resource_management_id, rme$invalid_keyword, keyword, status);
      RETURN;
    IFEND;

  PROCEND rmp$convert_keyword_to_class;

?? TITLE := 'PROCEDURE [XDCL, #GATE] rmp$request_mass_storage_cmd', EJECT ??

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

{ PROCEDURE (rmm$reqms) request_mass_storage, reqms (
{   file, f: file = $required
{   allocation_size, as: (BY_NAME) integer 16384..16777215 = $optional
{   file_class, fc: (BY_NAME) any of
{       key
{         product
{         (service_critical_product, scp)
{         (system_critical_file, scf)
{         (system_permanent_file, spf)
{         (temporary_file, tf)
{         (user_permanent_file, upf)
{       keyend
{       name 1..1
{     anyend = $optional
{   initial_volume, iv: (BY_NAME) any of
{       key
{         (system_device, sd)
{       keyend
{       name 1..6
{     anyend = $optional
{   retention, r: (BY_NAME) any of
{       integer pfc$minimum_retention..pfc$maximum_retention
{       date
{       date_time
{       time_increment
{     anyend = $optional
{   retrieve_option, ro: (BY_NAME, ADVANCED) key
{       (always_retrieve, ar)
{       (explicit_retrieve_only, ero)
{       (administrative_retrieve_only, aro)
{     keyend = $optional
{   shared_queue, sq: (BY_NAME, ADVANCED) key
{       site_01, site_02, site_03, site_04, site_05, site_06, site_07, site_08, site_09, site_10, site_11
{       site_12, site_13, site_14, site_15, site_16, site_17, site_18, site_19, site_20, site_21, site_22
{       site_23, site_24, site_25
{     keyend = $optional
{   site_archive_option, sao: (BY_NAME, ADVANCED) any of
{       integer 1..255
{       key
{         null
{       keyend
{     anyend = $optional
{   site_backup_option, sbo: (BY_NAME, ADVANCED) any of
{       integer 1..255
{       key
{         null
{       keyend
{     anyend = $optional
{   site_release_option, sro: (BY_NAME, ADVANCED) any of
{       integer 1..255
{       key
{         null
{       keyend
{     anyend = $optional
{   transfer_size, ts: (BY_NAME) integer 16384..2147483648 = $optional
{   volume_overflow_allowed, voa: (BY_NAME) boolean = TRUE
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 25] of clt$pdt_parameter_name,
      parameters: array [1 .. 13] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 11] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 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$name_type_qualifier,
        recend,
      recend,
      type5: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$date_time_type_qualifier,
        recend,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$date_time_type_qualifier,
        recend,
        type_size_4: clt$type_specification_size,
        element_type_spec_4: record
          header: clt$type_specification_header,
        recend,
      recend,
      type6: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 6] of clt$keyword_specification,
      recend,
      type7: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 25] of clt$keyword_specification,
      recend,
      type8: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
      recend,
      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$integer_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
      recend,
      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,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
      recend,
      type11: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type12: record
        header: clt$type_specification_header,
        default_value: string (4),
      recend,
      type13: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [97, 1, 20, 15, 9, 41, 540],
    clc$command, 25, 13, 1, 5, 0, 0, 13, 'RMM$REQMS'], [
    ['ALLOCATION_SIZE                ',clc$nominal_entry, 2],
    ['AS                             ',clc$abbreviation_entry, 2],
    ['F                              ',clc$abbreviation_entry, 1],
    ['FC                             ',clc$abbreviation_entry, 3],
    ['FILE                           ',clc$nominal_entry, 1],
    ['FILE_CLASS                     ',clc$nominal_entry, 3],
    ['INITIAL_VOLUME                 ',clc$nominal_entry, 4],
    ['IV                             ',clc$abbreviation_entry, 4],
    ['R                              ',clc$abbreviation_entry, 5],
    ['RETENTION                      ',clc$nominal_entry, 5],
    ['RETRIEVE_OPTION                ',clc$nominal_entry, 6],
    ['RO                             ',clc$abbreviation_entry, 6],
    ['SAO                            ',clc$abbreviation_entry, 8],
    ['SBO                            ',clc$abbreviation_entry, 9],
    ['SHARED_QUEUE                   ',clc$nominal_entry, 7],
    ['SITE_ARCHIVE_OPTION            ',clc$nominal_entry, 8],
    ['SITE_BACKUP_OPTION             ',clc$nominal_entry, 9],
    ['SITE_RELEASE_OPTION            ',clc$nominal_entry, 10],
    ['SQ                             ',clc$abbreviation_entry, 7],
    ['SRO                            ',clc$abbreviation_entry, 10],
    ['STATUS                         ',clc$nominal_entry, 13],
    ['TRANSFER_SIZE                  ',clc$nominal_entry, 11],
    ['TS                             ',clc$abbreviation_entry, 11],
    ['VOA                            ',clc$abbreviation_entry, 12],
    ['VOLUME_OVERFLOW_ALLOWED        ',clc$nominal_entry, 12]],
    [
{ PARAMETER 1
    [5, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$required_parameter, 0
  , 0],
{ PARAMETER 2
    [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, 20, clc$optional_parameter,
  0, 0],
{ PARAMETER 3
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 439,
  clc$optional_parameter, 0, 0],
{ PARAMETER 4
    [7, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 106,
  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, 61, clc$optional_parameter,
  0, 0],
{ PARAMETER 6
    [11, clc$advanced_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 229,
  clc$optional_parameter, 0, 0],
{ PARAMETER 7
    [15, clc$advanced_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 932,
  clc$optional_parameter, 0, 0],
{ PARAMETER 8
    [16, clc$advanced_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 84, clc$optional_parameter,
  0, 0],
{ PARAMETER 9
    [17, clc$advanced_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 84, clc$optional_parameter,
  0, 0],
{ PARAMETER 10
    [18, clc$advanced_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 84, clc$optional_parameter,
  0, 0],
{ PARAMETER 11
    [22, 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, 20, clc$optional_parameter,
  0, 0],
{ PARAMETER 12
    [25, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 13
    [21, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$file_type]],
{ PARAMETER 2
    [[1, 0, clc$integer_type], [16384, 16777215, 10]],
{ PARAMETER 3
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type],
    FALSE, 2],
    414, [[1, 0, clc$keyword_type], [11], [
      ['PRODUCT                        ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['SCF                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['SCP                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['SERVICE_CRITICAL_PRODUCT       ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['SPF                            ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['SYSTEM_CRITICAL_FILE           ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['SYSTEM_PERMANENT_FILE          ', clc$nominal_entry, clc$normal_usage_entry, 4],
      ['TEMPORARY_FILE                 ', clc$nominal_entry, clc$normal_usage_entry, 5],
      ['TF                             ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
      ['UPF                            ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
      ['USER_PERMANENT_FILE            ', clc$nominal_entry, clc$normal_usage_entry, 6]]
      ],
    5, [[1, 0, clc$name_type], [1, 1]]
    ],
{ PARAMETER 4
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['SD                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['SYSTEM_DEVICE                  ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    5, [[1, 0, clc$name_type], [1, 6]]
    ],
{ PARAMETER 5
    [[1, 0, clc$union_type], [[clc$date_time_type, clc$integer_type, clc$time_increment_type],
    FALSE, 4],
    20, [[1, 0, clc$integer_type], [pfc$minimum_retention, pfc$maximum_retention, 10]],
    5, [[1, 0, clc$date_time_type], [$clt$date_and_or_time [clc$date], $clt$date_time_tenses [clc$past,
  clc$present, clc$future]]],
    5, [[1, 0, clc$date_time_type], [$clt$date_and_or_time [clc$date, clc$time], $clt$date_time_tenses [
  clc$past, clc$present, clc$future]]],
    3, [[1, 0, clc$time_increment_type]]
    ],
{ PARAMETER 6
    [[1, 0, clc$keyword_type], [6], [
    ['ADMINISTRATIVE_RETRIEVE_ONLY   ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['ALWAYS_RETRIEVE                ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['AR                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['ARO                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['ERO                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['EXPLICIT_RETRIEVE_ONLY         ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ],
{ PARAMETER 7
    [[1, 0, clc$keyword_type], [25], [
    ['SITE_01                        ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['SITE_02                        ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['SITE_03                        ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['SITE_04                        ', clc$nominal_entry, clc$normal_usage_entry, 4],
    ['SITE_05                        ', clc$nominal_entry, clc$normal_usage_entry, 5],
    ['SITE_06                        ', clc$nominal_entry, clc$normal_usage_entry, 6],
    ['SITE_07                        ', clc$nominal_entry, clc$normal_usage_entry, 7],
    ['SITE_08                        ', clc$nominal_entry, clc$normal_usage_entry, 8],
    ['SITE_09                        ', clc$nominal_entry, clc$normal_usage_entry, 9],
    ['SITE_10                        ', clc$nominal_entry, clc$normal_usage_entry, 10],
    ['SITE_11                        ', clc$nominal_entry, clc$normal_usage_entry, 11],
    ['SITE_12                        ', clc$nominal_entry, clc$normal_usage_entry, 12],
    ['SITE_13                        ', clc$nominal_entry, clc$normal_usage_entry, 13],
    ['SITE_14                        ', clc$nominal_entry, clc$normal_usage_entry, 14],
    ['SITE_15                        ', clc$nominal_entry, clc$normal_usage_entry, 15],
    ['SITE_16                        ', clc$nominal_entry, clc$normal_usage_entry, 16],
    ['SITE_17                        ', clc$nominal_entry, clc$normal_usage_entry, 17],
    ['SITE_18                        ', clc$nominal_entry, clc$normal_usage_entry, 18],
    ['SITE_19                        ', clc$nominal_entry, clc$normal_usage_entry, 19],
    ['SITE_20                        ', clc$nominal_entry, clc$normal_usage_entry, 20],
    ['SITE_21                        ', clc$nominal_entry, clc$normal_usage_entry, 21],
    ['SITE_22                        ', clc$nominal_entry, clc$normal_usage_entry, 22],
    ['SITE_23                        ', clc$nominal_entry, clc$normal_usage_entry, 23],
    ['SITE_24                        ', clc$nominal_entry, clc$normal_usage_entry, 24],
    ['SITE_25                        ', clc$nominal_entry, clc$normal_usage_entry, 25]]
    ],
{ PARAMETER 8
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    20, [[1, 0, clc$integer_type], [1, 255, 10]],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NULL                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ]
    ],
{ PARAMETER 9
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    20, [[1, 0, clc$integer_type], [1, 255, 10]],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NULL                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ]
    ],
{ PARAMETER 10
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    20, [[1, 0, clc$integer_type], [1, 255, 10]],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NULL                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ]
    ],
{ PARAMETER 11
    [[1, 0, clc$integer_type], [16384, 2147483648, 10]],
{ PARAMETER 12
    [[1, 0, clc$boolean_type],
    'TRUE'],
{ PARAMETER 13
    [[1, 0, clc$status_type]]];

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

    CONST
      p$file = 1,
      p$allocation_size = 2,
      p$file_class = 3,
      p$initial_volume = 4,
      p$retention = 5,
      p$retrieve_option = 6,
      p$shared_queue = 7,
      p$site_archive_option = 8,
      p$site_backup_option = 9,
      p$site_release_option = 10,
      p$transfer_size = 11,
      p$volume_overflow_allowed = 12,
      p$status = 13;

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

    VAR
      cycle_attribute_count: integer,
      cycle_attributes: ^fst$file_cycle_attributes,
      date_time: ost$date_time,
      device_attribute_count: integer,
      device_attributes: ^fst$device_attributes,
      expiration_date: ost$date_time,
      index: p$allocation_size .. p$volume_overflow_allowed,
      ignore_status: ost$status,
      resolved_path: fst$path;

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

    cycle_attribute_count := 0;
    device_attribute_count := 0;
    IF pvt [p$allocation_size].specified THEN
      device_attribute_count := device_attribute_count + 1;
    IFEND;
    IF pvt [p$file_class].specified THEN
      device_attribute_count := device_attribute_count + 1;
    IFEND;
    IF pvt [p$initial_volume].specified THEN
      device_attribute_count := device_attribute_count + 1;
    IFEND;
    IF pvt [p$retention].specified THEN
      cycle_attribute_count := cycle_attribute_count + 1;
    IFEND;
    IF pvt [p$retrieve_option].specified THEN
      cycle_attribute_count := cycle_attribute_count + 1;
    IFEND;
    IF pvt [p$shared_queue].specified THEN
      device_attribute_count := device_attribute_count + 1;
    IFEND;
    IF pvt [p$site_archive_option].specified THEN
      cycle_attribute_count := cycle_attribute_count + 1;
    IFEND;
    IF pvt [p$site_backup_option].specified THEN
      cycle_attribute_count := cycle_attribute_count + 1;
    IFEND;
    IF pvt [p$site_release_option].specified THEN
      cycle_attribute_count := cycle_attribute_count + 1;
    IFEND;
    IF pvt [p$transfer_size].specified THEN
      device_attribute_count := device_attribute_count + 1;
    IFEND;
    IF pvt [p$volume_overflow_allowed].specified THEN
      device_attribute_count := device_attribute_count + 1;
    IFEND;

    IF device_attribute_count = 0 THEN
      device_attributes := NIL;
    ELSE
      PUSH device_attributes: [1 .. device_attribute_count];
      device_attribute_count := 0;
      IF pvt [p$allocation_size].specified THEN
        device_attribute_count := device_attribute_count + 1;
        device_attributes^ [device_attribute_count].selector := fsc$allocation_size;
        device_attributes^ [device_attribute_count].allocation_size :=
              pvt [p$allocation_size].value^.integer_value.value;
      IFEND;

      IF pvt [p$file_class].specified THEN
        device_attribute_count := device_attribute_count + 1;
        device_attributes^ [device_attribute_count].selector := fsc$mass_storage_class;
        IF clp$trimmed_string_size (pvt [p$file_class].value^.name_value) = 1 THEN
          device_attributes^ [device_attribute_count].mass_storage_class :=
                pvt [p$file_class].value^.name_value (1);
        ELSE
          rmp$convert_keyword_to_class (pvt [p$file_class].value^.name_value,
                device_attributes^ [device_attribute_count].mass_storage_class, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
        IFEND;
      IFEND;

      IF pvt [p$initial_volume].specified THEN
        device_attribute_count := device_attribute_count + 1;
        device_attributes^ [device_attribute_count].selector := fsc$initial_volume;
        IF pvt [p$initial_volume].value^.name_value = 'SYSTEM_DEVICE' THEN
          cmp$get_sys_dev_rec_vsn (device_attributes^ [device_attribute_count].initial_volume, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
        ELSE
          device_attributes^ [device_attribute_count].initial_volume := pvt [p$initial_volume].
                value^.name_value (1, 6);
        IFEND;
      IFEND;

      IF pvt [p$transfer_size].specified THEN
        device_attribute_count := device_attribute_count + 1;
        device_attributes^ [device_attribute_count].selector := fsc$requested_transfer_size;
        device_attributes^ [device_attribute_count].requested_transfer_size := pvt [p$transfer_size].
              value^.integer_value.value;
      IFEND;

      IF pvt [p$shared_queue].specified THEN
        device_attribute_count := device_attribute_count + 1;
        device_attributes^ [device_attribute_count].selector := fsc$shared_queue;
        device_attributes^ [device_attribute_count].shared_queue :=
              pvt [p$shared_queue].value^.keyword_value;
      IFEND;

      IF pvt [p$volume_overflow_allowed].specified THEN
        device_attribute_count := device_attribute_count + 1;
        device_attributes^ [device_attribute_count].selector := fsc$volume_overflow_allowed;
        device_attributes^ [device_attribute_count].volume_overflow_allowed :=
              pvt [p$volume_overflow_allowed].value^.boolean_value.value;
      IFEND;

      IF device_attribute_count <> UPPERBOUND (device_attributes^) THEN
        osp$set_status_abnormal (rmc$resource_management_id, fse$system_error,
              'Bad device attribute count in RMP$REQUEST_MASS_STORAGE_CMD', status);
        RETURN;
      IFEND;
    IFEND; {device_attribute_count > 0}

    IF cycle_attribute_count = 0 THEN
      cycle_attributes := NIL;
    ELSE
      PUSH cycle_attributes: [1 .. cycle_attribute_count];
      cycle_attribute_count := 0;
      IF pvt [p$retention].specified THEN
        cycle_attribute_count := cycle_attribute_count + 1;
        cycle_attributes^ [cycle_attribute_count].selector := fsc$retention;
        IF pvt [p$retention].value^.kind = clc$integer THEN
          cycle_attributes^ [cycle_attribute_count].retention.selector:= fsc$retention_day_increment;
          cycle_attributes^ [cycle_attribute_count].retention.day_increment :=
                pvt [p$retention].value^.integer_value.value;
        ELSEIF pvt [p$retention].value^.kind = clc$time_increment THEN
          clp$verify_time_increment (pvt [p$retention].value^.time_increment_value^, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
          pmp$get_compact_date_time (date_time, ignore_status);
          pmp$compute_date_time (date_time, pvt [p$retention].value^.time_increment_value^, expiration_date,
                status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
          cycle_attributes^ [cycle_attribute_count].retention.selector:= fsc$retention_time_increment;
          cycle_attributes^ [cycle_attribute_count].retention.time_increment :=
                pvt [p$retention].value^.time_increment_value^;
        ELSE
          IF pvt [p$retention].value^.date_time_value.date_specified THEN
            pmp$verify_compact_date (pvt [p$retention].value^.date_time_value.value, status);
            IF NOT status.normal THEN
              RETURN;
            IFEND;
          IFEND;
          IF pvt [p$retention].value^.date_time_value.time_specified THEN
            pmp$verify_compact_time (pvt [p$retention].value^.date_time_value.value, status);
            IF NOT status.normal THEN
              RETURN;
            IFEND;
          IFEND;
          cycle_attributes^ [cycle_attribute_count].retention.selector:= fsc$retention_expiration_date;
          cycle_attributes^ [cycle_attribute_count].retention.expiration_date :=
                pvt [p$retention].value^.date_time_value.value;
        IFEND;
      IFEND;

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

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

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

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

      IF cycle_attribute_count <> UPPERBOUND (cycle_attributes^) THEN
        osp$set_status_abnormal (rmc$resource_management_id, fse$system_error,
              'Bad cycle attribute count in RMP$REQUEST_MASS_STORAGE_CMD', status);
        RETURN;
      IFEND;
    IFEND; {cycle_attribute_count > 0}

    fsp$create_file (pvt [p$file].value^.file_value^, {attachment_options =} NIL,
          cycle_attributes, device_attributes, {file_attributes =} NIL, resolved_path, status);

  PROCEND rmp$request_mass_storage_cmd;

MODEND rmm$request_mass_storage_cmd;








