|
Hi All,
I need to generate excel file with multiple worksheets such
that each worksheet corresponds to one member of a particular PDS.
Assume PDS, has 5 members in it, then it should genearate 5
worksheets within one excel file. This number, 5, is a varying
attribute.
I'm using ODS XML spreadsheet to solve this, but it is not
substituting the actual value for the &&mem&i, therefore it throws
the error that 'Physical File doesn't exist'.
here is the program:
Any proc template for defining the tagset; /*tagset excel82*/
run;
%macro exm;
%do i=1 %to &count;
filename in1 'AV76762.SAS.DATA(&&mem&i)';
DATA EXTERNAL;
INFILE IN1;
INPUT MEMNO $ 1-8 TYPE $ 11 STATUS $13-15 HISTORY $17-30;
%PUT _USER_;
Ods Markup anchor="sql";
proc sql;
select * from EXTERNAL;
run;
%end;
%mend;
options nobyline;
ods markup file="/u/userid/attach.xls" tagset=excel82;
filename indd 'userid.sas.data' disp=shr;
filename out '&temp';
proc source indd=indd nodata noprint dirdd=out;
data test;
infile out;
file print;
input member $8. @;
proc sql;
select count(member) into: count from test;
select member into :mem1 - :mem%left(&count) from test;
run;
quit;
%exm;
ods markup close ;
If i directly substitute the member name directly, it generates
the worksheet properly for that member. But i need to repeat the
process for all the members within a PDS.
I'm using SAS 8.2 and Excel XP. Can you please help me to solve the
above problem.
Thanks in anticipation.
Regards,
Narra.
|