Is joinpoint regression another name for piecewise (or segmented line) regression? If it is, do you know in advance anything about the number of knots and their locations?
If it is piecewise regression, you could look at Chapter 4 of Michael Mitchell's book (2nd link below). You might also consider posting questions about Stata to Statalist (3rd link below).