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 a field in two files using sort card

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Pavani G

New User


Joined: 21 Apr 2010
Posts: 10
Location: Hydearabad

PostPosted: Wed May 12, 2010 2:03 pm    Post subject: comparing a field in two files using sort card
Reply with quote

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
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed May 12, 2010 2:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Pavani G

New User


Joined: 21 Apr 2010
Posts: 10
Location: Hydearabad

PostPosted: Wed May 12, 2010 3:13 pm    Post subject: Reply to: comparing a field in two files using sort card
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed May 12, 2010 3:23 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Pavani G

New User


Joined: 21 Apr 2010
Posts: 10
Location: Hydearabad

PostPosted: Wed May 12, 2010 3:41 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Pavani G

New User


Joined: 21 Apr 2010
Posts: 10
Location: Hydearabad

PostPosted: Wed May 12, 2010 3:43 pm    Post subject:
Reply with quote

file1 will not have any duplicates
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Wed May 12, 2010 6:28 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu May 13, 2010 6:19 am    Post subject:
Reply with quote

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
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm

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