CA Datacom

Expand all | Collapse all

Using packed fields in a key

Jump to Best Answer
  • 1.  Using packed fields in a key

    Posted 02-04-2019 05:12 PM

    I cannot remember why we don't want to do this - I was thinking it might be the signed portion of the packed field.  I have a manager asking why we don't use packed fields in a key.  Any input is appreciated.  thank you



  • 2.  Re: Using packed fields in a key
    Best Answer

    Posted 02-05-2019 04:05 AM

    Hi Marion, 

     

    You can use signed packed decimal fields in a key if you make that key data-sensitive. 

    If you don't  then you get  warning message  DDWKEY0013  during the catalog of the database: 

     

    SIGNED NUMERIC FIELD IN KEY

    Reason:

    During the verification of a DATABASE structure, a KEY substructure was detected that contains a FIELD entity-occurrence with a TYPE attribute-value of N or D and a SIGN attribute-value of Y. Use of a signed numeric FIELD entity-occurrence in a key can cause the data records to be sorted and retrieved in a different sequence than expected.

    Action:

    This is a warning message only. No action is required if this manner of sorting and retrieval is acceptable. To obtain a logical sorting sequence, change the KEY entity-occurrence DATA-SENSITIVE attribute-value to Y.

    --

    Have a great day, Karina.



  • 3.  Re: Using packed fields in a key

    Posted 02-05-2019 12:18 PM

    Thank you - I will pass this along.