View previous topic :: View next topic |
Author |
Message |
Dip Beginner
Joined: 24 Mar 2006 Posts: 27 Topics: 14
|
Posted: Fri Jul 11, 2008 4:36 pm Post subject: Concatenate specific fileds from two recs in a single rec |
|
|
The input file:
Code: |
<---10----><---10----><---10----><---10----><---10----><-1>
1111 -------- ------ ------ XXXXXXX A
1111 AAAA BBBB CCCC ------- B
1122 -------- ------ ------ YYYYYYY A
1122 DDDD EEEE FFFF ------- B
|
The output should be:
Code: |
<---10----><---10----><---10----><---10----><---10----><-1>
1111 AAAA BBBB CCCC XXXXXXX A
1122 DDDD EEEE FFFF YYYYYYY A
|
Based on the Key (1111,1122) and the last indicator we need to populate the filed 2,
field 3 and filed 4 from 2nd record to first record.
Field 2, 3, 4 in the 1st record will always be blank.
Can we do it using SYNCSORT?
Thanks!
-Dip. |
|
Back to top |
|
 |
Dip Beginner
Joined: 24 Mar 2006 Posts: 27 Topics: 14
|
Posted: Fri Jul 11, 2008 5:09 pm Post subject: |
|
|
adding one more point:
Records where keys are not repeating should be untouched:
Code: |
<---10----><---10----><---10----><---10----><---10----><-1>
1111 -------- ------ ------ XXXXXXX A
1111 AAAA BBBB CCCC ------- B
1122 -------- ------ ------ YYYYYYY A
1122 DDDD EEEE FFFF ------- B
1133 ABNS NBAS SDSF SDSFFF A
|
The output should be:
Code: |
<---10----><---10----><---10----><---10----><---10----><-1>
1111 AAAA BBBB CCCC XXXXXXX A
1122 DDDD EEEE FFFF YYYYYYY A
1133 ABNS NBAS SDSF SDSFFF A
|
Thanks!
Dip. |
|
Back to top |
|
 |
hari_uss Beginner
Joined: 19 Dec 2002 Posts: 78 Topics: 6 Location: Trivandrum, India
|
|
Back to top |
|
 |
|
|