Are you running CNCLite, or what package?
Look in the manual for help on the JUMP command and GOSUB command. Those respective commands are typically used in an M97 and M98 code respectively, and the call is made in Fanuc fashion:
M97 N_ _ _ R_ _ _
where N is the line number for the start of the sub and R is the repeats. However, in Camsoft, those letters could possibly be altered to other alphabetic characters, depending on what you want.
M99 ends the sub and returns to the main program.
Check the RETURN command for help on this.