Version 1.3 of ais/ai-00072.txt

Unformatted version of ais/ai-00072.txt version 1.3
Other versions for file ais/ai-00072.txt

!standard B.04 (71)          99-08-31 AI95-00072/03
!standard B.04 (79)
!standard B.04 (87)
!status Corrigendum 2000 99-05-25
!class binding interpretation 95-07-27
!status WG9 approved 96-12-07
!status ARG Approved 7-0-5 96-10-07
!status work item 95-11-01
!status received 95-07-27
!priority High
!difficulty Medium
!qualifier Clarification
!subject Clarification of result length for conversions in COBOL Interface
!summary
In Decimal_Conversions, the length of the result of To_Display (B.4(71)), To_Packed (B.4(79)), and To_Binary (B.4(87)) is Length(Format), and the lower bound is 1.
!question
In Decimal_Conversions, the functions To_Display (B.4(71)), To_Packed (B.4(79)), and To_Binary (B.4(87)), do not specify the bounds of the result. What are these bounds?
!recommendation
(See summary.)
!wording
Add the following to paragraphs 71, 79, and 87, immediately after the 1st sentence in each paragraph:
"The length of the returned value is Length(Format), and the
lower bound is 1."
!discussion
Note that the Length function is overloaded; the Format parameter to To_Display, To_Packed, or To_Binary resolves which version to use.
!corrigendum B.04(71)
Replace the paragraph:
This function returns the Numeric value for Item, represented in accordance with Format. Conversion_Error is propagated if Num is negative and Format is Unsigned.
by:
This function returns the Numeric value for Item, represented in accordance with Format. The length of the returned value is Length(Format), and the lower bound is 1. Conversion_Error is propagated if Num is negative and Format is Unsigned.
!corrigendum B.04(79)
Replace the paragraph:
This function returns the Packed_Decimal value for Item, represented in accordance with Format. Conversion_Error is propagated if Num is negative and Format is Packed_Unsigned.
by:
This function returns the Packed_Decimal value for Item, represented in accordance with Format. The length of the returned value is Length(Format), and the lower bound is 1. Conversion_Error is propagated if Num is negative and Format is Packed_Unsigned.
!corrigendum B.04(87)
Replace the paragraph:
This function returns the Byte_Array value for Item, represented in accordance with Format.
by:
This function returns the Byte_Array value for Item, represented in accordance with Format. The length of the returned value is Length(Format), and the lower bound is 1.
!ACATS test
Tests are needed. Test cases should be added to the existing tests CXB4004 (To_Display), CXB4006 (To_Packed), and CXB4007 (To_Binary) to check that the lower bound is 1, and the upper bound = Length().
!appendix

!section B.04(71)
!subject Clarification of result length for conversions in COBOL Interface
!reference RM95-B.04(71)
!reference RM95-B.04(79)
!from Ben Brosgol 95-07-10
!keywords COBOL Interface
!reference as: 95-5216.b Ben Brosgol 95-7-10>>
!discussion

As pointed out by R Dewar, the descriptions of the functions To_Display
and To_Packed in the generic package Decimal_Conversions do not
specify the length of the returned value (each is an array); the
appropriate interpretation is that in each case the length is given
by the corresponding Length function applied to the Format parameter.

The following should thus be added, both to paragraphs 71 and 79,
immediately after the 1st sentence in each paragraph:

   "The length of the returned value is Length(Format), and the
    lower bound is 1."

Note that the Length function is overloaded; the Format parameter to
To_Display and To_Packed resolves which version to use.

****************************************************************

Questions? Ask the ACAA Technical Agent