|
View previous topic :: View next topic
|
| Author |
Message |
Priti_S
New User
Joined: 18 Feb 2009 Posts: 8 Location: pune
|
|
|
|
Hi,
I was just reading thru one of the post for sort. I wanted to know what does the SS in the following omit condition mean?
OMIT COND=(1,1,SS,EQ,C'H,T')
and can we achieve the same result using
OMIT COND=(1,1,CH,EQ,C'H,T')
Regards |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
SS is for substring search. See the following for more details:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG30/2.2.6?DT=20080529102039
Those two OMIT statements will not achieve the same result.
| Code: |
OMIT COND=(1,1,SS,EQ,C'H,T')
|
Will omit the record if it has H or T (or comma) in position 1.
| Code: |
OMIT COND=(1,1,CH,EQ,C'H,T')
|
Will omit the record if it has H in position 1. C'H,T' is truncated to the length of the field = 1 -> C'H'. |
|
| Back to top |
|
 |
vvmanyam
New User
Joined: 16 Apr 2008 Posts: 86 Location: Bangalore
|
|
|
|
I have got another doubt here!!
1. From the link provided by you
| Code: |
INCLUDE COND=(106,5,SS,EQ,C'BIOL ,HIST ,BUSIN,PSYCH')
|
2.
| Code: |
OMIT COND=(1,1,SS,EQ,C'H,T')
|
As you mentioned, the second codition is searching for 3 strings they are
1. 'H'
2. ','
3. ' T'
Which means that ',' is not used as seperator, its just another string.
So, in that case the first codition should search for the following strings right?
1. 'BIOL '
2. ',HIST'
3. ' ,BU'
4. 'SIN,P'
5. 'SYCH' but this not right. How is this handled?
In what case ',' is used as seperator and in what case it is used as another string?
If length of the string is one, will comma be used as another string?
Regards,
Balu |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
| Code: |
C'BIOL ,HIST ,BUSIN,PSYCH'
--12345-12345-12345-12345
|
I'd be careful trying to catch Frank in an error.
Were he a COBOL programmer, I'd maybe try.
But he is an assembler type.........don't mess with them.
The kind of quality control that the SORT Team has to go thru
(a gazillion users)
makes them somewhat precise.
My advice, always double check......which you did not do. |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
I just tested it in SyncSort and I am totally lost  |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
The comma is part of the string. Here's what the DFSORT APG says:
| Quote: |
| Note that the comma is used within the constant to separate the valid values; any character that will not appear in the field value can be used as a separator in the constant. |
The best way to illustrate this is with a better example. Say we have:
1,3,SS,EQ,C'ABC,DEF'
SS first searches for 'ABC', then 'BC,', then 'C,D', then 'DEF'.
If the record can contain 'BC,' or 'C,D', then that matters. But in most cases, only ABC or DEF would appear in the record, so the combinations with the comma don't matter. Usually, inserting comma separators is enough to prevent getting a hit on any unwanted values. Another separator could be used instead, e.g. C'ABC$DEF' if that will work where the comma wouldn't.
| Quote: |
| If length of the string is one, will comma be used as another string? |
Yes. If the comma is a problem in that case, you could just use 1,1,SS,EQ,C'HT'.
SS doesn't really use the separator as a separator. It's just another character, but that's usually not a problem. However, it helps to know how it actually works (as documented in the book) in case the use of the separator ever does matter. |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
vvmanyam,
you were correct. I apologize for my post. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Dick,
| Quote: |
| I'd be careful trying to catch Frank in an error. |
Sorry to nitpick, but can you clarify what you were correct about.
AFAIK, I didn't make any error in my description of SS. vvmanyam was correct in his question about how it worked, but I never said that it worked any other way and neither did the DFSORT APG. |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
His and your explanation of SS were the same.
I assumed that an SS clause with a length meant that the search-keys were blocked.
But they are not. I thought that the comma was/is a separator.
I did not think that you had made an error.
I tried to take part in a discussion where I had no knowledge.
ok, is everybody happy now? |
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
OK, for my 2 cents worth, for SS where the length of the key is greater than 1 byte I would not use this approach, nor use a separator.
Why carry out more tests than is required. ?
In this case
| Code: |
1,3,SS,EQ,C'ABC,DEF'
SS first searches for 'ABC', then 'BC,', then 'C,D', then 'DEF'.
|
I think you may have missed
I would use
| Code: |
1,3,CH,EQ,C'ABC',OR,
1,3,CH,EQ,C'DEF')
|
Gerry |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Yes, I did miss ,DE (good thing I put code in to do these things instead of doing it myself by hand).
| Quote: |
| Why carry out more tests than is required. ? |
Yes, although SS can be easier to code (especially for a lot of values), it can cost a bit more CPU time. Of course, your mileage may vary - I have found cases where SS actually performs better than OR. |
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Balu,
| Code: |
INCLUDE COND=(106,5,SS,EQ,C'BIOL ,HIST ,BUSIN,PSYCH')
|
equates to a search for the following
| Code: |
BIOL
IOL ,
OL ,H
L ,HI
,HIS
,HIST
HIST
IST ,
ST ,B
T ,BU
,BUS
,BUSI
BUSIN
USIN,
SIN,P
IN,PS
N,PSY
,PSYC
PSYCH
|
Gerry |
|
| Back to top |
|
 |
vvmanyam
New User
Joined: 16 Apr 2008 Posts: 86 Location: Bangalore
|
|
|
|
Frank,Gerry, Dick, Arun!!
Thanks for all your inputs!!
Regards,
Balu |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|