Page 1 of 1

exchanging values between current record and next record

Posted: Wed Jan 06, 2010 6:08 am
by hitmanthesilentassasin
Hi I have few questions. Please let me know your thoughts about the below metioned approaches.

1. there would be a source file XXXX which has to be split into 1000 different parts. for each part there is a column key_id which is generated as a sequence number. However the starting value of the sequence is mentioned in 1000 different files.

Approach: using the filter command of the sequential file concatenate all the files into 1 record and using a dummy key column join to all the records and then in a transformer split the into 1000 output links with link having one starting values of the sequence number + @OUTROWNUM. however, the issue in this approach is all the records will go in all the output links and I couldnt find any filter condition. can you help me achieve this????

2. I am not aware of the ISO format of names(customer names). could you please help me understand this????

3. If the current record satisfies a values(like Col1 = 'xxx' ) then assign the current surrogate_key to the next record(for the same customer group)and the next surrogate key to the current record???

Approach: I could think of using a transformer to first sort in ascending and then assign the current value in the next record with the help of stage variables. and after that sort in descending order and then use transformer and again reassign the values. the issue here is there are 1000 output links for each link there would be sorting twice and processing twice. Alternatively, I could think of using an external filter to use an awk statement and process in a single stage with only one time sorting. Please let me know which approach is better or is there a better way to do this???

Please let me know if the post is vague

replies would be very much appreciated.

Posted: Wed Jan 06, 2010 6:16 am
by Sainath.Srinivasan
Reading your questions, it appears that you have some "requirements / mapping document" in front of you from which you have provided some extract.

Therefore your questions are very vauge for others to understand.

Are there interview questions or something you are given as assignment ?

You need to provide the full picture on what and why you are trying to do.