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



Your program is asking for all of the characters in the spool file.  I'm not
sure what you mean when you ask how to avoie grabbing an end of page
character.  Depending on what you want to do, you'll have to code for this
in your program.  There is no input stream out of the box, that I know of,
skips over end-of-page characters.  You might want to have a look at
PrintObjectPageInputStream and see if that meets your needs.

HTH,
Gary

> -----Original Message-----
> From: java400-l-bounces@xxxxxxxxxxxx 
> [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Wills, 
> Mike N. (TC)
> Sent: Tuesday, December 23, 2003 1:08 PM
> To: Java Programming on and around the iSeries / AS400
> Subject: RE: Converting from EBCDIC to ASCII
> 
> 
> I think it is the "end of page" character. How would one 
> avoid grabbing that? 
> 
> -----Original Message-----
> From: Gary L Peskin
> 
> Since you're not doing any transforms and not setting the 
> required attributes in the PrintParameterList, it seems like 
> you'd be better off with a PrintObjectInputStream rather than 
> a PrintObjectTransformedInputStream.
> You can obtain this with 
> 
>   objSpoolFile.getInputStream()
> 
> If it still doesn't work, can you examine or print out 
> objSpoolByte (in hex) and intInputStreamSize?  Also, can you 
> please assign the return value of 
> 
>   objInputStream.read(objSpoolByte)
> 
> to an int and print out the value of that int?
> 
> Gary
> 
> > -----Original Message-----
> > From: java400-l-bounces@xxxxxxxxxxxx 
> > [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Wills, Mike N.
> > (TC)
> > Sent: Tuesday, December 23, 2003 8:40 AM
> > To: Java Programming on and around the iSeries / AS400
> > Subject: Converting from EBCDIC to ASCII
> > 
> > 
> > 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 ...

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.