Appendix C SDCDE PICTURE Clause Translation
Generating the Edit Mask from Attributes
The generation of the PICTURE clause for each data element depends on
whether or not you request the use of the edit-mask. If you do not
request that the edit-mask be used, Table C-1 shows how SDCDE generates
the PICTURE clause.
In Table C-1, "d" designates the display-length attribute value, "b" the
byte-length attribute value, and "e" the decimal attribute value.
Table C-1. PICTURE Clause Generation
-------------------------------------------------------------------------------------------
| | |
| System Dictionary | COBOL PICTURE Clause |
| Element Type | |
| | |
-------------------------------------------------------------------------------------------
| | |
| X , U | X(d) |
| | |
-------------------------------------------------------------------------------------------
| | |
| 9 , 9+ | 9(d) |
| | |
-------------------------------------------------------------------------------------------
| | |
| Z+ | If e > 0, then 9(b - e)V9(e) |
| | If e = 0, then 9(b) |
| | If e < 0, SDCDE issues a warning and generates the PICTURE |
| | clause as if e = 0 |
| | |
-------------------------------------------------------------------------------------------
| | |
| Z with sign separate | |
| | If e > 0, then |
| | S9(b-e-1)V9(e) SIGN LEADING SEPARATE or |
| | S9(b-e-1)V9(e) SIGN TRAILING SEPARATE |
| | |
| | If e = 0, then |
| | S9(b-1) SIGN LEADING SEPARATE or |
| | S9(b-1) SIGN TRAILING SEPARATE |
| | |
| | If e < 0, SDCDE issues a warning and generates the PICTURE |
| | clause as if e = 0 |
| | |
-------------------------------------------------------------------------------------------
| | |
| Z with sign overpunch | |
| | If e > 0, then |
| | S9(b-e)V9(e) SIGN LEADING or SIGN TRAILING |
| | |
| | If e = 0, then |
| | S9(b) SIGN LEADING or SIGN TRAILING |
| | |
| | If e < 0, SDCDE issues a warning and generates the PICTURE |
| | clause as if e = 0 |
| | |
-------------------------------------------------------------------------------------------
| | |
| P | |
| | If e = 0, then S9(n) COMP-3, where |
| | n = 2b-1, if d >= 2b-1 |
| | n = 2b-2, if d <= 2b-2 |
| | |
| | If e > 0, then S9(n)V9(e) COMP-3, where |
| | n = 2b-e-1, if d >= 2b |
| | n = 2b-e-2, if d <= 2b-1 |
| | |
| | If e < 0, SDCDE issues a warning and generates the PICTURE |
| | clause as if e = 0 |
| | |
-------------------------------------------------------------------------------------------
Table C-1. PICTURE Clause Generation(cont.)
-------------------------------------------------------------------------------------------
| | |
| System Dictionary | COBOL PICTURE Clause |
| Element Type | |
| | |
-------------------------------------------------------------------------------------------
| | |
| P+ | |
| | If e = 0, then 9(n) COMP-3, where |
| | n = 2b-1, if d >= 2b-1 |
| | n = 2b-2, if d <= 2b-2 |
| | |
| | If e > 0, then 9(n)V9(e) COMP-3, where |
| | n = 2b-e-1, if d >= 2b |
| | n = 2b-e-2, if d <= 2b-1 |
| | |
| | If e < 0, SDCDE issues a warning and generates the PICTURE |
| | clause as if e = 0 |
| | |
-------------------------------------------------------------------------------------------
| | |
| I , J , K | If e = 0, then S9(n) COMP where |
| | |
| | |
| | b d n |
| | --- ------- --- |
| | 2 d < 4 d |
| | d > 4 4 |
| | 4 d < 5 5 |
| | 5 <= d <= 9 d |
| | d > 9 9 |
| | 8 d < 10 10 |
| | 10 <= d <= 18 d |
| | d > 18 18 |
| | |
| | If b does not equal 2, 4, or 8 then SDCDE issues a warning |
| | message and generates the PICTURE clause as X(d) |
| | If e > 0, then S9(n)V9(e) COMP where |
| | |
| | |
| | b d n |
| | --- ------- --- |
| | 2 d <= 5 d-e-1 |
| | d > 5 4-e |
| | 4 d < 6 5-e |
| | 6 <= d <= 10 d-e-1 |
| | d > 10 9-e |
| | 8 d < 11 10-e |
| | 11 <= d <= 19 d-e-1 |
| | d > 19 18-e |
| | |
| | If b does not equal 2, 4, or 8 then SDCDE issues a warning |
| | message and generates the PICTURE clause as X(d) |
| | If e < 0, SDCDE issues a warning and generates the PICTURE |
| | clause as if e = 0 |
| | |
-------------------------------------------------------------------------------------------
Table C-1. (cont.)
----------------------------------------------------------------------------------------
| | |
| System Dictionary | COBOL PICTURE Clause |
| Element Type | |
| | |
----------------------------------------------------------------------------------------
| | |
| I+ , J+ , K+ | If e = 0, then 9(n) COMP where |
| | |
| | (see I , J , K above for the value of n) |
| | If e > 0, then 9(n)V9(e) COMP where |
| | |
| | (see I , J , K above for the value of n) |
| | If e < 0, SDCDE issues a warning and generates the PICTURE |
| | clause as if e = 0 |
| | |
----------------------------------------------------------------------------------------
| | |
| R , E , B , S , D | SDCDE issues a warning message and generates |
| | the PICTURE clause as X(b) |
| | |
----------------------------------------------------------------------------------------
| | |
| * | SDCDE searches ELEMENT references ELEMENT relationship |
| | to find the element definition |
| | |
----------------------------------------------------------------------------------------