View previous topic :: View next topic
|
Author |
Message |
Chiku kumar
New User
Joined: 21 Jun 2018 Posts: 4 Location: India
|
|
|
|
I'am using following sort card, But it gives me EMPTY output file:
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(1,2,CH,EQ,C'2V',AND,1,3,CH,EQ,C'222')
as I want the Output to have all the records of the Input file starting with '2V' (at 1st position) in file AND also records starting with '222' (at 1st position) in the input file.
is there something wrong with the above INCLUDE cond. |
|
Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8683 Location: Dubuque, Iowa, USA
|
|
|
|
You are telling SORT that you want records with a V in column 2 -- and with a 2 in column 2. There are, literally, no records that can possibly satisfy both conditions. Hence your INCLUDE will NEVER return any records.
Topic moved as it has nothing to do with COBOL. |
|
Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Perhaps you mean to use the OR condition to select records. |
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 1776
|
|
|
|
Chiku kumar wrote: |
I'am using following sort card, But it gives me EMPTY output file:
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(1,2,CH,EQ,C'2V',AND,1,3,CH,EQ,C'222')
as I want the Output to have all the records of the Input file starting with '2V' (at 1st position) in file AND also records starting with '222' (at 1st position) in the input file.
is there something wrong with the above INCLUDE cond. |
If you need ALL records of one category AND also ALL records of another category, then logical OR is required instead of logical AND. |
|
Back to top |
|
 |
Chiku kumar
New User
Joined: 21 Jun 2018 Posts: 4 Location: India
|
|
|
|
Thanks everyone "OR" served my purpose ... thanks for all your help on this. |
|
Back to top |
|
 |
Pandora-Box
Global Moderator
.jpg)
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
You might need to look into the manuals first before posting here and trying different options. That will save your time at first place
Good luck!! |
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 1776
|
|
|
|
Pandora-Box wrote: |
You might need to look into the manuals first before posting here and trying different options. That will save your time at first place |
No manual would explain the difference between logical OR/AND. One has to have it learned BEFORE starting any attempt of program development. |
|
Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 2996 Location: NYC,USA
|
|
|
|
Somehow Beginers forum becoming obsolete these days. |
|
Back to top |
|
 |
Pandora-Box
Global Moderator
.jpg)
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
sergeyken wrote: |
Pandora-Box wrote: |
You might need to look into the manuals first before posting here and trying different options. That will save your time at first place |
No manual would explain the difference between logical OR/AND. One has to have it learned BEFORE starting any attempt of program development. |
IBM Manuals are so why the best if you look into INCLUDE in Manual they would have given the syntax as relational condition which states either AND or OR could be used 😊
And to understand what is AND or OR you don't need the knowledge of programming just English would suffice.. |
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 1776
|
|
|
|
Pandora-Box wrote: |
IBM Manuals are so why the best if you look into INCLUDE in Manual they would have given the syntax as relational condition which states either AND or OR could be used 😊
And to understand what is AND or OR you don't need the knowledge of programming just English would suffice.. |
As per English, logical AND was “the most logical operation” in the example which started this topic...
Some more is needed in one’s mind to understand the difference. |
|
Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8683 Location: Dubuque, Iowa, USA
|
|
|
|
I think it is more knowing the difference between and / or in English, or y / o in Spanish, or .... |
|
Back to top |
|
 |
|