For this problem, joinkey is not at all recommended.
your code is wasting plenty amount of resource because of join keys and unnecessary overlay and pass.
performance depends on the total volume of the records in context and you don't know yet.
This piece of code can be removed if TS confirms the total file length and also the last byte of the file 1 is always a space. TS looking for JOINKEYS hence the solution is and there are couple of other ways to achieve the same. I have not faced any performance issues with this type of JOINs OR ICETOOL SPICE as yet so it is a choice call.
I had to come back again since I have additional requirement from user. They want this functionality to work only when month from file 2 is "12" in both the dates.
If you think I should open new post. I can do that. I thought since its an additional request, I should add it here.
Rohit,
by the time I wrote this new requirement, I had not seen the code you pasted. I wrote it with respect to the code which Magesh suggested since I did not refresh the page.
I can certainly modify the include in the code which you suggested.
Thanks
INCLUDE COND=((1,8,CH,EQ,21,8,CH,OR,1,8,CH,EQ,29,8,CH),AND,(1,2,CH,EQ,C'12',AND,9,2,CH,EQ,C'12'))
Your include condition is wrong, it should be as below
Code:
INCLUDE COND=((1,8,CH,EQ,21,8,CH,OR,1,8,CH,EQ,29,8,CH),AND,
(21,2,CH,EQ,C'12',AND,29,2,CH,EQ,C'12'))
Even if you have corrected the include condition what would be the end result ?
Rohit wrote:
We can discuss on choices as we want but for your point
SYMNAMES solutions is always better than Joinkeys because, SYMNAMES solution can be archived in 2 Pass and Joinkey required three Pass and additional build statements.
The only thing we need to make sure is, SYSMNAMES should always have one record and that can be achieved by having STOPAFT=1 option. Also we can set a return code 04 for empty file, so that we can stop executing next step.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Magesh is correct. Even with only one record on F1, JOINKEYS requires resources for two subtasks and the main task.
Searching here should locate confirmation from Kolusu and/or Frank Yaeger. If you get in the habit of keeping things simple, good use of resources often comes with it.
Thanks Magesh for the correction of the offset per REFORMAT.
Thanks Bill and I agree to the point of using SYNAMES as noted before.
No Doubt SYSNAMES is optimal to work but also if TS confirms 'the last byte of file1 is ALWAYS a space' then we can get ride of two subtasks as then we can join on last byte of each file.
I agree with you regardless of volume of data Joinkeys will degrade the performance and it is best practice to use performance efficient code though the impact is minimal