On Wed, 26 May 2010 07:41:49 -0500, Chase, John <jch...@ussco.com> 
wrote:

>> -----Original Message-----
>> From: IBM Mainframe Discussion List On Behalf Of Zaromil Tisler
>>
>> On Tue, 25 May 2010 14:05:08 -0500, Chase, John wrote:
>>
>>
>> >
>> >As specified, the second ("upper") bound is (1,6,CH,LE,C'SMYTHE'), so
>> >"do the comparisons":
>> >
>> >First character 'S' is less or equal to 'S', so it "qualifies;
>> >Second character 'M' is less or equal to 'M', so it "qualifies";
>> >Third character 'O' is less or equal to 'Y', so it "qualifies";
>> >Fourth character '9' is NOT less or equal to 'T', so the entire value
>> >c'SMO99Y' is "disqualified".
>> >
>> >    -jc-
>>
>>
>> Looks like DFSORT uses some other logic :)
>>
>>
>> - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 13:54 ON 
WED
>MAY 26,
>> 2010 -
>>  OPTION  COPY
>>  INCLUDE COND=(1,6,CH,GE,C'SMITH ',AND,1,6,CH,LE,C'SMYTHE')
>>
>> ICE055I 0 INSERT 0, DELETE 0
>> ICE054I 0 RECORDS - IN: 4, OUT: 4
>>
>>
>> SORTOUT contains following records, the same as SORTIN:
>>
>> SMITH
>> SMO99Y
>> SMO#$!
>> SMYTHE
>
>Amazing, baffling and befuddling.  I get the same counter-intuitive
>result.
>
>I won't even try to guess why; I'll just try to limit my future
>participation here to the _asking_ of questions.
>

Look at it this way. In addition to some strings that begin with "SMI" and some 
that begin with "SMY", all strings that begin with "SMJ" through "SMX", 
regardless of what follows those 3 characters, meet both conditions. They are 
greater than "SMITH" and less than "SMYTHE". That includes all strings that 
begin "SMO". The condition is met after comparing 3 characters, and no more 
characters need to be tested.

Bill

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to