You might receive an error message like the following when you create an index for a data set:
ERROR: Index indexname cannot be created on file LIB.DSET because the length of the index value (16040 bytes) is too large. The index page size (currently 4096) must be large enough to store three index values plus a small overhead structure. Reduce the length of the index value or use the IBUFSIZE= option to increase the index page size (up to a maximum of 32,767 bytes).
The length of the index value and the index page size values in the error message will vary depending on the variables being indexed and the IBUFSIZE= system option setting.
The message indicates that the index value is 16,040 bytes, and you cannot fit three such values on the maximum index page size of 32,767 bytes. The index cannot be created with the variables being specified for the index. This could occur if a composite index is being created with many variables or if a simple index is being created with one variable whose length is 32,767.
If such an index were to be created, it would be of no use for optimizing a WHERE clause, which is the primary benefit of an index.
Verify the IBUFSIZE= system option setting and adjust it to the maximum value of 32,767 if it is smaller. If the option is set to 32,767 and the error persists, reduce the lengths of one or more variables in the index definition, or reduce the number of variables in the index.
Go to the Full Code section to see sample code that replicates the error. The error message is displayed in the Results section.
The DATA step code below demonstrates how the error can be reproduced by creating an index on a very long variable.
data x (index=(a));
length a $ 32767;
do i=1 to 10;
a = 'foont';
output;
end;
run;
ERROR: Index a cannot be created on file WORK.X because the length of the index value (32767 bytes) is too large. The index page
size (currently 31744) must be large enough to store three index values plus a small overhead structure. Reduce the length of the
index value or use the IBUFSIZE= option to increase the index page size (up to a maximum of 32,767 bytes).
ERROR: Index creation failed for one or more indexes.