I'm trying to split a dataset in mutliple datasets based on macrovariables. How should it work: I have an Excel-file RV.xls with the following description Dataset RV: Type Decision_date Decision_number Amount_in_EURO BBAN IBAN BIC Account_in_the_name_of Beneficiary Notification Payable_day 2 20130322 303187 2425063 007-2567914-12 xxx Jos … 20090417 2 20130322 303188 2441577 001-0987654-32 yyy Pol … 20090417 2 20130322 303189 33000 GB44CITI26408067654932 DRESDEFF zzz Frans … 20091204 2 20130322 303190 66800 001-0077540-69 xyz Alain … 20091204 2 20130322 303191 22200 NL65DEUT1234567890 FTSBNL2R zyx Fritz … 20091204 2 20130322 303192 3000 NL32FTSB1387056270 ABNANL2A xzx Emma … 20091204 2 20130322 303193 700 001-0987654-32 yxy Lucy … 20091205 and a second Excel-file Bank.xls like this. Dataset BankList: Bank Naam Rek1 Rek2 Taal B1 Test1 GB44CITI26408067654932 NL32FTSB1387056270 EN B2 Test2 007-2567914-12 001-0077540-69 FR B3 Test3 301-1234567-89 NL B4 Test4 NL65DEUT1234567890 EN I can read both file and make macrovariables from the Bank-file. data _null_; set RvIn.BankList; if not missing(Naam) then call symput(strip(Bank) || '_Naam', Naam); if not missing(Rek1) then call symput(strip(Bank) || '_Rek1', Rek1); if not missing(Rek2) then call symput(strip(Bank) || '_Rek2', Rek2); if not missing(Taal) then call symput(strip(Bank) || '_Taal', Taal); run; Then I'm counting the records in my BankList-file proc sql noprint; select count(Bank) into :n from RvIn.BankList; /* %put aantal: &n; */ quit; After this I would like to split the dataset RV in multiple set based on the data from BankList. So I would like to make for every Bank a single set IF it occurs offcourse. In this example I would make 3 new datasets Test1 with 2 records / Test2 with 1 record and Test4 also with 1. %macro Split_DataSets; %do i=1 %to &n; proc sql; create table &&B&i._Naam as select * from RvIn.RV as RV where RV.IBAN IN ("&&B&i._Rek1","coalesce(&&B&i._Rek2,0)") or RV.BBAN IN ("&&B&i._Rek1","coalesce(&&B&i._Rek2,0)"); quit; %end; %mend; %Split_DataSets; And that doesn't work. I need to find some routine to make these sets but the problem is that I don't know wether they're using IBAN / BBAN or they have 2 numbers. Can somebody help me with this?
... View more