Need help figuring out a daisy chain issue
A simple way to approach this would be to use a loop.

Start by identifying your records where alt_key does not show up in any alt_key2 values. Load those into a staging table with pmi_order 1, and mark the records as processed in the source table (add a bit field to track this). These are your parent records.

Now start your loop with an index (n) of 2, and keep going up by one for each loop. For each staging record with pmi_order = (n-1), find the unprocessed main table record whose alt_key value matches the staging alt_key2 value. This becomes your pmi_order 2 (i.e. current value of n) record for that primary_member_nbr. (Note, you will alternate matching staging.alt_key2 to main.alt_key and staging.alt_key to main.alt_key2 for each execution of the loop.)

After each loop completes, check to see if any unprocessed records remain in the main table. Once you have exhausted the main table, you are done.