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

INCLUDE 2 conditions to copy in the output file


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

New User


Joined: 21 Jun 2018
Posts: 4
Location: India

PostPosted: Tue Jul 03, 2018 7:11 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jul 03, 2018 7:43 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jul 03, 2018 7:48 pm
Reply with quote

Perhaps you mean to use the OR condition to select records.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Tue Jul 03, 2018 11:24 pm
Reply with quote

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
View user's profile Send private message
Chiku kumar

New User


Joined: 21 Jun 2018
Posts: 4
Location: India

PostPosted: Wed Jul 04, 2018 11:45 am
Reply with quote

Thanks everyone "OR" served my purpose ... thanks for all your help on this.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Jul 05, 2018 4:01 am
Reply with quote

You might need to look into the manuals first before posting here and trying different options. That will save your time at first place icon_smile.gif

Good luck!!
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Thu Jul 05, 2018 7:27 am
Reply with quote

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 icon_smile.gif

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Thu Jul 05, 2018 10:17 am
Reply with quote

Somehow Beginers forum becoming obsolete these days.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Jul 05, 2018 3:58 pm
Reply with quote

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 icon_smile.gif

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Thu Jul 05, 2018 5:05 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Jul 06, 2018 8:11 pm
Reply with quote

I think it is more knowing the difference between and / or in English, or y / o in Spanish, or ....
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top