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

How to use Include and exclude/Omit condition in same step ?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
M.RAJAN

New User


Joined: 18 Jul 2005
Posts: 5
Location: chennai

PostPosted: Sun Feb 21, 2010 9:28 am
Reply with quote

Hi All,

I am new to this forum and trying to find out the alternate solution for the below problem.

My Input:

002 130 1000
002 130 2000
050 090 3000
123 999 4000
345 234 5000
001 234 6000
034 234 7000
025 233 8000
050 987 1500
023 365 9000

Expected Output:

002 130 2000
050 090 3000
050 987 1500

My code is,

SORT FIELDS=(1,15,CH,A)
INCLUDE COND=((1,3,CH,EQ,C'002',AND,9,4,CH,NE,C'1000'),OR,
(1,3,CH,EQ,C'050',AND,9,4,CH,NE,C'1000'))

it is working as expected. But i am trying to find out the alternate way, using Include and Exclude/Omit condition. I would like to get answer in DFSORT as well as SYNCSORT.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Feb 21, 2010 10:02 am
Reply with quote

Hello,

Your working syntax should work for both sort products.

Quote:
But i am trying to find out the alternate way, using Include and Exclude/Omit condition
Why? There would be no efficiencies gained. . .

I believe that neither product supports INCLUDE and OMIT in the same run. . . From the DFSORT manual:
Quote:
You can specify either an INCLUDE statement or an OMIT statement in the same DFSORT run, but not both.
Back to top
View user's profile Send private message
M.RAJAN

New User


Joined: 18 Jul 2005
Posts: 5
Location: chennai

PostPosted: Sun Feb 21, 2010 10:12 pm
Reply with quote

Thanks Dick,

Can you please give me a DFSORT and syncsort manual links ?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sun Feb 21, 2010 10:16 pm
Reply with quote

DFSort: DFSORT/ICETOOL Reference Material
Syncsort, talk to the source.....
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Feb 22, 2010 12:11 am
Reply with quote

Hello,

Syncsort manuals are covered by copyright and we may neither post nor link to them.

If your organization is licensed to use the product, all of the material may be obtained from Syncsort support.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Tue Feb 23, 2010 2:57 am
Reply with quote

Please feel free to send me a PM or contact me offline at alissa.margulies@syncsort.com and I would be happy to assist you with acquiring the SyncSort manuals.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Feb 23, 2010 10:26 am
Reply with quote

Alissa wrote:
Please feel free to send me a PM or contact me offline at alissa.margulies@syncsort.com and I would be happy to assist you with acquiring the SyncSort manuals.

I was just wondering.. Is it free Alissa?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Feb 23, 2010 10:38 am
Reply with quote

Hi Sambhaji,

Yes, if the organization has licensed the product. . .
Back to top
View user's profile Send private message
jctgf
Currently Banned

Active User


Joined: 04 Nov 2006
Posts: 109

PostPosted: Mon Mar 01, 2010 1:20 am
Reply with quote

maybe you can use the IFTHEN statement combined either with the include OR the omit statement.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Mar 01, 2010 2:24 am
Reply with quote

Hello,

How does this reply abput IFTHEN relate to the problem using both INCLUDE and OMIT in the same process. . . icon_sad.gif

As quoted earlier from the manual:
Quote:
You can specify either an INCLUDE statement or an OMIT statement in the same DFSORT run, but not both.
Back to top
View user's profile Send private message
jctgf
Currently Banned

Active User


Joined: 04 Nov 2006
Posts: 109

PostPosted: Mon Mar 01, 2010 3:41 am
Reply with quote

he said he wanted an alternate way of selecting records.
he could use the inrec ifwhen to flag the records and then discard/maintain them either with a simplified omit or include statement.
i wouldn't do that, but it's an "alternate way".
he can use omit and include in the same step since he uses sortfil, and the many outputs can be concatenated if he uses icetool.
these are possibilities, only.
i'd maintain the include statement as presented in the original post, though. to me, it's the best solution since it does what he needs.
regards.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Mar 01, 2010 4:42 am
Reply with quote

