Ravi,

A sample input and desired output would have helped. Your description of 
the problem is too vague. Either way as Martin pointed out DFSORT Joinkeys 
will give you the desired results.

Check out the Smart DFSORT tricks on Joinkeys which is what you need

Join fields from two files on a key
Join fields from two files record-by-record
Cartesian join
Create files with matching and non-matching records

You can find the DFSORT smart tricks at 

http://www-01.ibm.com/support/docview.wss?rs=114&uid=isg3T7000094

Further if you have any questions please let me know

Thanks,
Kolusu
DFSORT Development
IBM Corporation

IBM Mainframe Discussion List <[email protected]> wrote on 
05/17/2016 12:13:21 AM:

> From: Ravi Gaur <[email protected]>
> To: [email protected]
> Date: 05/17/2016 12:13 AM
> Subject: SORT - Merge Two Files by Variable
> Sent by: IBM Mainframe Discussion List <[email protected]>
> 
> Since I am not that good on Sort programming could somebody throw a 
> code which could help in Merging two files which has common BY 
> variable..(I generally do it with SAS) however where this required 
> it's not licensed....so it's possible via rexx however for millions 
> of records that's damn slow...so believe DFSORT can easily achieve 
> it with SPLICE ...
> 
> So here's what I have in two files..
> 
> FILE 1 Contain variables like DSNAME VOLSER 
> FILE2  Contain variables like DSNAME VOLSER 
> 
> Now my requirement is based on VOLSER MATCH between file1 and file2 
> the output record should be created in FILE3.
> 
> Thanks, Ravi
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
> 



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to