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:
When the field length is smaller than the string, as in this example:
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:
may be the same of:
1,10,SS,EQ,C'AAA,BBB' *with comma(or custom char) as separator
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.