CMSTSO Pipelines Discussion List <CMS-PIPELINES@vm.marist.edu> wrote on
07/01/2014 09:47:49 AM:

> From: Glenn Knickerbocker <n...@bestweb.net>
> To: CMS-PIPELINES@vm.marist.edu
> Date: 07/01/2014 09:48 AM
> Subject: Re: saving the last section I skipped
> Sent by: CMSTSO Pipelines Discussion List <CMS-PIPELINES@vm.marist.edu>
>
> On 6/30/2014 8:00 PM, I wrote:
> > I'm thinking I could use |BUFFER 1| to delay the contents of the
> > transaction until the timestamp arrives, but timing the insertion of my
> > target timestamp gets awfully messy.
>
> It actually turned out to be simpler to code than I thought, but I wound
> up doing the buffering on the whole file, rather than just the part
> before my target timestamp.  I MERGEd in the target, then PICKed it back
> out, then added it back in downstream of the BUFFER so it would arrive
> just before the previous buffered group of records.
>
> What if I split this into two problems?  MERGE|TOTARGET splits the file
> in two before the target timestamp.  Now how I would I take the section
> after the last timestamp in the first file?  I guess Rob's idea of using
> JOINCONT to make single records is what I've done in the past.
>
> ¬R
>

Maybe I missed something in the problem statement...
Based on how I read your original post - and admittedly just playing - I
quickly came up with

/* *GK Rexx* */
Parse arg cutoff
Signal on Error
Do forever
   'Peekto'   /* anybody home? */
   'CallPipe (End ? Name batch-em)',
     '*:|Pick to after 1.6 == /:time:/',
      '|a:Fanout',
      '|take last',
      '|Pick w2 >>= /'cutoff'/',
      '|ga:Count lines',
      '|dd:Dam',
      '?a:',
      '|Buffer',
      '|dd:',
      '|*:',
      '?ga:',
      '|var gotem'
   If gotem then Do
      'Short'
      Leave
      End
   End
Error: Exit Rc*(Rc<>12)

And it works, but came up with a couple of anomalies, that perhaps someone
can explain.
First, the second pick, matching against the cutoff time works for the >
case but doesn't seem to for the = case.
Second, even though a record is obviously flowing to the Dam, the line
count (var gotem) is always zero, which you can see inserting a cons stage
in front of the var stage.

Here's a drive exec if someone wants to play:
/*
**  GKT Exec
*/
Address Command
td.1 = 'batch1 record1'
td.2 = 'batch1 record2'
td.3 = 'batch1 record3'
td.4 = 'batch1 record4'
td.5 = ':time: 08:11:13 end of batch1'
td.6 = 'batch2 record1'
td.7 = 'batch2 record2'
td.8 = 'batch2 record3'
td.9 = 'batch2 record4'
td.10 = ':time: 08:13:13 end of batch2'
td.11 = 'batch3 record1'
td.12 = 'batch3 record2'
td.13 = 'batch3 record3'
td.14 = 'batch3 record4'
td.15 = ':time: 08:17:13 end of batch3'
td.16 = 'batch4 record1'
td.17 = 'batch4 record2'
td.18 = 'batch4 record3'
td.19 = 'batch4 record4'
td.20 = ':time: 08:21:13 end of batch4'
td.21 = 'batch5 record1'
td.22 = 'batch5 record2'
td.23 = 'batch5 record3'
td.24 = 'batch5 record4'
td.25 = ':time: 09:21:13 end of batch5'
td.0 = 25

Arg when

'PIPE (End ? Name GK_Test)',
' Stem td.',
'|Rexx gk' when,
'|Cons'
Exit Rc

When called with, for example "gkt 08:16:00", it correctly outputs batches
3 - 5, but "gkt 08:17:13" only outputs 4 & 5.

Thanks for any insights,
--
Mike Harding
z/VM System Support

/sp

Reply via email to