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




Hi Marty,

but trying to manipulate simple bits & bytes like I do in every other
language is like pulling teeth.

Yup, with Java I can do the miraculous in half an hour, the simple in several days. I think it has something to do with the mindset of the PC (not exactly right but a similar group) crowd as opposed to the midrange. Just another piece of evidence, in my mind anyway, that PC, midrange, mainframe all have a lot to learn from each other.

Enough philosophy, though. I think the problem of bypassing the first character (you may actually want to bypass the first four) is pretty simple: use String.substring(). So:

String s2 = s1.substring( 1 );

or

String s2 = s1.substring( 3 );

and work with s2.

It's also pretty efficient because substring uses the same backing array as the original String. Other solutions will probably create an entirely new one, using nearly twice the memory.


Joe Sam

Joe Sam Shirah - http://www.conceptgo.com
conceptGO - Consulting/Development/Outsourcing
Java Filter Forum: http://www.ibm.com/developerworks/java/
Just the JDBC FAQs: http://www.jguru.com/faq/JDBC
Going International? http://www.jguru.com/faq/I18N
Que Java400? http://www.jguru.com/faq/Java400

----- Original Message ----- From: "Urbanek, Marty" <Marty_Urbanek@xxxxxxxxxxxx>
To: <java400-l@xxxxxxxxxxxx>
Sent: Thursday, November 08, 2007 2:21 PM
Subject: Re: Reading spool file with Java


Thanks all you guys for your replies, and thanks for the code, Phil.

Did I mention that I'm not much of a Java programmer? ;-) However I did
finally manage to get your class compiled and got my guy to call it.
Wow, it does such a good job of stripping everything that there's no
hint of carriage control left. Not a problem for XML data, but I'm
hoping to generate a PDF, so I at least need to know where the lines
end.

Sounds like the most expedient way out of this is to use CPYSPLF as has
been suggested.

I may be back here in a while asking elementary Java questions, like how
I interrogate the first byte of a line I read (I'll probably go the FCFC
route on CPYSPLF) and how I get rid of the first byte and keep the rest
of the line. I'm thinking stringbuffer... Every time I work with this
language I'm amazed at how the simple and complex are reversed. Using
somebody else's jar and a few lines of code I can create a PDF document,
but trying to manipulate simple bits & bytes like I do in every other
language is like pulling teeth.

Thanks again,

-Marty

--
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.



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.