Hi, I am trying to summarize the data using Proc SQL procedure into a table. But I have lot of columns in the table that needs summarizing. The column names that I want to Summarize range from " Amount_01, Amount_02, Amount_03 ..upto Amount_76. It's kind of a long sql query. I was wondering if this can by shortened using some data step procedure or if we can use some loop in Proc sql. I think loops in proc sql is not allowed but I'm not sure. Below is my query and I have just shortened the number of columns Proc sql; Create table test_qtr as Select coverage ,Component ,LOB ,status ,year ,quarter , SUM(AMOUNT_01) AS AMOUNT_01 , SUM(AMOUNT_02) AS AMOUNT_02 , SUM(AMOUNT_03) AS AMOUNT_03 , SUM(AMOUNT_04) AS AMOUNT_04 , SUM(AMOUNT_05) AS AMOUNT_05 , SUM(AMOUNT_06) AS AMOUNT_06 , SUM(AMOUNT_07) AS AMOUNT_07 , SUM(AMOUNT_08) AS AMOUNT_08 ................... .................. ................... ,sum(Amount_71) as Amount_71 ,sum(Amount_72) as Amount_72 ,sum(Amount_73) as Amount_73 ,sum(Amount_74) as Amount_74 ,sum(Amount_75) as Amount_75 ,sum(Amount_76) as Amount_76 from Data Group by coverage ,Component ,LOB ,status ,year ,quarter order by 1,2,3,4,5,6; quit; run; Thanks for your help
... View more