Page 1 of 1

How to compare a filed of file1 with values in file2

PostPosted: Sat Apr 06, 2013 12:37 am
by lakshmipathik
Hi,
I have a file 1 with data like below
Name code ind  CT
------  ----- ---   ---
aaa     123  N    ijk
bbb     234  y     lmn
ccc     125  n     opq


I have a file2 with data like below
ind  Min   Max  CT
---- ----   -----  ----
N   100    125   iii
Y    126   190   jjj
N   191    250  kkk


output file should like this: (i.e. CODE value in file1 should compare with 'Min' and 'Max' values of file2 and if it falls in that range, CT value from file2 should be taken and replace in CT value of file1)
Name code ind  CT
------  ----- ---   ---
aaa     123  N    iii
bbb     234  y     kkk
ccc     125  n     iii


please let me know if it can be possible using sort...

Code'd

Re: How to compare a filed of file1 with values in file2

PostPosted: Sat Apr 06, 2013 1:09 am
by enrico-sorichetti
this forum has two sections dedicated to <sort>

one for IBM DFSORT ( ICE.... messages )
another one for SYNCSORT ( WER..... messages )

everywhere on the net good manners dictate to post into the proper section

Re: How to compare a filed of file1 with values in file2

PostPosted: Sat Apr 06, 2013 2:14 am
by BillyBoyo
If you tell us which Sort product you have, the topic will be moved to the appropriate part of the forum.

Re: How to compare a filed of file1 with values in file2

PostPosted: Sat Apr 06, 2013 2:16 am
by lakshmipathik
Hi,
we have DFSORT.

Thanks.