So, i m french so it's not very easy to be clear but i m going to try to show you my reasoning I have a SAS table with 3 variables : STATE_BEFORE / STATE_AFTER / DATE this data is a liste of customers number who can change at some dates For exemple : STATE_BEFORE STATE_AFTER DATE 100 200 01/01 300 400 01/01 200 600 01/02 600 800 01/03 As you can see, at the end, the customer 300 is now known as customer 400, and the 100 is known as 800 My goal is to create a table like that: STATE_BEFORE STATE_AFTER 100 800 300 400 So, how i thought i could do that : 1) i keep the numbers who are and colum "STATE_AFTER" and "STATE_BEFORE" ==> in my example, we have the 200 and the 600 for information, at the beginning i have a table with 360 000 lines, and when i keep only the ones of step 1), i have a new table with 35 000 lines. this table has the colums ""STATE_AFTER"" and "ROWCOL" the ROWCOL is the line number in my first table with the 360 000 lines 2) i create a mv for each of this 35 000 numbers, so in my example we have : mv1=200 mv2=600 3) for each mv, i read the first table, the one with 360 000 lines, and when i found the value of my MV in the column ""STATE_BEFORE" , i replace the value of my MV by the value of the column "STATE_AFTER" Exemple : mv1=200 i see it on line 3 in the column ""STATE_BEFORE" , so its value become 600. i continue to read the table, and on the line 4, become will become 800 so at the end, mv1=800 and of course we also have mv2=800. 4)now, and its here that i have a pb with my program, i work with my table who has 35 000 lignes its the same table than at the step2, so i know that mv1 is value for the line with the code i showed you, i create a new variable that contains the new value of the MV 5) last step, i join the 2 tables withe the colum "ROWNO" and at the end i have what i wanted is it clear :-)?
... View more