I do not think you read and understood prino's post.
Rexx, as a language, is not well suited to prepare highly formatted reports.
In the TSO environment there is no concept of report pages; for the most part TSO programs write their output to a TSO terminal, which in the current world usually means a 3270 type "glass teletype." In 1970 or so when TSO was first used, TSO terminals usually meant something like an IBM 2741 printer/keyboard using fan folded paper usually intended for 1403 printers. While this paper had "pages," TSO was ignorant of page boundaries; programs running in the TSO environment literally had to count lines if they were going to write "pages" on a 2741 printer/keyboard, and the printer/keyboard operator had to manually position the paper before starting a program that was going to write "pages" on this paper.
The term "glass teletype" was often used in the 1970s and 1980s when CRT terminals were replacing printer/keyboard terminals in nearly all online environments, not just TSO. By the 1990s, the term "glass teletype" was obsolete since CRT terminals had completely replaced printer/keyboards. Only gray beards like me even remember the term.
To extend prino's remarks: if it is your intent to use Rexx to produce output that is going to be printed, you are going to write the printed report to a data set that uses carriage control characters, and then "print" the data set in some fashion appropriate to your environment.
I need to print every 30 records in a new page. is there any command to do this?
Basically, no. If you are thinking in terms of the ASCII "form feed" concept and the \f character as used in the standard C library printf function formats, it really does not exist in Rexx or the z/OS mainframe except as carriage control characters used in printed reports. Technically the EBCDIC character set does have a form feed character comparable to the ASCII form feed character, but the only time it was widely used was for now obsolete 3270 type printers.