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

Using Include Condition in DFSORT- doubt


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

New User


Joined: 11 Sep 2008
Posts: 29
Location: Kolkata

PostPosted: Tue May 04, 2010 2:09 pm
Reply with quote

Hi All,

I have a simple VB dataset, from which I am trying to just select records. This should include records that have the value '002' in position 13(converted from 9 to 13 for VB file) and also it should exclude those '002' records which contain the values 'ECOC' or 'EPOC' in the position 151(converted from 147 to 151 for VB file).

I used many combinations of include statement, but the problem everytime is that, the second condition which should exlude values ECOC and EPOC is not hapening, if I have only coded exclusion of one value , for example 002 with ECOC, then its correct. It is not able to exclude both ECOC and EPOC at the same time.

Here is the code,

Code:

//SYSIN    DD *
    INCLUDE COND=((13,3,CH,EQ,C'002'),AND,
     (151,4,CH,NE,C'ECOC',OR,
      151,4,CH,NE,C'EPOC'))
    SORT FIELDS=COPY
/*


//SYSIN DD *
INCLUDE COND=((13,3,CH,EQ,C'002'),AND, (151,4,CH,NE,C'ECOC',OR,
151,4,CH,NE,C'EPOC'))
SORT FIELDS=COPY
/*

I think I am going wrong with the precedence of operation here, hence I have tried almost all sorts of order, but none are giving me records with 002 and no ECOC or EPOC together.

Please let me know if you can point out the mistake.

Thnx a lot!
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue May 04, 2010 2:17 pm
Reply with quote

Code:

  INCLUDE COND=((13,3,CH,EQ,C'002'),AND,
   (151,4,CH,NE,C'ECOC',AND,
   151,4,CH,NE,C'EPOC'))
Back to top
View user's profile Send private message
Sudeshna Sarkar

New User


Joined: 11 Sep 2008
Posts: 29
Location: Kolkata

PostPosted: Tue May 04, 2010 2:23 pm
Reply with quote

Fantastic! It worked!

Yes, I did miss out on the basic thing....AND instead of OR.

Thanks a lot Peter.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue May 04, 2010 2:28 pm
Reply with quote

That will be $10.000 icon_razz.gif
Back to top
View user's profile Send private message
Sudeshna Sarkar

New User


Joined: 11 Sep 2008
Posts: 29
Location: Kolkata

PostPosted: Tue May 04, 2010 2:31 pm
Reply with quote

But my thanks is worth more.....not just $10.000 icon_lol.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue May 04, 2010 2:32 pm
Reply with quote

Absolutely.
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: Tue May 04, 2010 11:03 pm
Reply with quote

Note that since you're only using ANDs, this can be simplified to:

Code:

 INCLUDE COND=(13,3,CH,EQ,C'002',AND,
   151,4,CH,NE,C'ECOC',AND,
   151,4,CH,NE,C'EPOC')
Back to top
View user's profile Send private message
Sudeshna Sarkar

New User


Joined: 11 Sep 2008
Posts: 29
Location: Kolkata

PostPosted: Tue May 04, 2010 11:31 pm
Reply with quote

I had chosen the paranthesis, thinking about the order of precedence of operation, but you are right that in this case anyways it is going to handle each record at a time and not a group. I haven't tried this one, but will do so.

Thanx again!
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
Search our Forums:

Back to Top