If the amount realized at the sale was sufficient to satisfy the mortgage debt and all other sums due at date of sale, the officer shall cancel the evidence of the debt by permanent endorsement thereon and return it to the person primarily liable thereon upon demand of such person or his attorney but if no such demand be made prior to the time deed or redemption under the foreclosure is made, the officer shall be no longer responsible for such return. If the amount realized at such sale is not sufficient to pay the sums due as aforesaid, the officer shall endorse on the evidence of the debt in permanent form, the amount of the sale and the amount remaining due on the debt, and return the evidence of the debt to the mortgagee, assignee, or other owner thereof. The officer making such endorsements shall date and sign the same.
SDCL 21-48-18