Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
INCLUDE 2 conditions to copy in the output file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: INCLUDE 2 conditions to copy in the output file
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: 8391
Location: Dubuque, Iowa, USA

PostPosted: Tue Jul 03, 2018 7:43 pm    Post subject: Reply to: INCLUDE 2 conditions to copy in the output file
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: 8714
Location: Welsh Wales

PostPosted: Tue Jul 03, 2018 7:48 pm    Post subject:
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

Active User


Joined: 29 Apr 2008
Posts: 363
Location: Maryland

PostPosted: Tue Jul 03, 2018 11:24 pm    Post subject: Re: INCLUDE 2 conditions to copy in the output file
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    Post subject:
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

Moderator


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

PostPosted: Thu Jul 05, 2018 4:01 am    Post subject:
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

Active User


Joined: 29 Apr 2008
Posts: 363
Location: Maryland

PostPosted: Thu Jul 05, 2018 7:27 am    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 2016
Location: NY,USA

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

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

Moderator


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

PostPosted: Thu Jul 05, 2018 3:58 pm    Post subject:
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

Active User


Joined: 29 Apr 2008
Posts: 363
Location: Maryland

PostPosted: Thu Jul 05, 2018 5:05 pm    Post subject:
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: 8391
Location: Dubuque, Iowa, USA

PostPosted: Fri Jul 06, 2018 8:11 pm    Post subject:
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    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 ISPF 3.4 edit of a ps file, disp use... Carrie Da Silva TSO/ISPF 3 Fri Sep 21, 2018 3:01 am
No new posts ICETOOL - Finding keys within a file nartcr DFSORT/ICETOOL 10 Mon Sep 17, 2018 6:39 am
No new posts Remove selected duplicate rows from t... hnharish DFSORT/ICETOOL 3 Wed Sep 05, 2018 3:11 am
No new posts Splitting one record in a file to 10 ... mf_123 DFSORT/ICETOOL 9 Tue Aug 21, 2018 8:51 pm
No new posts CLOB Column data to External File usi... lalitmehta12 DB2 9 Tue Aug 21, 2018 7:22 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us