View previous topic :: View next topic
|
Author |
Message |
sthirumalai
New User
Joined: 14 Aug 2007 Posts: 14 Location: Chennai
|
|
|
|
Hi,
I have an Input file similar to the one given below
Code: |
000001XXXXXXSPACESYYYYYSPACES
000001SPACESZZZZZZSPACESAAAAAA |
I have to merge the two records in the I/P file based on the key 000001 (1:6)
The output should look like
Code: |
000001XXXXXZZZZZYYYYYAAAAA
|
Is there any way to do this using DFSORT or ICETOOL?
Your help is appreciated.
Regards
Santhosh |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Your output doesn't seem to match your input. For example, in the input you show 6 X's but in the output you show 5 X's, etc.
Does your input file only have two records, or can it have more? If more, then show a better example with more records.
Give the RECFM and LRECL of the input file. Give the starting position, length and format of each field in the input record, and in the output record.
BTW, this is not a "merge". It's a SPLICE. |
|
Back to top |
|
|
sthirumalai
New User
Joined: 14 Aug 2007 Posts: 14 Location: Chennai
|
|
|
|
Hi Frank,
Thanks for your response
My input file is 80 Bytes FB
I apologize for the incorrect I/P data. Here is the corrected one
000002XXXXXSPACESYYYYYSPACES
000001XXXXXSPACESYYYYYSPACES
000001SPACESZZZZZSPACESAAAAA
000002SPACESZZZZZSPACESAAAAA
The output file is 80 Bytes FB and that should look like
000001XXXXXZZZZZYYYYYAAAAA
000002XXXXXZZZZZYYYYYAAAAA
My I/P files will contain more than two records.
Key - 1,6,CH
FIELD1 - 7,5,CH
FIELD2 - 12,5,CH
FIELD3 - 17,5,CH
FIELD4 - 22,5,CH
Please let me know if you need more details
Regards
Santhosh |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
My I/P files will contain more than two records. |
Ok. But it's still not clear what your input can look like.
Will each key have a pair of records as shown in your example?
Could a key have only one record? Could a key have more than two records? If so, what does the input look like for these variations and what do you want for output?
For the same key, does the record with field1 always come before the record with field2, or could they be reversed, e.g.
000003SPACESZZZZZSPACESAAAAA
000003XXXXXSPACESYYYYYSPACES
I really need a complete picture of what variations you can have for the input records before I can give you a complete solution. |
|
Back to top |
|
|
|