On Wed, Aug 5, 2009 at 8:50 PM, Bob Cronin<[email protected]> wrote:
> I must still be missing something because that did not help. Here's the 
> snippet:

Lookup wants to output the unmatched detail through the secondary
before it reads the next detail on the primary input. And as I said,
you need "fanintwo" to feed in the unmatched detail again.

If it stalls, then jeremy should be your friend. My guess is that it
stalls after consuming your input. The fanintwo can't tell whether the
last record of your input stream will be rejected and produce maybe
more copies that you would want to try. So you need to put a gate in
and somehow terminate that, like this:

'\ y: fanin',                         /* Shoot him here...           */
'| g: gate',
'\ *.input.0:',                       /* The detail records          */
'| append literal',                   /* Add a terminator record     */
'| t: drop last',                     /* .. to divert at eof         */
'| i: fanintwo',                      /* With retried details        */
'| g:',                               /* Cut the line here           */
'| l: lookup w1 detail master ',
'| join ,:, ',
'| cons',
'\ *.input.1:',                       /* The masters                 */
'| l:',                               /* Unmatched details           */
'| copy ',                            /* .. give lookup some relief  */
'| z: not verify w1 /ABC/ ',          /* Anything to retry           */
'| xlate w1 lower',                   /* Form detail to retry        */
'| i:',
'\ z:',                               /* Unmatched, no need to retry */
'| insert ,->, before ',
'| cons',
'\ t:',                               /* We have eof on the input    */
'| y:'                                /* .. shoot the gate           */

The retry here is to make the key lowercase and try again. Obviously
you need to do your magic thing.

Rob

Reply via email to