I assume, the number of grouüps is dynamic. So the first thing is to
extract the group IDs and their number.
proc sort data=dt(keep=id) out=grps nodupkey force;
call symput("id"!!put(_n_,8 -l),id);
now you have all the information for your macro and the internal loops.
%do i=1 %to &gno;
the ids you acces by: &&id&i
the file-numbers for the excel files you generate by
On Sun, 8 Jun 2008 22:33:36 -0700, Bill Johnson <belfry2688@MYPACKS.NET>
>Long time reader, first time poster.
>I have 1 dataset that contains N groups (in long format) and I'm
preparing data to be processed by an external program.
>For each group, I'd like to:
> -write their data to an Excel file
> -call a macro with that subgroups ID#
>So, if I have 3 groups, I'd like to:
>-save excel to 'file1.xls'
>-save excel to 'file3.xls'
>How would I do that?