06-07-2013 01:03 AM
I have huge data of mulitiple location, I want to create branch code wise data set with same name as branch code and excel file using marco.Below attcahed is sample data.
06-07-2013 06:07 AM
select count(distinct(branch_code)) into :n from test;quit;
%let n= %trim(&n);
select distinct(branch_code) into :branch_code1-:branch_code&n from test;
%do i=1 %to &n;
data branch_&&branch_code&i. ;
if branch_code="&&branch_code&i." ;
Since dataset name cannot start with number i have prefixed with brnach
06-07-2013 07:30 AM
I see you are in gurgaon. You can reach me @9560771148 and i would be happy to explain further.
I have created a macro variable abc which uses the dataset test having the information of brnach_code etc.
Now i have created a macro variable n which contains total number of distinct brnach code.
Now the do loop runs the code for n number of times for each brnanch code.