First of all, you should use COMMIT in your script as often as possible.
This will shorten the length of your Units of Work and require smaller amounts of log space. If you do this and you still get the error, you need to look at the following database parameters: logfilsiz, logprimary, and logsecond. Refer to the Administration Guide: Performance manual for these.
Andy