Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Getting Matched Records based on some conditions

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

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Sat Nov 24, 2012 3:22 am    Post subject: Getting Matched Records based on some conditions
Reply with quote

Hi,

I need to find records from 2 files if certain fields in both the file changes and then output the entire record from the first file.

For example,

Two Files F1 and F2 both are FB/10000 bytes. Both the files are sorted and the key is from 1 to 22 bytes in both the files. Both the files may have duplicate keys.

The number of fields (trigger fields) to match in both these files are around 150 (all of which are not in continuous offset position and also varies in length and format). In this example we can consider to match 5 fields having offset location as: -

Start - 1, Length 22, CH - This is the key
Start - 30, Length 3, ZD
Start - 50, Length 9, PD
Start - 65, Length 1, CH
Start - 70, Length 5, ZD.

If there are any extra records in File 1, then it needs to be reported.

Currently I am doing this using 4 steps: -

Step 1 - Extract only the trigger fields from File 1
Step 2 - Extract only the trigger fields from File 2
Step 3 - Find unmatched records between the output of Step 1 and Step 2
Step 4 - Do a JOINKEYS on File 1 and the output from Step 3

Is there a better way of achieving this. In the final output file, I also need to have header record with Format as 'H' followed by the date (which is present in the header record of File 1. The header record in file 1 is identified by having all 0 in the key). The final output file also should have a trailer record with format as 'T' followed by the total count of records in the output (excluding the Header and Trailer records).

Thanks,
Indrajit
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1530
Location: Andromeda Galaxy

PostPosted: Sat Nov 24, 2012 11:12 am    Post subject:
Reply with quote

Indrajit,

Your explanation is pathetic also for person being in forum quite some time
Quote:

Step 1 - Extract only the trigger fields from File 1
Step 2 - Extract only the trigger fields from File 2
Step3 - Find unmatched records between the output of Step 1 and Step 2
Step 4 - Do a JOINKEYS on File 1 and the output from Step 3


Why is step 4 needed?

Also explain why is step4 needed?

And it is always easier to articulate wht is needed when you show us sample input and output
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7254

PostPosted: Sat Nov 24, 2012 6:35 pm    Post subject: Reply to: Getting Matched Records based on some conditions
Reply with quote

What are you doing/going to do if your duplicate keys (assuming you mean for the entire match key) have different data values for any of the other 150 pieces of data?
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: Sun Nov 25, 2012 6:24 am    Post subject:
Reply with quote

Hello,

Show some input data and what you want for output when that sample data is processed. Be comprehensive.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us