Good morning Everybody, I am totally new to sas programming, and I am trying to realise a huge data analysis with sas. I have a database in access which is exported to sas and would like to do some data analsis. the simple logic I am trying to realise is as follows. 1.I need to calculate the total number of fax, call or email is made in the whole database. 2. calculate the same for last 6 months. 3. for each user { calculate the no: of fax, email, phone in each of the last 6 months. } so once the table is exported and in access environment it looks something like attached image . I currently realised the total values (overall value, total for month1 to month6, total email, fax, phone for month 1-6, total successful email/Fax/phone for month 1-6, total unsuccessfull email/fax/phone for month 1-6. which is around 110 fields. ) which i do not feel as the best solution to write each and every code(which is repeatative) in proc sql. 1. I am trying to find some optimal way how I can solve it. 2. I want to know how to put the whole name in a loop and calculate for each name the no: of ..fax/phone/email/success/unsucces etc. I may write the logic this way for each(name) { count no: of email month 1, count no: email month2...month6 count no: of Fax month 1...month 6 count no: phone month1-month 2 save in the data analysis table } this is how I perform it currently ----------------------------- Proc sql; select count (name) into :count_fax_mon1 from total_6months where name<>"" and communication = "Fax" and comm_date = "&mon1"; update communication_statistic set Fax_mon1 = "&count_fax_mon1"; quit; run; --------------------------- any help is appreciated.. Thanks and regards, Eleenrose
... View more