Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Using Include Condition in DFSORT- doubt

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Using Include Condition in DFSORT- doubt
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: 2431
Location: Netherlands, Amstelveen

PostPosted: Tue May 04, 2010 2:17 pm    Post subject:
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    Post subject: Reply to: Using Include Condition in DFSORT- doubt
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: 2431
Location: Netherlands, Amstelveen

PostPosted: Tue May 04, 2010 2:28 pm    Post subject:
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    Post subject: Reply to: Using Include Condition in DFSORT- doubt
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: 2431
Location: Netherlands, Amstelveen

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

Absolutely.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue May 04, 2010 11:03 pm    Post subject:
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    Post subject: Reply to: Using Include Condition in DFSORT- doubt
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Joinkeys with condition scdinesh DFSORT/ICETOOL 10 Tue Feb 14, 2017 12:20 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Doubt in MFS abdulrafi IMS DB/DC 2 Fri Oct 21, 2016 3:09 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us