Increasing the number of tokens

Infosphere's Quality Product

Moderators: chulett, rschirm

Post Reply
mdemerick@dow.com
Participant
Posts: 16
Joined: Thu Apr 03, 2008 9:45 am

Increasing the number of tokens

Post by mdemerick@dow.com »

This should be an easy one for most of you. Unfortunately, it's not mentioned in the documentation.

I have a pattern with one recognized token. It is a mix of numbers followed by letters. I know I can separate them using (n) and (-c), but I need to get them into their own tokens for further processing. I have tried using [2] to signify a second token, but it doesn't seem to be working.

Here is one such pattern that I am using:

">
COPY [1](n) tempnum
COPY [1](-c) tempalpha
RETYPE [1] ^ tempnum
RETYPE [2] + tempalpha"

I appears that the 'array length', or whatever it is called, is set to a size of one. Is there anything I can do to get the size to equal two?
stuartjvnorton
Participant
Posts: 527
Joined: Thu Apr 19, 2007 1:25 am
Location: Melbourne

Re: Increasing the number of tokens

Post by stuartjvnorton »

mdemerick@dow.com wrote:This should be an easy one for most of you. Unfortunately, it's not mentioned in the documentation.

I have a pattern with one recognized token. It is a mix of numbers followed by letters. I know I can separate them using (n) and (-c), but I need to get them into their own tokens for further processing. I have tried using [2] to signify a second token, but it doesn't seem to be working.

Here is one such pattern that I am using:

">
COPY [1](n) tempnum
COPY [1](-c) tempalpha
RETYPE [1] ^ tempnum
RETYPE [2] + tempalpha"

I appears that the 'array length', or whatever it is called, is set to a size of one. Is there anything I can do to get the size to equal two?
I don't think you can split a token and insert the new one back into the current sequence of tokens to potentially fit later patterns (well, not that I've been able to find either). Would be a nice thing to have.

In this case when you only have one input token, you shouldn't need to do anything (what exactly are you wanting to do with the 2 parts?). Forget about the retypes and just process tempalpha and tempnum, creating further dummy patterns if you need to do table lookups, etc.
jhmckeever
Premium Member
Premium Member
Posts: 301
Joined: Thu Jul 14, 2005 10:27 am
Location: Melbourne, Australia
Contact:

Post by jhmckeever »

You might find <a href="viewtopic.php?t=104921">this thread</a> on a similar topic useful.

If memory serves, I think the simplest solution suggested was to use a 'pre-processor' PAL script to split the ">" token into separate tokens for digits and alphabetics.

J.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
Post Reply