We are defining a new “multipurpose” MU field on a file.
The question has come up as to how the field values will behave with NU vs. default (normal) compression.
I have always assumed that whether the fiels is null suppression or normal suppression, and MU will not maintain positionality, that is, if a value is placed in occ 3 (and occ 1 & 2 are empty) the value will actually end up in occ 1.
Am I mistaken? I am being told that with “normal” suppression, positionality will be maintained.
-Steve Tomsko
MUs can maintain positionality, but DBAs usually apply NU to save space.
From the manual:
And
I have always defined MUs with the NU option. And I am concerned about the space this new field may take up. The users want to maintain positionality, but it seems to me a PE with one field will be more efficient. Any thoughts?
Some questions Steve:
How long are typical values for the field occurrences?
Will the field be a descriptor? A field within a PE that is a descriptor supports subscripted searches, an MU does not.
Any feel for the largest number of subscripts (positions) for a given record?
Is the field typical dense or sparse? Again, any feel for how dense/sparse?
Occupied elements of the MU (that is, values with something other than a space value) will occupy the same space whether a MU with ordinary or NU compression or if stored as a single field in a PE. So the difference is how much room the “empty” occurrences will take up.
Empty fields with normal compression (not NU) will occupy 2 bytes (length + value space) per occurrence. If you are storing 100 occurrences, it will require at least 200 bytes per record (plus the occurrence count of course). With NU, there will just be the occurrence count (0).
A PE with a single NU field will have an Empty Field Count for each group of empty occurrences. Best case, 1 EFC for 100 occurences, worst case 50 EFCs with alternating empty/filled occurrences.In an NNU MU with similar alternating empty/filled occurrences, you use 100 bytes for the empty fields (50 x 2 bytes). With PE/NU MU, you use 50 bytes for the EFCs.
Does the 50 bytes per record matter? DE/SP on a PE field can’t be used for READ LOGICAL; DE/SP on MU can be. Otherwise, I don’t think there’s much difference.
1 Like