?? NEWTITLE := 'NOS/VE :  ADVANCED ACCESS METHOD, RING BRACKETS 4DD' ??
MODULE amm$get_primary_key_count;
?? RIGHT := 110 ??

*copyc amh$also

?? NEWTITLE := 'Global Declarations Referenced By This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc amc$condition_code_limits
*copyc ame$improper_file_id
*copyc amt$call_block
*copyc amt$fap_layer_number
*copyc amt$fap_pointer
?? POP ??
*copyc baf$task_file_entry_p
*copyc osp$set_status_abnormal
?? OLDTITLE ??
?? NEWTITLE := '  [XDCL] AMP$GET_PRIMARY_KEY_COUNT', EJECT ??


  PROCEDURE [XDCL, #GATE] amp$get_primary_key_count
    (    file_identifier: amt$file_identifier;
         low_key: ^cell;
         major_low_key: amt$major_key_length;
         low_key_relation: amt$key_relation;
         high_key: ^cell;
         major_high_key: amt$major_key_length;
         high_key_relation: amt$key_relation;
         list_count_limit: amt$key_count_limit;
     VAR list_count: amt$key_count_limit;
         wait: ost$wait;
     VAR status: ost$status);

    CONST
      interface_name = 'AMP$GET_PRIMARY_KEY_COUNT',
      fap_layer_number = 0;

    VAR
      call_block: amt$call_block,
      file_instance_p: ^bat$task_file_entry;

    status.normal := TRUE;
    file_instance_p := baf$task_file_entry_p (file_identifier);
    IF file_instance_p = NIL THEN
      osp$set_status_abnormal (amc$access_method_id, ame$improper_file_id, interface_name, status);
      RETURN; {----->
    IFEND;

    call_block.operation := amc$get_primary_key_count;

    call_block.get_primary_key_count.low_key := low_key;
    call_block.get_primary_key_count.major_low_key := major_low_key;
    call_block.get_primary_key_count.low_key_relation := low_key_relation;
    call_block.get_primary_key_count.high_key := high_key;
    call_block.get_primary_key_count.major_high_key := major_high_key;
    call_block.get_primary_key_count.high_key_relation := high_key_relation;
    call_block.get_primary_key_count.list_count_limit := list_count_limit;
    call_block.get_primary_key_count.list_count := ^list_count;
    call_block.get_primary_key_count.wait := wait;

    file_instance_p^.fap_control_information.first_fap.access_method^
          (file_identifier, call_block, fap_layer_number, status);

    IF NOT status.normal THEN
      IF (file_instance_p^.instance_attributes.dynamic_label.error_exit_procedure <> NIL) THEN
        file_instance_p^.instance_attributes.dynamic_label.error_exit_procedure^ (file_identifier, status);
      IFEND;
    IFEND;

  PROCEND amp$get_primary_key_count;
?? OLDTITLE ??
MODEND amm$get_primary_key_count;
