Greetings,
 
Have you read the perl code? There is no stored procedure on the MySQL DB, but there is perl code.
I’d start looking at perldoc C4::Members.
 
Mark Tompsett