LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 21 Oct 2004 11:56:21 -0500
Reply-To:   KHANNA NARRAVULA <nrkanna@BLUEBOTTLE.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   KHANNA NARRAVULA <nrkanna@BLUEBOTTLE.COM>
Subject:   Generate Dynamic Excel Worksheets from a PDS.
Content-Type:   text/plain; charset=ISO-8859-1

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.


Back to: Top of message | Previous page | Main SAS-L page