MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to Save records which does not satisfy conditions?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Tue Oct 14, 2008 12:56 pm    Post subject: How to Save records which does not satisfy conditions? Reply with quote

Hi,

I need to create a file which is based on some condition and all the remaining records which doesnt satisfy that condition has to go into another file. I code my condition as
Code:

SORT FIELDS=(19,15,CH,A)                     
OUTFIL FILES=1,                             
       INCLUDE=(19,10,CH,EQ,C'8003506230',OR,
                19,10,CH,EQ,C'8003556232',OR,
                19,10,CH,EQ,C'8015406231',OR,
                19,10,CH,EQ,C'8015406232')

So all records satisfying this condition goes into SORTOF1, remaining records should go into another file.

I cant use SUM FIELDS=NONE,XSUM because the key field can have duplicate values

Pls help

Thanks
_________________
Arvind
"You can make a difference with your smile. Have that with you always"
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Tue Oct 14, 2008 1:27 pm    Post subject: Re: Doubt in SORT Reply with quote

arvibala wrote:
Hi,

I need to create a file which is based on some condition and all the remaining records which doesnt satisfy that condition has to go into another file.


Use the following Control cards

Code:

SORT FIELDS=(19,15,CH,A)                     
OUTFIL FILES=1,                             
       INCLUDE=(19,10,CH,EQ,C'8003506230',OR,
                19,10,CH,EQ,C'8003556232',OR,
                19,10,CH,EQ,C'8015406231',OR,
                19,10,CH,EQ,C'8015406232')
OUTFIL FILES=2,SAVE                             


parm SAVE on outfil specifies that OUTFIL input records not included by STARTREC, ENDREC, SAMPLE, INCLUDE or OMIT for any other OUTFIL group are to be included in the data sets for this OUTFIL group. SAVE operates in a global fashion over all of the other OUTFIL statements for which SAVE is not specified, enabling you to keep any OUTFIL input records that would not be kept otherwise. SAVE will include the same records for each group for which it is specified.

Quote:

So all records satisfying this condition goes into SORTOF1, remaining records should go into another file.


All the records which are omitted from the first group will be in SORTOF2 dataset.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Tue Oct 14, 2008 3:14 pm    Post subject: Reply with quote

Thanks a lot Kolusu, it works.
_________________
Arvind
"You can make a difference with your smile. Have that with you always"
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group