Generating a report from an IBM i CL program isn’t straightforward, because in CL there is no direct way to write to a spool file. This article provides the Print Line (PRTLN) command, which allows simple, direct printing from a CL or CLLE program, including page control and headings.
By Sam Lennon
Sometimes it's just convenient to print directly from CL, and that's where the PRTLN command is handy. The CL language wasn’t designed to create reports—report writing is a strength of RPG. You can, of course, create Query/400 or QMQRY objects and then call them from a CL program to produce a report, but then you have extra objects to manage.