In JMP 11 there is a Transform menu in most platforms that has a Cumulative Sum item. It creates a column with a formula of the form:
If( OrMZ( Row() == 1, :sex != Lag( :sex ) ), 0, Lag() )
+ If( Is Missing( :height ), 0, :height )
It also relies on the grouping variables being sorted, but it ignores missing values.