1

我尝试使用 Java (JT400) 转换(读取)*SCS 假脱机文件,但是当我尝试转换它时,我收到此错误消息

“com.ibm.as400.access.AS400Exception:CPF3394 无法转换假脱机文件数据。”

有人知道怎么修这个东西吗 ?

               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);
    }
4

2 回答 2

3

固定代码(答案):

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 a page input stream from the spooled file
PrintObjectPageInputStream is = 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);
    }

}  
于 2013-08-21T06:01:19.440 回答
1

对于 *SCS 假脱机文件,您可能应该使用 getInputStream。

getInputACIFMergedStream 已被弃用,应使用 getAFPInputStream 代替,但仅适用于 *AFPDS 假脱机文件。

于 2013-08-20T19:44:19.633 回答