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



I have a question I am in the process of debugging a program that is bombing
out on us. I did not write it, but I am debugging it. It looks like it is
using something in the JT400 to convert the text, but it doesn't seem to
work 100% right.

Here is the string being converted (from a spool file):
 0  0.00  0   0.00  156  0.02 SALES & MARKETING SERVICES   72  0.00   0
0.00    2,337   0.02

Here is what it looks like after the conversion (in ASCII):
 0  0.00  0   0.00  156  0.02 SALES & MARKETING SERVICES   72  0.00   0
0.00    2,337   0.0%

Why would it do this? 

Here is the conversion code:
    private String ReadFile() throws AS400SecurityException, AS400Exception,

                                        IOException, 
                                        ErrorCompletingRequestException, 
                                        InterruptedException, 
                                        RequestNotSupportedException  {
        String strConvertedFile="";
        AS400 objAS400 = new AS400(_AS400,_UserName,_Password);
        SpooledFile objSpoolFile = new SpooledFile(objAS400,
                                                    _SpoolFileName, 
                                                    _SpoolFileNumber, 
                                                    _SpoolFileJobName , 
                                                    _SpoolFileUserName, 
                                                    _SpoolFileJobNumber );
        PrintParameterList objPPL = new PrintParameterList();
        PrintObjectTransformedInputStream objInputStream;
        objInputStream = objSpoolFile.getTransformedInputStream(objPPL);
        int intInputStreamSize = objInputStream.available();           
        byte[] objSpoolByte = new byte[intInputStreamSize];
        objInputStream.read(objSpoolByte); 
        AS400Text textConverter = new AS400Text(intInputStreamSize,37);  
        strConvertedFile = ((String) textConverter.toObject(objSpoolByte));
        objInputStream.close();
        objAS400.disconnectAllServices();
        return strConvertedFile;
    }   

My thought is either a bug in the JT400 (I don't know which version we have,
we are on V5R2), or it is a problem with the spool file. I am going to have
the person create a new spool file to see if this still has the problem.

Just to warn you, I am not a java guru. I just know enough to be dangerous.

Mike Wills
Lawson Programmer/Administrator
Taylor Corporation
Email: mnwills AT taylorcorpNOSPAM DOT com
AIM: iSeriesCodePoet

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.