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
 
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: 1542
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: 7315

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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm

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