IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DfSort SS Substring


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Sat Dec 31, 2005 10:40 pm
Reply with quote

Hi to all.
I'd like to know if there is a way to define the separator using the SS format.
I mean: with a simple "search" as:
Code:
 INCLUDE COND=(1,30,SS,EQ,C'AAA')

dfsort work fine but with two item in the constant field as:
Code:
 INCLUDE COND=(1,30,SS,EQ,C'AAA,BBB')

it will not work as expected because comma(for what I've understood) is part of the string and not properly a separator.

Is there a solution?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Sun Jan 01, 2006 1:33 am
Reply with quote

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.
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Mon Jan 02, 2006 3:10 pm
Reply with quote

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


For what I know, if this scenario is true:
Code:
 1,3.SS,EQ,C'AAA,BBB'   = 1,3,SS,EQ,C'AAA',OR,1,3,SS,EQ,C'BBB'


the above may be true too(but it's only a my opinion).

I hope in your patience to interpret my idea.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Mon Jan 02, 2006 9:50 pm
Reply with quote

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:

1,10,SS,EQ,C'ABC',OR,1,10,SS,EQ,C'DEF',OR,1,10,SS,EQ,C'GHI'

with a new construct like:

1,10,NW,EQ,C'ABC,DEF,GHI'

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.
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Mon Jan 02, 2006 10:34 pm
Reply with quote

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.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Mon Jan 02, 2006 10:56 pm
Reply with quote

Ok, I'll add that to the list of candidates for future enhancements to DFSORT. But it's a long list. icon_smile.gif
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Tue Jan 03, 2006 12:38 am
Reply with quote

If it's only a my need I suppose that will be inserted at the end of that list. icon_neutral.gif
Anyway, thanks for your effort.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top