Unconfigured Ad Widget

Collapse

Spoolfile to text Using Toolkit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Guest.Visitor

    Spoolfile to text Using Toolkit

    Hi, I'm very new to Java so please be gentle! I have been working on trying to read a SpoolFile form the AS/400 and getting it into a text file. (I would be happy getting it into anything I could display in HTML). I have been using the PrintObjectInputStream and the AS400Text converter. I've tried every combination of writing it and have played with the CCSID. It seems no matter what I do I get a text file that looks similar to what if should, but with a lot of extraneous characters (?'s and others) and the lines are out of whack. I know the AS400Text converter converts it to 16-bit Unicode(or I believe it does) but I'm not even sure the conversion is being done properly. I'm a little confused on the difference between the PrintObjectInuptStream and the PrintObjectTransformedInputStream. I have used both but they both come out the same. No parameters on the PrintObjectTransformedInputStream). Are they both supposed to use the AS400Text converter? Any information on this is appreciated !! thanks! joni
  • Guest.Visitor

    #2
    Spoolfile to text Using Toolkit

    There is a much simpler way to do this. Use the CPYSPLF command to convert your spool file to a text file on the AS/400. Then use the CPYTOIMPF command to bring the text file to the IFS. Dave

    Comment

    • Guest.Visitor

      #3
      Spoolfile to text Using Toolkit

      I would first verify that your AS/400 is V4R4 or above. PrintObjectTransformedInputStream is only available on V4R4 (and higher) systems... (If the system is less than V4R4, there is an alternative way - send a note to rchjt400@us.ibm.com for that...) The key to using the PrintObjectTransformedInputStream is in the workstation customization object specified. This object tells the Network Print Server how to read (or "transform") the data. Below is some sample code, with "QWPDEFAULT" being the workstation customizing object. For more information on customizing objects, consult the Printer Device Programming Guide. // Assume splF is a SpooledFile object that has already been created... PrintParameterList printParms = new PrintParameterList(); printParms.setParameter(PrintObject.ATTR_WORKSTATI ON_CUST_OBJECT, "/QSYS.LIB/QWPDEFAULT.WSCST"); printParms.setParameter(PrintObject.ATTR_MFGTYPE, "*WSCST"); try { // get a transformed input stream from the spooled file PrintObjectTransformedInputStream is = splF.getTransformedInputStream(printParms); // get the number of bytes available int read; int avail = is.available(); while (avail != 0) { byte buf = new byteavail; // read the data available read = is.read(buf, 0, avail); // * * * * Text has been retrieved! // get next set of transformed data avail = is.available(); } } catch (Exception e) { // handle exception } - Jeff Lee

      Comment

      • Guest.Visitor
        Junior Member
        • Apr 2007
        • 185

        #4
        SpoolFile to text with cyrillic symbols

        Hi guys! I need to transform spoolfile to text and and then display it in different formats df, txt, html and so on. My problem is that PrintObjectTransformedInputStream returns text in ascii, and when I want to convert it to cp1251, the cyrillic characters are not displayed. Is there any way to get text in ANSI or UTF-8??? When I use PrintObjectInputStream it's ok, symbols are visible, but then there are some junk characters coming (margins or other things I dunno)..Please help!

        Comment

        Working...
        X