> The way Ive written a SPEC stage appears to be causing error:
>
> FPLSPX1038E Not a decimal number: RANDOM EXEC F 80 40 1 2013-02-06 07:40:30
> FPLMSG003I ... Issued from stage 5 of pipeline 1
> FPLMSG001I ... Running "SPEC a: 1-* . SELECT SECOND b: 1-* . IF (a,==b) TH"
>
> Input is paired sets of records (strings via two LISTFILE, already fed 
> through a LOOKUP).
> The intention is that output will be suppressed unless the pair of records 
> (strings) are not equal.

The messages suggest that you're using older plumbing that did not do strings
in named fields like that. But apart from that, this is probably not what you
want to do. The 'second reading' in spec makes it process each record twice,
not process records pairwise.

There is 'unique pairwise' that might help you out. But if you're comparing
the records pairwise like that, the more obvious approch is to put the two
records side by side and use 'pick' on the two ranges.

   pad 100 | join | pick 21.80  /== 121.80

If you know the length of the records, you can tell where the ranges are. I
was a bit lazy and made them 100 wide so the numbers were easier to compute.

PS I think this is the last example from my series 'Showing Off with Lookup'
that I had in my presentation in Munch this spring. I notice it has the same
trick with the 'pad 100' ;-)

/* NEWFILES EXEC On both, show newer */
arg fn ft fm1 fm2 . ; if fm2 = '' then exit 24
address command
'PIPE (end \ name NEWFILES.EXEC:7)',
  '\ command LISTFILE' fn ft fm1 '( NOH ISO',
  '| x: lookup w1.2 detail master',
  '| pad 100',
  '| join',
  '| pick 57.19 >> 157.19',
  '| chop 20',                    /* Just fn ft fm */
  '| cons',
  '\ command LISTFILE' fn ft fm2 '( NOH ISO',
  '| x:',
exit rc

And I owe you some neat examples with 'select second'

Sir Rob the Plumber

Reply via email to