Re: [CMS-PIPELINES] Incorrect Handling of Negative Numbers With PICK?

2016-08-23 Thread Glenn Knickerbocker
On 8/23/2016 4:58 PM, Ronald van der Laan wrote:
> You're doing string compares, so "-0.." is less than "-1".

>> pipe '  (end ?) < ' filename filetype filemode,
>>  '| pick w2  <= /-1/ ',

No, he's using the newer numerical comparison operator "<=", not the
string comparison operator "<<=".

Looks like this problem's been there from the start.  I see it in the
oldest level I have saved with this syntax, 110B0016, and in the latest
version in test.  The comparison comes out backwards when the first
number is between -1 and -0 and the second is -1 or less:

pipe literal -0.3 -1.2|literal -0.3 -0.9|pick w1 < w2|cons
-0.3 -1.2
Ready;

pipe literal -0.3 -1.2|literal -0.3 -0.9|pick w1 > w2|cons
-0.3 -0.9
Ready;

pipe literal -0.3 -1.2|literal -0.3 -0.9|pick w2 < w1|cons
-0.3 -0.9
-0.3 -1.2
Ready;

pipe literal -0.3 -1.2|literal -0.3 -0.9|pick w2 > w1|cons
Ready;

(I can't help thinking this must have some esoteric connection to the
mixture of zero-based and one-based numbering of streams in the doc.)

¬R


Re: [CMS-PIPELINES] Incorrect Handling of Negative Numbers With PICK?

2016-08-23 Thread Michael Harding
Wrong, that should be doing a numeric compare.  Look it up.
A comparison operator of <<= would be for a string compare.  "<=" asks for
numeric comparison.

--
Mike Harding
z/VM System Support
/sp


CMSTSO Pipelines Discussion List  wrote on
08/23/2016 01:58:27 PM:

> From: Ronald van der Laan 
> To: CMS-PIPELINES@VM.MARIST.EDU
> Date: 08/23/2016 01:59 PM
> Subject: Re: Incorrect Handling of Negative Numbers With PICK?
> Sent by: CMSTSO Pipelines Discussion List 
>
> Michael,
>
> You're doing string compares, so "-0.." is less than "-1".
> You'll also find that "-200.000" will not pass your filter...
> Try  ... | pick substr 1 of w2 = /-/ and substr 2-* of w2 >>=
> /0001.00/ | ...
>
> Op dinsdag 23 augustus 2016 heeft Michael Marrer 
> het volgende geschreven:
>
> > This would seem to be basically working, as I do get the numbers less
> > than negative 1 in the output file:
> >
> > pipe '  (end ?) < ' filename filetype filemode,
> >  '| pick w2  <= /-1/ ',
> >  '| > ' filename ' WORDOVER ' filemode,
> >  ' '
> >
> > The problem is that I get ALL negative numbers, not just those less
> > than negative 1.  For example, these get selected as well:
> >
> > -
> >
> > -.007800
> >
> > So does anyone have any idea what is going wrong?
> >
> > I know I can also accomplish what I want by defining the word with a
> > variable in a SPECs stage and doing an IF/THEN operation, but as I
> > will be doing other tests on that word as well as other words in the
> > data file, it will get a little convoluted.
> >
> > I believe this represents the level of Pipes we are using:
> >
> > 11 Rev 0C Mod 0002
> > 110C0002
> >
>
>
> --
> Ronald van der Laan
>


Re: [CMS-PIPELINES] Incorrect Handling of Negative Numbers With PICK?

2016-08-23 Thread Ronald van der Laan
Michael,

You're doing string compares, so "-0.." is less than "-1".
You'll also find that "-200.000" will not pass your filter...
Try  ... | pick substr 1 of w2 = /-/ and substr 2-* of w2 >>=
/0001.00/ | ...

Op dinsdag 23 augustus 2016 heeft Michael Marrer 
het volgende geschreven:

> This would seem to be basically working, as I do get the numbers less
> than negative 1 in the output file:
>
> pipe '  (end ?) < ' filename filetype filemode,
>  '| pick w2  <= /-1/ ',
>  '| > ' filename ' WORDOVER ' filemode,
>  ' '
>
> The problem is that I get ALL negative numbers, not just those less
> than negative 1.  For example, these get selected as well:
>
> -
>
> -.007800
>
> So does anyone have any idea what is going wrong?
>
> I know I can also accomplish what I want by defining the word with a
> variable in a SPECs stage and doing an IF/THEN operation, but as I
> will be doing other tests on that word as well as other words in the
> data file, it will get a little convoluted.
>
> I believe this represents the level of Pipes we are using:
>
> 11 Rev 0C Mod 0002
> 110C0002
>


--
Ronald van der Laan


[CMS-PIPELINES] Incorrect Handling of Negative Numbers With PICK?

2016-08-23 Thread Michael Marrer

This would seem to be basically working, as I do get the numbers less
than negative 1 in the output file:

pipe '  (end ?) < ' filename filetype filemode,
 '| pick w2  <= /-1/ ',
 '| > ' filename ' WORDOVER ' filemode,
 ' '

The problem is that I get ALL negative numbers, not just those less
than negative 1.  For example, these get selected as well:

-.017500
-.007800

So does anyone have any idea what is going wrong?

I know I can also accomplish what I want by defining the word with a
variable in a SPECs stage and doing an IF/THEN operation, but as I
will be doing other tests on that word as well as other words in the
data file, it will get a little convoluted.

I believe this represents the level of Pipes we are using:

11 Rev 0C Mod 0002
110C0002