Can you show a screenshot of where it's ending up, and let us know where you want it to go?
From what I can see in that code, it's normal for the text to be towards the upper right. The 17 in the LOCATE statement makes it start in column 17. The 1 in that same statement makes it appear on row 1.
Also, what's the variable A supposed to do? It's defined but never used within the DEF block.