ibm midrange - Can't convert Spooled file data - Java (JT400) -


i'm tried convert (read) *scs spooled file using java (jt400) when trying convert , got error message

"com.ibm.as400.access.as400exception: cpf3394 cannot convert spooled file data."

anyone know how fix ?

               as400 sys = new as400();     spooledfile sf = new spooledfile( sys,          // as400                                         "cusr_r1",       // splf name                                         2,           // splf number                                         "qpadev003h",    // job name                                         "user",      // job user                                         "096018" );   // job number    printobjectinputstream inputstream = sf.getinputacifmergedstream(true);    system.out.println ("size " + inputstream.available());    bufferedreader d = new bufferedreader(new inputstreamreader(inputstream));        string data ="";        while((data = d.readline() )!=null)        {         system.out.println (data);         }     } catch (exception e) {         system.out.println(e);     } 

fixed code (answer) :

try {                 as400 sys = new as400("");     spooledfile sf = new spooledfile( sys,          // as400                                         "cusr_r1",       // splf name                                         2,           // splf number                                         "qpadev003h",    // job name                                         "user",      // job user                                         "096018" );   // job number  printparameterlist printparms = new printparameterlist(); printparms.setparameter(printobject.attr_workstation_cust_object,   "/qsys.lib/qwpdefault.wscst"); printparms.setparameter(printobject.attr_mfgtype, "*wscst");  // create page input stream spooled file printobjectpageinputstream = sf.getpageinputstream(printparms);  bufferedreader d = new bufferedreader(new inputstreamreader(is));        string data ="";        while((data = d.readline() )!=null)        {         system.out.println (data);         }     } catch (exception e) {         system.out.println(e);     }  }   

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -