View previous topic :: View next topic
|
Author |
Message |
Pavani G
New User
Joined: 21 Apr 2010 Posts: 10 Location: Hydearabad
|
|
|
|
Hi,
I have two files with LRECL=236, I want to compare a specific field in each record of file1 with each record in file2. if there is more than one hit in file2 then delete the matched records in file2 by keeping only one record for that field. Is there any way of doing this using Sort card.
your help is really appreciated.
Thanks,
Pavani |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
YES. But you need need to provide following...
1 What is sort product you are using at your shop?
2 Show sample records with( relevant fields only) expected output for the same
3 RECFM for the files?
4 length\position of the key value.
5: Can file1 have duplicates? |
|
Back to top |
|
|
Pavani G
New User
Joined: 21 Apr 2010 Posts: 10 Location: Hydearabad
|
|
|
|
find the below answers
RECFM=FB
the field length is 17 bytes
FILE1
01010101 202
03030303 303
89467236 890
FILE2
01010101 202
01010101 202
01010101 202
43256700 786
64352767 876
03030303 303
03030303 303
89467236 890
89467236 890
89467236 890
89467236 890
11111111 765
the expected o/p file should have
01010101 202
43256700 786
64352767 876
03030303 303
89467236 890
11111111 765
is there any way of acheving above using JCL
Thanks,
Pavani |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Where file one is playing any role here? Output you have shown is just file2 records without duplicates...
Now show the ouput with same file1 and
file2 as
Code: |
01010101 202
01010101 202
01010101 202
43256700 786
64352767 876
03030303 303
03030303 303
89467236 890
89467236 890
89467236 890
89467236 890
11111111 765
11111111 765
11111111 765
|
Basically I have added duplicates for records not present in file1
Also you have not answered all of my questions... |
|
Back to top |
|
|
Pavani G
New User
Joined: 21 Apr 2010 Posts: 10 Location: Hydearabad
|
|
|
|
The output should be
01010101 202
03030303 303
89467236 890
64352767 876
43256700 786
11111111 765
11111111 765
11111111 765
basically i have all unwanted records in file1. I jus want to chk whether that unwanted rec is present more than once in file2. the file2 should have all unwanted records only once along with other records of file2.
instead of writing a cobol pgm i am jus trying it using a jCL. |
|
Back to top |
|
|
Pavani G
New User
Joined: 21 Apr 2010 Posts: 10 Location: Hydearabad
|
|
|
|
file1 will not have any duplicates |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Pavani G,
Its not clear what you have told. What about file-2 records which do NOT have a match in file-1 and which are duplicates? Show a complete example with all possible scenarios. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
1 What is sort product you are using at your shop? |
And still the first question is unanswered.
If you want help from the forum, you have to provide the requested info. . . |
|
Back to top |
|
|
|