× 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.



Wow.  Never tried this, Marady.  Okay, I suggest you go to the following URL
and post your question there:

http://www-912.ibm.com/j_dir/JTOpen.nsf/($All)?OpenView

This is the JTOpen website, and they are the most helpfhul people on the
planet when it comes to using the toolbox.

Joe

P.S. For a quick attempt, you might try using the toolbox conversion classes
to manually convert from ASCII to ECBDIC:

Instead of:

>         out.write(line.getBytes());

try:

AS400Text text = new AS400Text(132);   // Only do this once, ignore the
deprecation
byte[] bytes = text.toBytes(line);
out.write(bytes);




> -----Original Message-----
> From: MaradyPrak@BigLots.com
>
> Java program writing to text and use RPG to print is my plan B.
> Below is my print method to create spooled file on the
> AS400 and writing to it in Java.  I'm following the example in
> the Toolbox with some alterations.  Basicall, I get the
> string from from a vector variable "rptDetailLine" and convert
> that string to byte array to write to
> SpooledFileOutputStream "out".  So, far my this method will
> create a spooled file, but I can not display, copy, or sent
> it.  The is the error I got when I tried to display the spooled
> file.  From the error, looks like the file contain
> ASCCII data for PC and not AS/400.  What do I need to do to fix this?
>
>  Message ID . . . . . . :   CPF3429       Severity . . . . . . . :   30
>  Message type . . . . . :   Diagnostic
>  Date sent  . . . . . . :   11/28/01      Time sent  . . . . . .
> :   12:48:52
>
>  Message . . . . :   File QPNPSPRTF number 9 cannot be displayed,
> copied, or
>    sent.
>  Cause . . . . . :   File QPNPSPRTF number 9 job
> 401691/PRAK_M/QPRTJOB cannot
>    be displayed, copied, or sent.  Reason code is 3.  If the member option
>    (MBROPT) parameter is specified as *REPLACE on the Copy Spooled File
>    (CPYSPLF) command, the TOFILE was cleared.
>      1 - The file has no records.
>      2 - The file contains only blank records, graphics, bar codes, or
>    intelligent printer data stream (IPDS) transparent data.
>      3 - The file contains only ASCII data intended for a
> personal computer
>    printer.
>      4 - The file contains only advanced function printing data
> stream (AFPDS)
>
>
>
> public void printSOVRFYReport(AS400 system, OutputQueue outputQueue)
>     throws
>         java.io.IOException,
>         com.ibm.as400.access.AS400SecurityException,
>         com.ibm.as400.access.AS400Exception,
>         java.lang.InterruptedException,
>         com.ibm.as400.access.ErrorCompletingRequestException {
>
>     SpooledFile spooledFile = null;
>     SpooledFileOutputStream out;
>     PrintParameterList parms = new PrintParameterList();
>
> //    parms.setParameter(PrintObject.ATTR_FORMTYPE, "*STD");
> //    parms.setParameter(PrintObject.ATTR_COPIES, 1);
> //    parms.setParameter(PrintObject.ATTR_SAVE, "*YES");
>     parms.setParameter(PrintObject.ATTR_OUTPUT_QUEUE,
> outputQueue.getPath());
>      parms.setParameter(PrintObject.ATTR_CHAR_ID, "*SYSVAL");
> //   parms.setParameter(PrintObject.ATTR_DATAFORMAT, "*RCDDATA");
>
> //    PrinterFile printerFile = new PrinterFile(system,
> "/QSYS.LIB/MARADY.LIB/TPSUPD.FILE");
>     out = new SpooledFileOutputStream(system, parms, null, outputQueue);
>      String line = "";
>     for (int idx = 0; idx < rptDetailLine.size(); idx++) {
>          line = ((String) rptDetailLine.elementAt(idx));
>         out.write(line.getBytes());
>
>     }
>     out.close(); // close the spooled file
>     spooledFile = out.getSpooledFile();  // get a reference to
> the new spooled file
> }
>
>
> Regards,
>              Marady Prak
>              Technical Support Specialist



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.