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 

Eliminate the records and move those records to a file

 
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
waves
Beginner


Joined: 09 Nov 2006
Posts: 35
Topics: 12

PostPosted: Fri Dec 07, 2007 1:21 am    Post subject: Eliminate the records and move those records to a file Reply with quote

Hi all,
i have two questions.

first one is as follows:

i'm using two sort conditions to eliminate the following:

a) zeroes in the Timestamp field

//SYSIN DD *
SORT FIELDS=COPY
OMIT COND=(260,14,CH,EQ,C'00000000000000')
//*

b)all blanks in the two columns.

//SYSIN DD *
SORT FIELDS=COPY
OMIT COND=(188,13,CH,EQ,C' ')
//*

is there any possibility to merge the above said sort conditions using SYNCSORT tool.

My second question is as follows:

after doing the above sort fucntions, i will be recieving the sorted record without the zeroes and blanks in the respective fields.

i want those records for which i eliminated the zeroes and blanks to be moved to a separate file.

please help me on this. please correct me if i'm wrong anywhere.

thanks in advance.
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Fri Dec 07, 2007 1:33 am    Post subject: Reply with quote

Waves,

For your first question: Yes you can combine both the conditions as below.
Code:

 //SYSIN   DD *                                                     
   SORT FIELDS=COPY                                                 
   OMIT COND=((260,14,CH,EQ,C'00000000000000'),AND,(188,13,CH,EQ,C' '))
 /*                                                                 

If you want to eliminate records which has both zeros and blanks use AND in between the conditions. If you wanna eliminate records either with zeros or blanks then use OR.
Back to top
View user's profile Send private message Send e-mail
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Fri Dec 07, 2007 1:40 am    Post subject: Reply with quote

Waves,

For your second question: You can extract the eliminated records by checking for zeros or blanks in your input file as below.
Code:

//SYSIN   DD *                                                       
  SORT FIELDS=COPY                                                   
  INCLUDE COND=((2,14,CH,EQ,C'00000000000000'),AND,(18,13,CH,EQ,C' '))
/*         


OR you can use any file comparision methods used in the below link to extract records with zeros/blanks.
http://www-304.ibm.com/jct01004c/systems/support/storage/software/sort/mvs/tricks/pdf/sorttrck.pdf
Back to top
View user's profile Send private message Send e-mail
waves
Beginner


Joined: 09 Nov 2006
Posts: 35
Topics: 12

PostPosted: Fri Dec 07, 2007 3:04 am    Post subject: Reply with quote

hi Vkphani,

thanks a lot for ur quick reply.

the solution which u gave for the first one worked fine for me..

but i have a question regarding the second one.

if i need to extract the eliminated records to a separate file, do i need to use another condition 'INCLUDE' in my jcl using the same input file which i used for the 'OMIT' Condition.

is there any possibility to get those eliminated records after from the OMIT condition which was mentioned for the first question. is it possible to get those eliminated records without using another 'INCLUDE or OMIT' condition in the jcl so that i can write the eliminated records in a separate file.

please advice on this.

thanks in advance

waves
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Fri Dec 07, 2007 3:11 am    Post subject: Reply with quote

waves wrote:

is there any possibility to get those eliminated records after from the OMIT condition which was mentioned for the first question. is it possible to get those eliminated records without using another 'INCLUDE or OMIT' condition in the jcl so that i can write the eliminated records in a separate file.


Waves,
There may be a method to extarct the elminated records after OMIT. But I am not sure. Simle way to do this is add one more step, put INCLUDE there to extarct records with blanks/zeros.

Let's wait for expert's answers.
Back to top
View user's profile Send private message Send e-mail
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Fri Dec 07, 2007 3:42 am    Post subject: Reply with quote

waves,

Following is my suggestion:

1. Use SORTOF01, SORTOF02 instead of SORTOUT. S0RTOF01 represents the excluded file. SORTOF02 represents the included file.

2. You could use the below card:

Code:


  //SYSIN   DD *                                                     
   SORT FIELDS=COPY                                                 
   OUTFIL FILES=1,
   OMIT COND=((260,14,CH,EQ,C'00000000000000'),AND,(188,13,CH,EQ,C' '))
   OUTFIL FILES=2,
   INCLUDE COND=((260,14,CH,EQ,C'00000000000000'),AND,(188,13,CH,EQ,C' '))
 /*     
 



Hope this helps.
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
waves
Beginner


Joined: 09 Nov 2006
Posts: 35
Topics: 12

PostPosted: Fri Dec 07, 2007 5:35 am    Post subject: Reply with quote

Hi vivek,

thanks for ur valuable reply.

i have tested the job using the suggestion given by you.

but the job got abended saying that there is a syntax error in the OUTFIL Statement.

this was the spool output:

SYSIN :
SORT FIELDS=COPY
OUTFIL FILES=01,OMIT COND=((260,14,CH,EQ,C'00000000000000'),OR,
*
(188,13,CH,EQ,C' '))
*
OUTFIL FILES=02,INCLUDE COND=((260,14,CH,EQ,C'00000000000000'),OR,
*
(188,13,CH,EQ,C' '))
WER268A OUTFIL STATEMENT : SYNTAX ERROR
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER268A OUTFIL STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
Back to top
View user's profile Send private message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Fri Dec 07, 2007 5:50 am    Post subject: Reply with quote

waves,

I was wrong on the syntax. Regrets...

Try the below sort card:

Code:
 

 //SYSIN   DD *                                                     
   SORT FIELDS=COPY                                                 
   OUTFIL FILES=01,
   OMIT=((260,14,CH,EQ,C'00000000000000'),AND,(188,13,CH,EQ,C' '))
   OUTFIL FILES=02,
   INCLUDE=((260,14,CH,EQ,C'00000000000000'),AND,(188,13,CH,EQ,C' '))
 /*     

 

_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
waves
Beginner


Joined: 09 Nov 2006
Posts: 35
Topics: 12

PostPosted: Fri Dec 07, 2007 5:57 am    Post subject: Reply with quote

Hi vivek,

ya it worked!!! thanks a ton!!...

now i got my required output.

thanks,

waves
Back to top
View user's profile Send private message
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