You can use the QShell Rfile utility to read and write output from i5/OS™ PASE shells.
The following example writes the contents of stream file mydoc.ps to spooled printer device file QPRINT as unconverted ASCII data, and then uses the CL LPR command to send the spooled file to another system:
before='ovrprtf qprint devtype(*userascii) spool(*yes)'\ after="lpr file(qprint) system(usrchprt01) prtq('rchdps') transform(*no)" cat -c mydoc.ps | Rfile -wbQ -c "$before" -C "$after" qprint