× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Muthu,

We were able to diagonize them as some standard PCL commands within the
> print data.


The problem here is that PCL commands begin with an ASCII escape char (x'1B'
in ASCII) but there is no direct equivalent in EBCIDIC.  So there no
standard character you can place in an output spec constant to make the
printer see the data as a PCL sequence.

As others have suggested, the right way to do this is to use an external
printer file with keywords to achieve the desired effects.  This lets you
create the output independent of the actual printer used, and in general is
far easier to maintain in the future.

However, in more direct answer to your question, if you want to continue to
use the PCL commands directly then you need to be able to get an ASCII
escape char in the printer stream.  There are various ways of doing this,
but what I'd suggest doing is the following:

 1) Change or override the print file used so that characters below x'40'
are not replaced by blanks.  By default, most prtf's are set to strip out
things below the standard EBCDIC character range to avoid unintentional side
effects with user data being interpreted as printer commands.  For example,
if using QPRINT you might issue the following command:

  OVRPRTF QPRINT RPLUNPRT(*NO)

 2) Use the SCS printer data stream command for ASCII transparency to get
the ASCII escape strings in your output

The ASCII transparency command is specifically designed to let you insert
ASCII data, including printer escape strings, while leaving the rest of the
output in EBCDIC.  The general format of the command for SCS printers is to
embed a x'03' in the output followed by a single byte with the binary length
of the ASCII data, followed by the ASCII data itself.  When the printer sees
the x'03' byte, it uses the next byte to determine how many subsequent bytes
to send to the printer unaltered.

In the specific case of PCL, most of the non-graphics mode commands use only
printable characters with the exception of the leading escape character.  So
we can have a generic constant defined which creates an ASCII transparency
command for a single byte, the ASCII escape char.  Something like this:

      * Create SCS command for ASCII transparency mode
      * with a single byte x'1B', the ASCII escape character
      * The prtf MUST use RPLUNPRT(*NO) or it won't work
     D AsciiEsc                C                                x'03011B'

Now in your output specs, list the constant AsciiEsc as the leadin to each
of your desired PCL commands.  Note that when using end positions, RPG will
treat the above as consuming 3 bytes so adjust your end positions
accordingly or use all relative positioning.

Doug

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.