slchen! Thank you for your answer! Im new in using SAS, and I know very little, I tried your code, and it didnt work...it says that the Ttotal, sum columns dont exist, and that the sum functions needs a numeric value. Here it is the code that Im using: data WORK.FILA_FINAL_COUNT; set WORK.query_for_query_final; run; proc sql; insert into WORK.FILA_FINAL_COUNT select Ttotal as data,sum(C) as count from WORK.query_for_query_final; quit; It would be great if you could tell me what Im doing worng. Greetings, and thanks again! Milenko
... View more