RPGLE strtok Example Needed

Glennikins used Ask the Experts™
I am looking for an example of the C function strtok for RPGLE. I need to remove punctuation from a field.  I would like to make the function as a /Copy book.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
One of the best entry points into discussion of strtok() particularly as it relates to RPG can be found here:

"My advice to you:  Never use strtok() in an RPG program."

Read the item at that link and consider the RPG code provided there. Other forward and backward links from there can help fill in peripheral details if needed.

If you really really need strtok() in RPG, though, I think I can provide an example. I know I worked with it a few years ago -- before I discarded the thought and went in a different direction. It doesn't translate well into a RPG paradigm even though it works just like it does in C. It just takes some extra code to expose what's really going on.



I took a different aproach.  Thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial