Copy stream file to printer file

1.4k Views Asked by At

I need to use an IBM i system. The task consists in get a file stored (PCL FORMAT) into IFS and copy it (completely binary) to an output queue.

For that I follow 4 steps:

1) Create a FILE in QTEMP.
2) Copy IFS file to the file in QTEMP.
3) Create a Printer File linked to a Output Queue
4) Copy the QTEMP file to Printer File.

But in the second step the file seems to be truncated by the system.

Do anyone know how copy a stream file without being truncated?

The commands that I run are as follows:

1) CRTPF QTEMP/IFSFILETP RCDLEN(8201) MBR(IFSFILETP) LVLCHK(*NO)
2) CPYFRMSTMF FROMSTMF([IFS_FILE_PATH]) TOMBR('/QSYS.LIB/QTEMP.LIB/IFSFILETP.FILE/IFSFILETP.MBR') MBROPT(*REPLACE) CVTDTA(*NONE) ENDLINFMT(*FIXED) TABEXPN(*NO)
3) CRTPRTF FILE(QTEMP/PRINTFILE) DEVTYPE(*USERASCII) OUTQ(MYLIBRARY/MYOUTPUTQUEUE)
4) CPYF FROMFILE(QTEMP/IFSFILETP) TOFILE(QTEMP/PRINTFILE)

Thanks!

1

There are 1 best solutions below

1
On

I don't have a PCL file handy, but try something like this

QSH CMD('cat -c [IFS_FILE_PATH] | Rfile -wbQ -c "ovrprtf qprint outq(mylibrary/myoutputqueue) devtype(*userascii)" qprint')

The idea being to completely bypass copying to an intermediate QSYS.LIB file. Rfile is unique to IBM i.