?? RIGHT := 110 ??
?? NEWTITLE := 'DEFINE_SUBPRODUCT Subutility: DEFINE_PSRS_ANSWERED command.' ??
MODULE ram$define_psrs_answered;

{ PURPOSE:
{   This module contains the procedure that defines the PSRS answered.
{
{ DESIGN:
{
{   The compiled module resides in RAF$LIBRARY.
{ NOTES:
{

?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc rae$package_software_cc
*copyc ost$status
*copyc rat$correction_process_record
*copyc rat$subproduct_info_types
?? POP ??
*copyc clp$evaluate_parameters
*copyc osp$set_status_abnormal
*copyc rap$process_psrs_entered
*copyc rav$subproduct_info_pointers

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

?? TITLE := '[XDCL] rap$define_psrs_answered', EJECT ??

  PROCEDURE [XDCL] rap$define_psrs_answered
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);


{ PROCEDURE defpa_pdt (
{   psrs_answered, pa: any of
{                        list of name rac$psr_name_length..rac$psr_name_length
{                        file
{                      anyend = $optional
{   status)

?? PUSH (LISTEXT := ON) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 3] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [88, 10, 4, 21, 46, 41, 829],
    clc$command, 3, 2, 0, 0, 0, 0, 2, 'DEFPA_PDT'], [
    ['PA                             ',clc$abbreviation_entry, 1],
    ['PSRS_ANSWERED                  ',clc$nominal_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 2]],
    [
{ PARAMETER 1
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 44, clc$optional_parameter,
  0, 0],
{ PARAMETER 2
    [3, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$file_type, clc$list_type],
    FALSE, 2],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$name_type], [rac$psr_name_length, rac$psr_name_length]]
      ],
    3, [[1, 0, clc$file_type]]
    ],
{ PARAMETER 2
    [[1, 0, clc$status_type]]];

?? POP ??

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

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

    VAR
      ignore_previous_sif: rat$correction_process_sif_info;

    status.normal := TRUE;
    ignore_previous_sif.file_opened := FALSE;

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

    IF (rav$subproduct_info_pointers.psrs_answered_p <> NIL) AND
      (rav$subproduct_info_pointers.path_container_p <> NIL) THEN
      osp$set_status_abnormal ('RA', rae$defpa_command_not_allowed, '', status);
      RETURN;
    IFEND;

    IF rav$subproduct_info_pointers.attributes_p^.subproduct_type = rac$correction THEN
      rap$process_psrs_entered (pvt [p$psrs_answered].value^, rav$subproduct_info_pointers,
            ignore_previous_sif, status);
    ELSE
      osp$set_status_abnormal ('RA', rae$defpa_already_called, '', status);
    IFEND;

  PROCEND rap$define_psrs_answered;

MODEND ram$define_psrs_answered;
