Good evening everyone! I have multiple tables named in the format - bankX_YYYYMM
Where X is name of bank (1,2.3 etc) and YYYY is year and MM is month. Each table has following variables
Account_no, registered(indicates if the account is registered), num_trans (number of transactions made during that month), spend (total spend during the time period)
1. I want to have a result which gives me total number of transactions and total spend for "Bank1" during the 4th quarter of 2009.
My code-
Proc sql;
Create table test as select sum(bank1_200909.num_trans, bank1_200910.num_trans, bank1_200911.num_trans, bank1_200912.num_trans) as total_transactions, sum(bank1_200909.spend, bank1_200910.spend, bank1_200911.spend, bank1_200912.spend) as total spend from bank1_200909, bank1_200910, bank1_200911, bank1_200912;
quit;
Is this correct?
2. What Proc sql query i can write to display the total number of transactions and total spend at "Bank1" and "Bank2", broken out by registered vs non-registered accounts, during jan 2010?
Thanks in advance. Please only PROC SQL solution, no data step or macros.
... View more