Yes, I had decided to do the join, but I was trying to deal with the case that mmmmmmm was blank using IF statements, since I didn't think I could add a number to a blank. That's the bit I couldn't work out. I kept getting errors telling me I couldn't use field specifications after a break item (whatever the heck that is). -- bc
On Thu, Jan 28, 2016 at 5:40 PM, Hobart Spitz <[email protected]> wrote: > Have you considered something like: > > pipe < input.file | join x05 | specs a: f1 . b: substr 8-14 of f2 . 1-* 1 > print a+b 8-14 r | > output.file > > We combine the records pairwise as two fields, making them easier to > process, and then we do what we want on the compound record. > > I hope this helps. > > On Thu, Jan 28, 2016 at 5:22 PM, Bob Cronin <[email protected]> wrote: > > > Hello specs fans, > > > > I have two records, like so: > > > > nnnnnnn > > CCCCCCCmmmmmmmCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC > > > > where nnnnnnn is a right justified integer and mmmmmmm is either that, or > > blanks (which should be considered the equivalent of zero). C is an > > arbitrary character. > > > > I want to emit the just the second record, with the mmmmmmm replaced with > > the sum of nnnnnnn and mmmmmmm (or left alone if nnnnnnn is zero). > > > > I am trying to do this with specs, but am getting nowhere. > > -- > > bc > > > > > > -- > OREXXMan >
