Take a look at the curses package. You probably have a "man curses" or "man curses_intro" or something. Curses has a routine clear() that should do what you want. I think you will need to call initscr() once in the program first to set stuff up.
For this to work your TERM variable must be set correctly and you must have a good entry in termcap or terminfo. If can run a full screen editor like vi then you should ok. vi uses curses.