|
|
| Author |
Message |
ykishore
Active User
Joined: 12 Aug 2005 Posts: 53 Location: USA
|
|
|
|
Hii
can any body let me know how below statement works!!
INCLUDE COND=(15,1,SS,EQ,C'ABC') |
|
| Back to top |
|
 |
References
|
|
 |
MGIndaco
Moderator
Joined: 10 Mar 2005 Posts: 478 Location: Milan, Italy
|
|
| Back to top |
|
 |
ykishore
Active User
Joined: 12 Aug 2005 Posts: 53 Location: USA
|
|
|
|
Hi
Thanks alot!! |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4684 Location: San Jose, CA
|
|
|
|
| Quote: |
This statement will not work or will work without the needed result.
|
That's NOT true. In this case, C'ABC' is MORE correct then C'A,B,C'.
| Code: |
INCLUDE COND=(15,1,SS,EQ,C'ABC')
|
will check for 'A' in 15, then 'B' in 15, then 'C' in 15.
| Code: |
INCLUDE COND=(15,1,SS,EQ,C'A,B,C')
|
will check for 'A' in 15, then ',' (comma) in 15, then 'B' in 15, then ',' in 15, then 'C' in 15. So if there's a comma in 15, the record will be included which is probably NOT what's wanted. Of course, in most cases, there isn't a comma in 15, so using the comma as a separator does not cause a problem. But for a 1-byte field with SS, it's best NOT to use a separator between the elements.
For larger fields with SS, you normally want the separator to indicate which contiguous characters you're searching for. For example:
| Code: |
INCLUDE COND=(15,2,SS,EQ,C'ABCDEF')
|
will look for 'AB' in 15-16, then 'BC' in 15-16, then 'CD' in 15-16, then 'DE', then 'EF' in 15-16. If you only want a "hit" on 'AB' or 'CD' or 'EF' and not on 'BC' or 'DE', then you need to use:
| Code: |
INCLUDE COND=(15,2,SS,EQ,C'AB,CD,EF')
|
which will look for 'AB' in 15-16, then 'B,' in 15-16, then ',C' in 15-16, then 'CD' in 15-16, then 'D,' in 15-16, then ',E' in 15-16, then 'EF' in 15-16. Be sure to use a separator that will NOT be found (e.g. if 15-16 could contain ',E' but can't contain '-E', use C'AB-CD-EF'). |
|
| Back to top |
|
 |
MGIndaco
Moderator
Joined: 10 Mar 2005 Posts: 478 Location: Milan, Italy
|
|
|
|
Ok, excuse me...
I don't tested it at the moment and I've only read the manual.
I must apologize to you.
Thank for your explanation. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4684 Location: San Jose, CA
|
|
|
|
No apology necessary. Since the the separator character is generally needed, leaving it out for 1-byte fields is not actually covered in the doc, so I understand how you drew the conclusion you did. Of course, since I developed the code, I know how it actually works.  |
|
| Back to top |
|
 |
ykishore
Active User
Joined: 12 Aug 2005 Posts: 53 Location: USA
|
|
|
|
Hi
Thanks for ur information!! |
|
| Back to top |
|
 |
|
|
|