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 

either sort or program?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
rajkumar_1981
Beginner


Joined: 05 Jan 2007
Posts: 5
Topics: 4

PostPosted: Mon Mar 17, 2008 11:11 pm    Post subject: either sort or program? Reply with quote

I need to compare the two input file. The output file should contain only first file of records and ommit the records which are present in both files.


for example

file 1:
------
1234
567
23456
234

file 2:
------
1234
23456
6789


output file:-
-------------
567
234
Back to top
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Tue Mar 18, 2008 8:04 am    Post subject: Reply with quote

Is it important to keep the original sequence of records?
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Mar 18, 2008 9:52 am    Post subject: Reply with quote

rajkumar_1981,

what is the pattern of picking the records? Why didn't you pick 6789 record from file2? it does not have a matching record in file1

1. What is the LRECL and RECFM of the input and output files
2. Does any file contains duplicates
3. Do you need to retain the original sequence of records?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Tue Mar 18, 2008 3:31 pm    Post subject: Re: either sort or program? Reply with quote

rajkumar_1981 wrote:
I need to compare the two input file. The output file should contain only first file of records and ommit the records which are present in both files.

This SyncSort for z/OS JOIN application will produce your requested output:
Code:

//SORT1 EXEC PGM=SORT                           
//SORTJNF1 DD *                                 
1234
567
23456
234                 
//SORTJNF2 DD *                                 
1234
23456
6789                           
//SORTOUT DD SYSOUT=*                           
//SYSOUT DD SYSOUT=*                           
//SYSIN DD *       
   JOINKEYS FILES=F1,FIELDS=(1,5,A)   
   JOINKEYS FILES=F2,FIELDS=(1,5,A)
   JOIN UNPAIRED,F1,ONLY 
   REFORMAT FIELDS=(F1:1,5)   
   SORT FIELDS=COPY                   
/*

_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities 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