Jan 24, 2006
Using Conditional Processing to Test Multiple Occurrences of a Trigger Value
Question:
I have a character that occurs in the same printline of every data page, but at different positions within the record. Can I use conditional processing to test for the occurrence of this character, regardless of the position it is in within the record, to trigger a change in format?
Answer:
The answer is yes. However, you must create a separate condition statement for each potential location of the character in order to have at least one occurrence to cause the condition test to be true. An example for invoking the same COPYGROUP and PAGEFORMAT, regardless of where the test criteria character is, would be:
CONDITION C1
POSITION 1 LENGTH 1
WHEN EQ ‘$’
COPYGROUP ABC
PAGEFORMAT ABC;
CONDITION C1
POSITION 2 LENGTH 1;
CONDITION C1
POSITION 3 LENGTH 1;
An example for invoking a different COPYGROUP and/or PAGEFORMAT, based on where the test criteria character is, would be:
CONDITION C1
POSITION 1 LENGTH 1
WHEN EQ ‘$’
COPYGROUP F2000ABC
PAGEFORMAT P2000ABC;
CONDITION C2
POSITION 2 LENGTH 1
WHEN EQ ‘$’
COPYGROUP F2000DEF
PAGEFORMAT P2000DEF;
CONDITION C3
POSITION 3 LENGTH 1
WHEN EQ ‘$’
COPYGROUP F2000GHI
PAGEFORMAT P2000ABC;
Keep in mind, however, this assumes that no other occurrences of the test criteria character occurs in each record within the specified search locations. If more than one occurrence of the test criteria characters is in the record, the first occurrence will be used and all others will be ignored as conditional test criteria.
Check out the Page Printer Formatting Aid (PPFA) reference materials available from IBM at:
http://www-1.ibm.com/support/search.wss?rs=0&lang=en&loc=en_US&r=10&cs=iso-8859-1&rankfile=0&cc=us&spc=&stc=&apar=include&q1=ppfa&q2=&sort=desc&tc=&Go.x=10&Go.y=12&dc=DA410+DA450&dtm
If you would like some additional information on PPFA or MO:DCA or
If you would like additional information on AFP Tips and Techniques, please feel free to contact COPI at: 1-888-999-COPI.
Or, you can also view the archive of past AFP related articles by clicking here.