Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
I think you're misunderstanding how SS works.
When the field length is larger than the string length, as in your example, DFSORT looks for the string within the field, so it will look for C'AAA,BBB'. If you want to look for AAA or BBB in a larger field, then you have to use:
Code:
1,30,SS,EQ,C'AAA',OR,1,30,SS,EQ,C'BBB'
When the field length is smaller than the string, as in this example:
Code:
1,3,SS,EQ,C'AAA,BBB'
DFSORT will check each constant of the specified length against the field. So in this case, DFSORT would check 1-3 for 'AAA', 'AA,', 'A,B', and so on.
You can use any separator or separators you like. Just pick one that won't be found in combination with the strings you're looking for.
For example, if C'AAA,BBB' is a problem because you might have 'AA,' or 'A,B' or ',BB' in 1-3, then you could use C'AAA.BBB' or C'AAA/BBB' or whatever character won't be found.
Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
First of all, happy new year Mr. Frank.
Then, I want to specify that I read much about SS but as usual I'm not able to explain my concept.
What you say is right but I don't know if my concept is only a my need or general because what I'm trying to say is that the SS format in DFSORT is a really powerful solution but not implemented at its top(it's only a my opinion) because the comma may be a separator that allow OR logic operator for the same fields. I mean: these are two sample of what I'm trying to say:
Code:
1,10,SS,EQ,C'AAA',1,10,SS,EQ,C'BBB'
may be the same of:
Code:
1,10,SS,EQ,C'AAA,BBB' *with comma(or custom char) as separator
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
I'm not able to explain my concept
I'm not sure I understand what you're saying or asking. I've explained how SS currently works for the two cases, and the book explains it in more detail.
Are you asking to be able to do the equivalent of:
where comma would be considered a separator and we would search for ABC or DEF or GHI within 1-10? In that case, the actual separator character would be important and would have to be user controlled. But what I'm saying is the separator character doesn't matter with the SS construct using ORs which is currently available and works fine.
Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
Thanks.
I hope you understand that my question was not a critic, I'm doing many works faster only thanks to the power of Sort and my custom and I we are really,really happy.
But yes, I suppose that finally I'm looking for a way to have a new construct that allow "separator" controlled externally.