1 03/08/85  valid_decimal_
 2 
 3 
 4 Entry points in valid_decimal_:
 5    (List is generated by the help command)
 6 
 7 
 8 :Entry:  valid_decimal_: 03/08/85  valid_decimal_
 9 
10 
11 Function:
12 The valid_decimal_ subroutine tests decimal data for validity.
13 
14 
15 Syntax:
16 declare valid_decimal_ entry (fixed bin, ptr, fixed bin) returns
17      (bit(1));
18 b = valid_decimal_ (dtype, dptr, dprec);
19 
20 
21 Arguments:
22 dtype
23    is the data type descriptor of the decimal data.  It must be one of
24    the following:  9-12, 29, 30, 35-36, 38-39, 41-46 81-84.  (Input)
25 dptr
26    is a pointer to the data to be tested for validity.  (Input)
27 dprec
28    is the precision of the data.  (Input)
29 b
30    is the value returned by valid_decimal_.  It is "1"b if the data is
31    valid, "0"b otherwise.  (Output)
32 
33 
34 Notes:
35 For decimal data to be valid, it must pass the following tests:
36 (1)  The precision must be > 0 and <= 59;
37 (2)  The data type descriptor must be one handled by valid_decimal_;
38 (3)  If the data is stored as nonoverpunched 9-bit characters, then if
39      it has a sign, then the sign must be either "+" or "-".  The
40      digits must all be one of the ASCII characters "0123456789";
41 (4)  If the data is stored as overpunched 9-bit characters, then the
42      sign character must be either octal 173, 175, or in the range 101
43      to 122.  The remaining digits must all be one of the ASCII
44      characters "0123456789";
45 (5)  If the data is stored as 4-bit characters, then if it has a sign,
46      then sign must be in the range "1010"b to "1111"b.  All digits
47      must be in the range "0000"b to "1001"b.