Error Code 5400 (SQR 5400) Second page write attempted while writing current page. Check BEFORE-PAGE, AFTER-PAGE procedures. This error can happen if you exceed the number of lines reserved in your begin-heading and begin-footingstatements. For example, if you reserve 3 line with begin-footing 3 then try to print on the 4th line, the error will occur. Try increasing the reserved lines for your header/footer, or reducing the number of lines being printed.