If you are on V5R4 or higher you can create a simple report from a CL program using <a href=”http://www.powercl.com/”>PowerCL: CL for Files</a> (CLF). There are fee based options of the product to improve productivity but for a simple report the no charge run-time support should suffice. CLF supports both exernal and program described printer output, with examples of both in the documentation.
Bruce Vining (who is part of the company marketing/developing CLF)
IMO yu are on a wrong way : when you will create a spool, it will be in EBCDIC. Are you sure the convertion to ASCII or ANSI will be done correctly by your *WSCST ?
CL is not the good tool. Do the job with RPG. you sample can request less than 10 lines :
FQSYSPRT O F 198 OF PRINTER
OQSYSPRT E ITEM
O 40 ‘====FIN DE LA LISTE====’
To cause printing in CL, compile as ILE CL and call the printf C library routine. Issue an OVRPRTF FILE(STDOUT) TOFILE(MyPrtF) before calling the printf procedure and delete the override before returning from the CL. Create your MYPRTF however you choose, perhaps simply by CRTDUPOBJ for QSYSPRT.