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

comparing two files using syncsort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bmanoj1

New User


Joined: 19 Aug 2005
Posts: 4
Location: Hyderabad

PostPosted: Wed Jun 16, 2010 6:30 pm
Reply with quote

Hi!

I am having a requirement comparing two files. 1st file having 10 records and 2nd file having one record with one field only. In both the files date field is the key(date-1 in first file and date-2 in 2nd file). I want to select all the records from the first file for date-1 in file-1 is less than or equals to date-2 in file-2. Can i do this using syncsort.


Regards,
Manoj
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jun 16, 2010 6:34 pm
Reply with quote

Yes.

What have you tried, and what errors are you experiencing.

What does it say in the manual about this.
What similar or same topics did you find with a forum search.
Does google not work where you are
Back to top
View user's profile Send private message
bmanoj1

New User


Joined: 19 Aug 2005
Posts: 4
Location: Hyderabad

PostPosted: Wed Jun 16, 2010 7:06 pm
Reply with quote

Hi Expat,

I have tried with joinkeys but that only works for matched or unmatched records and i can't check "less than or equals to" condition
sample sort code i have tried-
JOINKEYS FILE=F1,FIELDS=(207,8,A)
JOINKEYS FILE=F2,FIELDS=(1,8,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,413,F2:1,8)
OPTION COPY

if i can get the output as "rec-1 from 1st file and the date-2 field from file-2 appended towards the end of file-1 then i can get the required result. The problem is with file-2 having one record.

without joinkeys can i format the data in two files to the format as "rec-1 from file-1 with the date-2 field appended at the end of each record.

here are the sample file formats.
inputs-
file-1 (4 records) file-2 (1 record)
111 2010-06-13 AAA 2010-06-16
112 2010-06-18 BBB
113 2010-06-16 CCC
114 2010-06-19 DDD

output
file-3 (4 records)
111 2010-06-13 AAA 2010-06-16
112 2010-06-18 BBB 2010-06-16
113 2010-06-16 CCC 2010-06-16
114 2010-06-19 DDD 2010-06-16

currently i am looking for the above output file using syncsort, so that it is easier for me to compare and get the final output.
Back to top
View user's profile Send private message
bmanoj1

New User


Joined: 19 Aug 2005
Posts: 4
Location: Hyderabad

PostPosted: Wed Jun 16, 2010 7:10 pm
Reply with quote

find the input file layouts to avoid confusion
file-1 (4 records)
111 2010-06-13 AAA
112 2010-06-18 BBB
113 2010-06-16 CCC
114 2010-06-19 DDD

file-2 (1 record)
2010-06-16
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top