Combine rows on condition



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Combine rows on condition

Postby mfnme » Tue Oct 29, 2013 1:30 pm

Hi,

I have requirement to combine rows from csv file. The records are ,

"JAMES","JOHN","00001","ERROR1","LONDON","UK"
"JAMES","JOHN","00002","ERROR2","LONDON","UK"
"JAMES","JOHN","00003","ERROR3","LONDON","UK"
"ALAN ","MC ","00014","ERROR1","LOSANG","US"
"ALAN ","MC ","00015","ERROR2","LOSANG","US"
"SHAD ","JNR ","00001","ERROR1","XXXXX","CH"
"SHAD "," JNR ","00002","ERROR2","XXXXX","CH"

As there can be maximum of 5 errors per record/person.I would like to have output as

"JAMES","JOHN","00001","ERROR1","00002","ERROR2","00003","ERROR3","","","","","LONDON","UK"
"ALAN ","MC ","00014","ERROR1","00015","ERROR2","","","","","","","LOSANG","US"
"SHAD ","JNR ","00001","ERROR1","00002","ERROR2","","","","","","","XXXXX","CH"

I need to combine the error code ( eg:00001) and error description(eg:ERROR1) for same person in to one record and make sure that the
comma delimiter is there for all 5 error code, error record pairs

Please provide ur valuable help
mfnme
 
Posts: 2
Joined: Tue Oct 29, 2013 12:54 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Combine rows on condition

 

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post