Date: Mon, 15 Mar 2010 16:05:22 -0400
Reply-To: Arthur Tabachneck <art297@NETSCAPE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arthur Tabachneck <art297@NETSCAPE.NET>
Subject: Re: DDE and macro recall
Mark,
Just change the way you are using quotes in your put statement. e.g., I
think that the following does what you want:
put '[save.as("k:\6204 Abbey\SAS Export\Individual DDE 3yr\'"&var."'")]';
However, you probably also want to end the data _null_ step with a run
statement and leave the semi-colon off in the statement where you actually
call the macro.
HTH,
Art
---------
On Mon, 15 Mar 2010 08:38:57 -0700, Mark Sussman <msussman@GMAIL.COM>
wrote:
>Hell again,
>
>I'm still working on the same DDE project, but now am trying to
>implement a macro in order to create all the different excel
>spreadsheets I need. I'm having a little trouble with the double
>quotes associated with DDE syntax. Below is my code, but instead of
>the name of the spreadsheet being saved as the filename, %var. is. I
>can't seem to figure out the correct combination of code to fix this
>problem, please help.
>
>options noxsync noxwait xmin;
>%macro ID(var);
>
>data plaintiff(drop=sheet_name);
> set idde;
> if sheet_name="&var.";
>run;
>
>
>filename sas2xl dde 'excel|system';
>data _null_;
> length fid rc start stop time 8;
> fid=fopen('sas2xl','s');
> if (fid le 0) then do;
> rc=system('start excel');
> start=datetime();
> stop=start+10;
> do while (fid le 0);
> fid=fopen('sas2xl','s');
> time=datetime();
> if (time ge stop) then fid=1;
> end;
> end;
> rc=fclose(fid);
>run;
>
>/*Save opened Excel Workbook*/
>data _null_;
> file sas2xl;
> put '[app.activate("microsoft excel - book1")]';
> put '[error(false)]';
> put '[save.as("Z:\6204 Abbey\SAS Export\Individual DDE 3yr
>\&var.")]';
>run;
>
>%MEND;
>
>%id(%str(Allberry, Loretta Ann - 5025));
|