Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8614
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 Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Comparing dates in different formats migusd SYNCSORT 4 Sat Nov 18, 2017 3:02 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
This topic is locked: you cannot edit posts or make replies. Comparing current time with the time ... arunsoods SYNCSORT 1 Mon Oct 30, 2017 4:07 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us