And there is also a minimum length to consider. I modified the program to use _NEW_ to create the hash instances so I could redefine the same hash object with more variables. Note that the minimum length on my Windows 64 bit machine is 48 - and it does not increase by just adding a new variable to the data portion.
1 data _null_;
2 k = . ;
3 array d(*) $1 d1-d9;
4 declare hash h();
5 h = _new_ hash();
6 h.defineKey('k');
7 h.definedata('d1');
8 h.defineDone();
9 OneDataVar = h.item_size;
10 put OneDataVar=;
11 h.delete();
12
13 h = _new_ hash();
14 h.defineKey('k');
15 h.definedata('d1','d2','d3','d4','d5','d6','d7','d8');
16 h.defineDone();
17 EightDataVars = h.item_size;
18 put EightDataVars=;
19 h.delete();
20
21 h = _new_ hash();
22 h.defineKey('k');
23 h.definedata('d1','d2','d3','d4','d5','d6','d7','d8','d9');
24 h.defineDone();
25 NineDataVars = h.item_size;
26 put NineDataVars=;
27 h.delete();
28
29 run;
OneDataVar=48
EightDataVars=48
NineDataVars=64
NOTE: DATA statement used (Total process time):
real time 0.07 seconds
cpu time 0.04 seconds
... View more