Author Topic: How to define a variable positioned trigger  (Read 2677 times)

tabuhr

  • Guest
How to define a variable positioned trigger
« on: March 09, 2011, 11:06:47 AM »
Looking for help on defining a variable positioned trigger.....
 
Is there a way to tell OnDemand to look for a trigger in a specific range of columns, instead of a starting column?
 
For example, a dash, that exists in either column 4, column 5 or column 6??
 
I know I can define it as a floating trigger such as..... TRIGGER3=*,*,X'2D',(TYPE=FLOAT)
but this would cause it to look for a dash in every column of every row, but I would like to restrict it to only these 3 columns.  Is this possible??

pankaj.puranik

  • Guest
Re: How to define a variable positioned trigger
« Reply #1 on: March 10, 2011, 08:44:36 AM »
Unlike the RECORDRANGE option that you have for triggers occuring in variable record position, I don't know of any such facility for variable column position.
The only thing you can do is specify a * for the column position. But that would not restrict the search to specific columns.
Let us know if you find an alternative.

Good Luck!!

frasert

  • Guest
Re: How to define a variable positioned trigger
« Reply #2 on: March 10, 2011, 01:19:52 PM »
One way to do this is with the ACIF input and output exits (written in C).

In the input exit you have the ability to alter the record on the fly while it's being processed by ACIF.  So you could search for a particular string (hopefully unique enough) in columns 4, 5, or 6 as per your example and then add some special character (like a tilde) in the whitespace before the string, or in place of the string.  You would ensure that this special character is always on column 4 for example.  You could then use a normal trigger for that character.

In the output exit you would search for the special character and replace it with what it was before, so that in the end the data remains unaltered.

Chapter 5 of the Indexing Reference describes these user exits.

This is a good developerWorks article on the topic ... an oldy but goody:
http://www.ibm.com/developerworks/data/library/techarticle/0307muir/0307muir.html

We are using these exits for certain scenarios. They are basically a last resort if all else fails!

Hope this helps.
« Last Edit: March 10, 2011, 01:22:17 PM by frasert »