Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
Hi all,
Input1: FB, 16 bytes, No Dups; 1 to 8 bytes is key; the remaining is PD value.
Code:
1234567800000010(It is PD field - 9 to 16 bytes, Length - 8 bytes - I showed it as ZD here)
2222222200000345(It is PD field - 9 to 16 bytes, Length - 8 bytes - I showed it as ZD here)
5555555500000000(It is PD field - 9 to 16 bytes, Length - 8 bytes - I showed it as ZD here)
8888888800000150(It is PD field - 9 to 16 bytes, Length - 8 bytes - I showed it as ZD here)
8888888900000050(It is PD field - 9 to 16 bytes, Length - 8 bytes - I showed it as ZD here)
Input2: FB, 16 bytes, No Dups; 1 to 8 bytes is key; the remaining is PD value.
Code:
1234567800000020(It is PD field - 9 to 16 bytes, Length - 8 bytes - I showed it as ZD here)
2222222200000300(It is PD field - 9 to 16 bytes, Length - 8 bytes - I showed it as ZD here)
3333333300000300(It is PD field - 9 to 16 bytes, Length - 8 bytes - I showed it as ZD here)
5555555500000010(It is PD field - 9 to 16 bytes, Length - 8 bytes - I showed it as ZD here)
6666660660000012(It is PD field - 9 to 16 bytes, Length - 8 bytes - I showed it as ZD here)
8888888800000150(It is PD field - 9 to 16 bytes, Length - 8 bytes - I showed it as ZD here)
9999999900000050(It is PD field - 9 to 16 bytes, Length - 8 bytes - I showed it as ZD here)
Expected output: FB, 16 bytes, No Dups; 1 to 8 bytes is key; the remaining is PD value.
Code:
1234567800000030(It is PD field - 9 to 16 bytes, Length - 8 bytes - I showed it as ZD here)
2222222200000645(It is PD field - 9 to 16 bytes, Length - 8 bytes - I showed it as ZD here)
5555555500000010(It is PD field - 9 to 16 bytes, Length - 8 bytes - I showed it as ZD here)
8888888800000300(It is PD field - 9 to 16 bytes, Length - 8 bytes - I showed it as ZD here)
8888888900000050(It is PD field - 9 to 16 bytes, Length - 8 bytes - I showed it as ZD here)
I need to get all the records from Input1 to output. If a record is matched, SUM value of 8 to 16 bytes of those records should be in output.
In your original solution(step0300) if you use OUTFIL BUILD=(1,16),INCLUDE=(17,1,ZD,EQ,1), you will end up selecting unique records from FILE1. In your expected output, you show for common keys in both files, you want to sum the PD amounts for which 17th position will have value of 3 and not 1. Based on this understading(not sure if correct!!!), you may want to change your include condition in step0300 to INCLUDE=(17,1,zd,eq,1,or,17,1,zd,eq,3).
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
Hi sqlcode1,
Thanks for the reply. As such, I can't use your code as usage of temp data sets are not allowed here. I'll try with making HDR data set as cataloged.
In STEP0300 step, SUM fields is not on 17th byte. So, I use INCLUDE as 17,1,ZD,EQ,1
I need to get all the records from Input1 to output. If a record is matched, SUM value of 8 to 16 bytes of those records should be in output. Non-matched record from Input1 should come as such in output. Non-matched record from Input2 is not needed in output.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Santy,
Your "solution" is syntactically and functionally incorrect. Please don't post solutions you haven't actually tested and verified against the expected results.