Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
Priti_S

New User

Joined: 18 Feb 2009
Posts: 8
Location: pune

 Posted: Wed May 27, 2009 10:27 am    Post subject: What does SS in the omit cond mean? 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

Frank Yaeger

DFSORT Moderator

Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

Posted: Wed May 27, 2009 9:49 pm    Post subject:

SS is for substring search. See the following for more details:

http://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'.
vvmanyam

New User

Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

Posted: Thu May 28, 2009 5:38 pm    Post subject:

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
dbzTHEdinosauer

Global Moderator

Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

Posted: Thu May 28, 2009 6:20 pm    Post subject:

 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.
Arun Raj

Moderator

Joined: 17 Oct 2006
Posts: 2352
Location: @my desk

 Posted: Thu May 28, 2009 8:23 pm    Post subject: I just tested it in SyncSort and I am totally lost
Frank Yaeger

DFSORT Moderator

Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

Posted: Thu May 28, 2009 9:16 pm    Post subject:

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.
dbzTHEdinosauer

Global Moderator

Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

 Posted: Thu May 28, 2009 10:22 pm    Post subject: vvmanyam, you were correct. I apologize for my post.
Frank Yaeger

DFSORT Moderator

Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

Posted: Thu May 28, 2009 10:45 pm    Post subject:

Dick,

 Quote: I'd be careful trying to catch Frank in an error.

 Quote: you were correct.

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.
dbzTHEdinosauer

Global Moderator

Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

 Posted: Thu May 28, 2009 11:57 pm    Post subject: 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?
gcicchet

Senior Member

Joined: 28 Jul 2006
Posts: 1703
Location: Australia

Posted: Fri May 29, 2009 4:04 am    Post subject:

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
 Code: ,DE

I would use
 Code: 1,3,CH,EQ,C'ABC',OR,                1,3,CH,EQ,C'DEF')

Gerry
Frank Yaeger

DFSORT Moderator

Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

Posted: Fri May 29, 2009 4:41 am    Post subject:

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.
gcicchet

Senior Member

Joined: 28 Jul 2006
Posts: 1703
Location: Australia

Posted: Fri May 29, 2009 8:18 am    Post subject:

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
vvmanyam

New User

Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

 Posted: Fri May 29, 2009 12:25 pm    Post subject: Frank,Gerry, Dick, Arun!! Thanks for all your inputs!! Regards, Balu
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm Include/omit with "ALL" pa... mgl DFSORT/ICETOOL 6 Wed Jun 14, 2017 2:31 pm how to DYNAMICALLY write sort cond to... mohamedmubee COBOL Programming 13 Fri Aug 26, 2016 11:46 pm COND parameter vs IF THEN ELSE Alks JCL & VSAM 11 Fri Jun 17, 2016 5:28 pm Include Cond issue vickey_dw DFSORT/ICETOOL 6 Tue Mar 29, 2016 8:51 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us