|
On Wed, 9 Mar 2005, Scott Klement wrote:
I have an RPG program that creates postscript. I need to send it unchanged to a printer. I can't use a print file because that will then send an SCS print job and that won't work. Any ideas on how to do this?
The way I like to do it is generate the PostScript file as a stream file in the IFS. The IFS APIs will automagically do the ASCII to EBCDIC translatation for me. Then, if I want to debug things, I can easily NFS/SMB mount my IFS and open the stream file with my favorite text editor, or even use ghostview to see what it looks like.
You're correct that if you specify DEVTYPE(*SCS) the system will send an SCS print job to the printer. But if you specify DEVTYPE(*USERASCII) the data will be sent to the printer without any changes.
When I'm ready to print it, I re-open the stream file in my RPG program, this time in binary mode (so no translation takes place) and read fixed-length chunks of data (the length matches that of my print file) and write the results to the *USERASCII print file.
James Rich
It's not the software that's free; it's you. - billyskank on Groklaw
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.