Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Quote:
z/OS DFSORT >> z/OS DFSORT Application Programming Guide >> Using a JOINKEYS application for joining two files >> JOINKEYS statements
mentions what needs to be considered while handling variable length records in a JOIN application. Please read through, try it out and get back if you come across something unexpected. Or search the forum for working examples.
Thank you, Bill ... unfortunately both files are VB .. with
REFORMAT FIELDS=(F2:1,4,F1:5,80,F2:5) I can get VB records from F2 , but not from F1 ... so I think I have to use 3 steps to get in both, in first, in second
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Quote:
I cannot create VB for file 1 and VB from file 2
This statement is not true. So far you have posted only what you tried with FB data sets nothing with VB. So no point in referring to your initial post which is regarding your FB test.
hmmm... I think we are on the verge of getting locked.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Code:
JOIN UNPAIRED,F1,F2,ONLY
You have included ONLY NON MATCHING records.
You need
Code:
JOIN UNPAIRED
OR
Code:
JOIN UNPAIRED,F1,F2
to be able to output matched records too.
The other problem here is you will not know where exactly the file2 record begins, depends on how long is the "current" file1 record which is also of variable length. So BUILDing each output would be tricky.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
I'm going to take a heavy axe to this topic shortly. Anyone want to complain, don't bother.
Anatol,
I wasn't suggesting that code for you to use, because you want matches. F1,F2,ONLY will only get you mismatches. If you take off the ,ONLY you'll get REFORMAT records for B, but they would need some work because the F2 data would start immediately after the end of the F1 data.
Your best option is RDW,"fixed" data from one file,"variable" data from the other. Then, on any OUTFIL where the fixed data is used for output, you VLTRIM (be careful not to trim a vital value, so know what data can be in the last position).
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
Quote:
Your best option is RDW,"fixed" data from one file,"variable" data from the other. Then, on any OUTFIL where the fixed data is used for output, you VLTRIM (be careful not to trim a vital value, so know what data can be in the last position).
I was going to say that is what I said anatol should do several posts back.
But wait, my posts are gone.
It kinda hurts when you spend time responding, and it gets deleted.
Yea, I know, there were some 'off topic' bantering going on, but most of my posts were on point.