Hello,

Have you successfully done "both" in the same Syncsort execution?

Please post only successfully tested "solutions" and the informational system output from them.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Mar 01, 2010 7:01 am
Reply with quote

Quote:
he can use omit and include in the same step since he uses sortfil, and the many outputs can be concatenated if he uses icetool
jctgf,

What did you mean by the above statement? icon_rolleyes.gif
Back to top
View user's profile Send private message
jctgf
Currently Banned

Active User


Joined: 04 Nov 2006
Posts: 109

PostPosted: Mon Mar 01, 2010 4:40 pm
Reply with quote

hi,
i think this way is simpler.
both include and omit at the same step.
Code:

//*---------------------------------------------------------------------
//SORT      EXEC  PGM=SORT,REGION=40M                                   
//$ORTPARM  DD DSN=CARDLIB(EVTD010Y),DISP=SHR                           
//SYSOUT    DD SYSOUT=*                                                 
//SORTIN    DD *                                                       
1                                                                       
2                                                                       
//O1        DD SYSOUT=*                                                 
//O2        DD SYSOUT=*                                                 
//SYSIN     DD *                                                       
  SORT FIELDS=COPY                                                     
   OUTFIL FNAMES=O1,INCLUDE=(1,1,ZD,EQ,1)                               
   OUTFIL FNAMES=O2,OMIT=(1,1,ZD,EQ,1)         
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Mar 01, 2010 6:50 pm
Reply with quote

jctgf wrote:
hi,
i think this way is simpler.
both include and omit at the same step.
Simpler..huh icon_eek.gif For what?
Back to top
View user's profile Send private message
jctgf
Currently Banned

Active User


Joined: 04 Nov 2006
Posts: 109

PostPosted: Mon Mar 01, 2010 8:32 pm
Reply with quote

simpler than using icetool.
this is just an "alternate way", as required in the original post.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Mar 01, 2010 8:49 pm
Reply with quote

Quote:
this is just an "alternate way"
The jcl posted by you nowhere relates to the original requirement. Please dont post some crap just for the sake of providing some quick 'alternative'
Back to top
View user's profile Send private message
somunote

New User


Joined: 23 Jan 2010
Posts: 7
Location: Toronto

PostPosted: Tue Mar 09, 2010 5:25 am
Reply with quote

Quote:

I believe that neither product supports INCLUDE and OMIT in the same run. . . From the DFSORT manual:
Quote:
You can specify either an INCLUDE statement or an OMIT statement in the same DFSORT run, but not both.


Quote:

The jcl posted by you nowhere relates to the original requirement. Please dont post some crap just for the sake of providing some quick 'alternative'



why is it crap?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Mar 09, 2010 5:37 am
Reply with quote

Well, if the question was "how can I use INCLUDE and OMIT in the same step to create separate data sets", then your solution would apply. But nobody said anything about separate data sets. Of course, you could have another step to bring those separate data sets together, but that would require another pass.

The fact is you cannot use an INCLUDE statement and an OMIT statement in the same run. You can certainly use one INCLUDE statement or one OMIT statement for multiple conditions that would include or omit records. You can use IFTHEN clauses to set flags that could then be used in OUTFIL INCLUDE. You could do lots of things to solve particular problems. But in this case, it's not clear what the original poster even wanted to do with INCLUDE and OMIT, so it's difficult to say what's relevant as a solution.

I think the original poster got tired of the discussion a long time ago so it's not likely we'll get any clarification.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Mar 09, 2010 5:40 am
Reply with quote

Well put Frank, is it time to just lock the Topic?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Mar 09, 2010 6:05 am
Reply with quote

Quote:
is it time to just lock the Topic?


Yes - done.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts Use input file with OMIT rcd keys? DFSORT/ICETOOL 15
Search our Forums:

Back to Top