in reply to data stuctures

While what socketdave said is true, I'm not sure why you have line 6 at all. That whole initialisation isn't consistent with %rims's use in the second snippet. You'll end up with something like the following. Why are keys and records at the same level?
( GROUP => ..., LNAME => ..., INITS => ..., MBRID => ..., M_DOB => ..., DEPCD => ..., P_FNAME => ..., P_DOB => ..., P_SEX => ..., key1 => { GROUP => ..., LNAME => ..., INITS => ..., MBRID => ..., M_DOB => ..., DEPCD => ..., P_FNAME => ..., P_DOB => ..., P_SEX => ..., }, key2 => { GROUP => ..., LNAME => ..., INITS => ..., MBRID => ..., M_DOB => ..., DEPCD => ..., P_FNAME => ..., P_DOB => ..., P_SEX => ..., }, ... );