First I need to compare the F1FLD1 and F1FLD4 of file 1 with F2FLD1 and F2FLD2 of file 2 and append F2FLD3 to the end of first file
This step output will be F1FLD1 F1FLD2 F1FLD3 F1FLD4 F2FLD3 -> (TEMP1)
Then I need to compare the F1FLD1 and F1FLD4 of above output(TEMP1) with F3FLD1 and F3FLD2 of file 3 and append F3FLD3 to the end
This step output will be F1FLD1 F1FLD2 F1FLD3 F1FLD4 F2FLD3 F3FLD3 -> (TEMP2)
Then the last comparision will be F1FLD1 and F1FLD2 of above output(TEMP2) with F4FLD1 and F4FLD2 of file 4 and append F4FLD3 to the end
This step output will be F1FLD1 F1FLD2 F1FLD3 F1FLD4 F2FLD3 F3FLD3 F4FLD3
Joined: 01 Feb 2007 Posts: 123 Location: Hyderabad
Hi,
Output should have all the four fileds from the 1st file and last field from the other three files.
We are comparing the 1st file with 2nd and 3rd file on two keys and appending the last field from 2nd and 3rd file to the first file.
In this comparision field 1 and field 4 of 1st file will be compared with field 1 and field 2 of second and third file.
The the ouput of this will be compared with the fourth file and last field will be appended to the above result.
In this senario the field 1 and field 2 of the above output will be compared with field 1 and field 2 of 4th file.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
bhaskar_kanteti,
How do expect us to intrepret C3 as comp-3? How do u want the output for last 3 fields? in comp-3 format or readable format? like you have shown in your example.
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
Quote:
Actually i specified in my first post.
You showed C3 which meant comp-3 to only you. Please do not make up your own abbreviations. When working with a group to reach a solution, you need to use the terminology of the group, not something of your own.
Joined: 01 Feb 2007 Posts: 123 Location: Hyderabad
Hi dick scherrer,
I will take care to use terminology and not to use short cuts.
In my output the last 3 fields are comp-3 fields.
After modifying Amarendra Reddy post as below i am getting the ouput. In case if my input comp-3 fileds are zero then my output should also have zero corresponding to those fields. But it is showing as INVALID in that field. What change to be done regarding that.
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello Bhaskar,
Quote:
I will take care to use terminology and not to use short cuts.
Thank you
Quote:
But it is showing as INVALID in that field.
What is showing invalid? You need to post the diagnostic info from the sysout - copy/paste rather than typing parts of it.
The strings ov x'00's are not valid packed-decimal values, if that is what they were intended to be. I also do not understand the length of the x'00' strings - they do not correspond to your initial post of the field lengths.
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello Bhaskar,
Quote:
I am moving zeroes to COMP-3 field in Hexa Decimal Format. As 1 byte will occupy 2 digits, i moved 2 zeroes.
Even this didnt work.
Your understanding of how packed-decimal data (comp-3) is stored is incorrect. While 1 byte will contain 2 dgits (most of the time), it is not true for the low-order byte.
In the low-order byte, the lowest-order digit of the value is contained in the first half-byte and the sign for the entire value is in second half-byte.
A value of +123.45 stored in a s9(5)v99 comp-3 field would be: