Re: [CMS-PIPELINES] swap two records

2019-08-19 Thread Glenn Knickerbocker
On 2019-08-18 9:47 AM, amphitr...@ok.de wrote: > RITA revealed that most of the time is lost (or spent ?) in > rearranging the records for later advantageous use. Instead of > inserting a tag to many lines I now tag _all_ and remove where > appropriate, Substr is so much faster than Insert.

Re: [CMS-PIPELINES] swap two records

2019-08-18 Thread Amphitryon
Am 18.08.2019 um 21:44 schrieb Rob van der Heij: > Did I compete with the join | split approach? Can I also participate with > this? You cap yourself: now 60 ms only. To avoid the Not I bracketed Deal: ... literal | d: deal | drop ... alas there is no further gain by that. Ciao.Mike

Re: [CMS-PIPELINES] swap two records

2019-08-18 Thread Rob van der Heij
On Sun, 18 Aug 2019 at 15:51, wrote: > RITA showed, Glenn's solution is honourable second, while Rob's > suggestion only penultimate far behind ;) > Did I compete with the join | split approach? Can I also participate with this? pipe (end \) literal a b c a b 2 | split | x: if between /b/ 2 |

Re: [CMS-PIPELINES] swap two records

2019-08-18 Thread Amphitryon
RITA showed, Glenn's solution is honourable second, while Rob's suggestion only penultimate far behind ;) The details: I tested only with one log file of 161'000 lines. RITA revealed that most of the time is lost (or spent ?) in rearranging the records for later advantageous use. Instead of

Re: [CMS-PIPELINES] swap two records

2019-08-16 Thread Amphitryon
Am 17.08.2019 um 02:23 schrieb Glenn Knickerbocker: > [...] > A way that's a little tricky but avoids messing with combining records > is to use DROP LAST to delay a copy of the file by one record, [...] > > (end /) ... > | dup: fanout > | strfind '_' > | all: faninany > | ... >

Re: [CMS-PIPELINES] swap two records

2019-08-16 Thread Glenn Knickerbocker
On 2019-08-14 12:45 PM, amphitr...@ok.de wrote: > In a file I have every now and then a record tagged at the > beginning, all other lines begin with blanks. I'd like to change > the sequence of tagged records with the one directly following it > (which is for sure not tagged). A way that's a

Re: [CMS-PIPELINES] swap two records

2019-08-16 Thread Glenn Knickerbocker
On 2019-08-14 5:11 PM, Rob van der Heij wrote: > So true. My dumb. I'm so used to BETWEEN and friends that I forget about > PICK for it. Now I need to revisit all my pipes and see what improvements > there would be (I already spot one where I used PICK to put the marker for > BETWEEN to find -

Re: [CMS-PIPELINES] swap two records

2019-08-14 Thread Amphitryon
Thank you both for all suggestions. I now use Rob's first one, just to keep it as a reminder that Between's "target" argument may also be a number of records. Am 14.08.2019 um 18:49 schrieb Rob van der Heij: > | x: if between /tag/ 2 > | spec 1-* c2x > | join / / > | spec w2 1 w1 nw > |

Re: [CMS-PIPELINES] swap two records

2019-08-14 Thread Rob van der Heij
On Wed, 14 Aug 2019 at 22:37, Michael Harding wrote: > Not so. Pick will pass the target and next record and fire off again the > next time the target is recognized. > So true. My dumb. I'm so used to BETWEEN and friends that I forget about PICK for it. Now I need to revisit all my pipes and

Re: [CMS-PIPELINES] swap two records

2019-08-14 Thread Michael Harding
Not so. Pick will pass the target and next record and fire off again the next time the target is recognized. t pt data PT DATA A1 as of 08/14/19 11.02.42 record 1 record 2 tg tagged 1 record 4 record 5 record 6 tg tagged 2 record 7 record 8 record 9 Ready; T=0.01/0.01 13:35:53

Re: [CMS-PIPELINES] swap two records

2019-08-14 Thread Rob van der Heij
On Wed, 14 Aug 2019 at 20:18, Michael Harding wrote: > Perhaps simpler, as a rexx stage: > > '|a:Pick anycase from 1+ == /'tag'/ count 2', Notice that PICK will do the trick only once for the entire stream. I read Mike's "now and then" as multiple swapped records in a single stream, so that's

Re: [CMS-PIPELINES] swap two records

2019-08-14 Thread Rob van der Heij
> > I can also do a trick with not deal | gather if you want :-) >> >>

Re: [CMS-PIPELINES] swap two records

2019-08-14 Thread Michael Harding
Perhaps simpler, as a rexx stage: Parse arg tag . 'CallPipe (End ?) *:', '|a:Pick anycase from 1+ == /'tag'/ count 2', '|Spec a: 1-* . set #0:=a read 1-* n write print #0 1', '|b:Faninany', '|*:', '?a:|b:' Exit Rc -- Mike Harding z/VM System Support mhard...@us.ibm.com

Re: [CMS-PIPELINES] swap two records

2019-08-14 Thread Rob van der Heij
| x: if between /tag/ 2 | spec 1-* c2x | join / / | spec w2 1 w1 nw | split | spec 1-* x2c | x: Or close... On Wed, 14 Aug 2019 at 18:45, wrote: > In a file I have every now and then a record tagged at the > beginning, all other lines begin with blanks. I'd like to change > the

[CMS-PIPELINES] swap two records

2019-08-14 Thread Amphitryon
In a file I have every now and then a record tagged at the beginning, all other lines begin with blanks. I'd like to change the sequence of tagged records with the one directly following it (which is for sure not tagged). I tried with Fanintwo, but failed. I considered a mod of Throttle REXX