# Determining space requirements for the profiles

The formula for calculating the space that is required for each segment (Base RACF® information, TSO, DFP, and so on) of each profile in the RACF database is as follows:

`P = 20 + L + F1 + F4 + R`

Where:

Space required | ||
---|---|---|

P |
= |
The number of bytes required for a profile segment |

L |
= |
The number of bytes in the profile name |

F1 |
= |
The sum of the lengths of all fields that contain data and have a
length of 1 to 127 bytes, plus 2 bytes for every field counted. For example, if a segment
contains 3 non-null fields of length |

F4 |
= |
The sum of the lengths of all fields that contain data and have a
length of 128 to 2**31 bytes, plus 5 bytes for every field counted. For example, if a segment
contains a non-null field 150 bytes long and a non-null field 255 bytes long, |

R |
= |
The sum of the lengths of all repeat groups. If a repeat group has
no occurrences, then it has a length of 0 bytes. If a repeat group has 1 or more occurrences, then
the length of each repeat group is calculated as follows:
For example, consider a group with two occurrences. Each
occurrence contains an 8-byte field and a variable length field. In the first occurrence, the
variable length field is 30 bytes and in second occurrence, it is 200 bytes. The length of the group
is: G1 is |

For example, this would translate into a maximum of 8191 group connections per user, based on the CONGRPCT repeat group in the USER template. This group contains one 8-byte field, making the calculation of the limit a simple one of dividing 65 535 by 8 and dropping any remainder.

As another example, this would translate into a maximum of 5957 users connected to a group, based on the ACLCNT repeat group in the GROUP template. This group contains one 8-byte field (USERID), one 1-byte field (USERACS), and one 2-byte field (ACSCNT). This gives a total length of eleven for the fixed-length fields in each occurrence. Dividing 65 535 by 11 and dropping the remainder gives the limit of 5957.

When calculating F1 and F4, remember that statistical fields (Flag1/bit 7 on, in the template definition) are always stored in a profile segment, even when the field contains a null value. For example, LJTIME always adds 3 bytes to the length of a USER profile Base segment, regardless of whether it contains a zero value or some other value. Other fields only exist in the segment if a specific value has been added for that field.