Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

comparing two files using syncsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: comparing two files using syncsort
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 16, 2010 6:34 pm    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us