IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Getting Matched Records based on some conditions


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Sat Nov 24, 2012 11:12 am
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Nov 24, 2012 6:35 pm
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

Moderator Emeritus


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

PostPosted: Sun Nov 25, 2012 6:24 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts How to load to DB2 with column level ... DB2 6
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top