|
View previous topic :: View next topic
|
| Author |
Message |
Sudeshna Sarkar
New User

Joined: 11 Sep 2008 Posts: 29 Location: Kolkata
|
|
|
|
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 |
|
 |
PeterHolland
Global Moderator

Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
| 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 |
|
 |
Sudeshna Sarkar
New User

Joined: 11 Sep 2008 Posts: 29 Location: Kolkata
|
|
|
|
Fantastic! It worked!
Yes, I did miss out on the basic thing....AND instead of OR.
Thanks a lot Peter. |
|
| Back to top |
|
 |
PeterHolland
Global Moderator

Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
That will be $10.000  |
|
| Back to top |
|
 |
Sudeshna Sarkar
New User

Joined: 11 Sep 2008 Posts: 29 Location: Kolkata
|
|
|
|
But my thanks is worth more.....not just $10.000  |
|
| Back to top |
|
 |
PeterHolland
Global Moderator

Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
| Absolutely. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
Sudeshna Sarkar
New User

Joined: 11 Sep 2008 Posts: 29 Location: Kolkata
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|