DDE and macro recall

  • Follow


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));
0
Reply msussman (24) 3/15/2010 3:38:57 PM

On Mar 15, 8:38=A0am, Mark Sussman <msuss...@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. =A0I'm having a little trouble with the double
> quotes associated with DDE syntax. =A0Below is my code, but instead of
> the name of the spreadsheet being saved as the filename, %var. is. =A0I
> 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=3Dsheet_name);
> =A0 =A0 =A0 =A0 set idde;
> =A0 =A0 =A0 =A0 if sheet_name=3D"&var.";
> run;
>
> filename sas2xl dde 'excel|system';
> data _null_;
> =A0 length fid rc start stop time 8;
> =A0 fid=3Dfopen('sas2xl','s');
> =A0 if (fid le 0) then do;
> =A0 =A0 rc=3Dsystem('start excel');
> =A0 =A0 start=3Ddatetime();
> =A0 =A0 stop=3Dstart+10;
> =A0 =A0 do while (fid le 0);
> =A0 =A0 =A0 fid=3Dfopen('sas2xl','s');
> =A0 =A0 =A0 time=3Ddatetime();
> =A0 =A0 =A0 if (time ge stop) then fid=3D1;
> =A0 =A0 =A0 end;
> =A0 =A0 end;
> =A0 rc=3Dfclose(fid);
> run;
>
> /*Save opened Excel Workbook*/
> data _null_;
> =A0 file sas2xl;
> =A0 put '[app.activate("microsoft excel - book1")]';
> =A0 put '[error(false)]';
> =A0 put '[save.as("Z:\6204 Abbey\SAS Export\Individual DDE 3yr
> \&var.")]';
> run;
>
> %MEND;
>
> %id(%str(Allberry, Loretta Ann - 5025));

Just some thoughts

perl and R have some much more powerful integration technologies with
excel and you do not have to have excel up and running or even have
excel on the desktop. You can use an open office 'excel' to open the
spreadsheets. Also I think microsoft has a spreadsheet viewer or SAS
can view the sheets? R and perl can even create the binary sheet,

SAS tagsets do not create a binary excel file, the tagset creates XML.
Personally I think the XML is a better alternative but may need a year
or two more to equal the tools avalailble with binary excel, ie ODBC,
libname, SAS-Acccess...  R and perl.

What we need is better SAS integration with perl and R.

0
Reply xlr82sas (391) 3/15/2010 4:45:17 PM


PERL and R?
You must drunk. Who the hell needs that?
0
Reply monturainc (46) 3/15/2010 4:54:09 PM

On Mar 15, 9:54=A0am, montura <montura...@gmail.com> wrote:
> PERL and R?
> You must drunk. Who the hell needs that?

Hi,

I am not sure where Microsoft is going with DDE(see below), but this
may interest some readers.

What happened to DDE Share?

Applies to all editions of Windows Vista

If you used previous versions of Windows, you might know DDE Share as
a tool for managing the way programs communicate and share data over a
network. DDE Share is not available in this version of Windows because
it has been replaced by other methods for communicating and sharing
data among computers.

My concern:
=3D=3D=3D=3D=3D=3D=3D=3D=3D
In the past there was no way to copy a networked shared excel
spreadsheet while multiple users were updating the file, this is why I
needed DDE.
Vista has something called hobocopy? to copy 'exclusive open' files? I
am investigating.

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
Also the list of R users now has some very heavey weight 'past' SAS
power users? Note Micheal Freindly, not to mention Frank Harrel and
others.
They can't all be wrong.

The list below is only about 1/5th of the 'new/updated' packages in R
last week.

UScensus2000blkgrp (0.03)
  Zack W. Almquist
  http://crantastic.org/packages/UScensus2000blkgrp

  US Census 2000 Block Group shapefiles and additional demographic
data
  from the SF1 100 percent files. This data set contains polygon files
  in lat/lon coordinates and the corresponding demographic data for a
  number of different variables.


 Michael Friendly
  http://crantastic.org/packages/vcdExtra

  Provides additional data sets, methods and documentation to
complement
  the vcd package for Visualizing Categorical Data.

Rsolnp (1.0-2)
  Alexios Ghalanos
  http://crantastic.org/packages/Rsolnp

  General Non-linear Optimization Using Augmented Lagrange Multiplier
  Method

* saws (0.9-3.1)
  M.P. Fay
  http://crantastic.org/packages/saws

  Tests coefficients with sandwich estimator of variance and with
small
  samples. Regression types supported are gee, cox regression, and
  conditional logistic regression.

RcppExamples (0.1.0)
  Dirk Eddelbuettel and Romain Francois
  http://crantastic.org/packages/RcppExamples

  Examples for Seamless R and C++ integration The Rcpp package
contains
  a C++ library that facilitates the integration of R and C++ in
  various ways. This package provides examples.

RcmdrPlugin.MAd (0.2)
  AC Del Re
  http://crantastic.org/packages/RcmdrPlugin-MAd

  This is an R-Commander plug-in for the MAd package (Meta-Analysis
with
  Mean Differences). This package enables the user to conduct a
  meta-analysis in a menu-driven, graphical user interface environment
  (e.g., SPSS), while having the full statistical capabilities of R
  and the MAd package. The MAd package itself contains a variety of
  useful functions for conducting a research synthesis with mean
  differences data. One of the unique features of the MAd package is
  in its integration of user-friendly functions to complete many of
  the statistical steps involved in a meta-analysis with mean
  differences. It uses recommended procedures as described in The
  Handbook of Research Synthesis and Meta-Analysis (Cooper, Hedges, &
  Valentine, 2009).


 ordinal (2010.03-04)
  Rune Haubo B Christensen
  http://crantastic.org/packages/ordinal

  This package implements likelihood based models for ordinal (ordered
  categorical) data based on cumulative probabilities in the framework
  of cumulative link models. This includes the important proportional
  odds model but also allows for general regression structures for
  location as well as scale of the latent distribution, i.e. additive
  as well as multiplicative structures, structured thresholds
  (cut-points), nominal effects and flexible link functions. Further,
  a range of estimation procedures and a range of auxiliary functions
  are implemented.

mtsc (0.0.1)
  Charlotte Maia
  http://crantastic.org/packages/mtsc

  Place-holder package (roughly speaking an empty package) for finding
  clusters in multivariate timeseries. Full implementation pending.

MplusAutomation (0.2-3)
  Michael Hallquist
  http://crantastic.org/packages/MplusAutomation

  The MplusAutomation package leverages the flexibility of the R
  language to automate latent variable model estimation and
  interpretation using Mplus, a powerful latent variable modeling
  program developed by Muthen and Muthen (www.statmodel.com).
  Specifically, MplusAutomation provides routines for creating related
  groups of models, running batches of models, and extracting and
  tabulating model parameters and fit statistics.

0
Reply xlr82sas (391) 3/15/2010 8:06:01 PM

On Mar 15, 1:06=A0pm, xlr82sas <xlr82...@aol.com> wrote:
> On Mar 15, 9:54=A0am, montura <montura...@gmail.com> wrote:
>
> > PERL and R?
> > You must drunk. Who the hell needs that?
>
> Hi,
>
> I am not sure where Microsoft is going with DDE(see below), but this
> may interest some readers.
>
> What happened to DDE Share?
>
> Applies to all editions of Windows Vista
>
> If you used previous versions of Windows, you might know DDE Share as
> a tool for managing the way programs communicate and share data over a
> network. DDE Share is not available in this version of Windows because
> it has been replaced by other methods for communicating and sharing
> data among computers.
>
> My concern:
> =3D=3D=3D=3D=3D=3D=3D=3D=3D
> In the past there was no way to copy a networked shared excel
> spreadsheet while multiple users were updating the file, this is why I
> needed DDE.
> Vista has something called hobocopy? to copy 'exclusive open' files? I
> am investigating.
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=AD=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
> Also the list of R users now has some very heavey weight 'past' SAS
> power users? Note Micheal Freindly, not to mention Frank Harrel and
> others.
> They can't all be wrong.
>
> The list below is only about 1/5th of the 'new/updated' packages in R
> last week.
>
> UScensus2000blkgrp (0.03)
> =A0 Zack W. Almquist
> =A0http://crantastic.org/packages/UScensus2000blkgrp
>
> =A0 US Census 2000 Block Group shapefiles and additional demographic
> data
> =A0 from the SF1 100 percent files. This data set contains polygon files
> =A0 in lat/lon coordinates and the corresponding demographic data for a
> =A0 number of different variables.
>
> =A0Michael Friendly
> =A0http://crantastic.org/packages/vcdExtra
>
> =A0 Provides additional data sets, methods and documentation to
> complement
> =A0 the vcd package for Visualizing Categorical Data.
>
> Rsolnp (1.0-2)
> =A0 Alexios Ghalanos
> =A0http://crantastic.org/packages/Rsolnp
>
> =A0 General Non-linear Optimization Using Augmented Lagrange Multiplier
> =A0 Method
>
> * saws (0.9-3.1)
> =A0 M.P. Fay
> =A0http://crantastic.org/packages/saws
>
> =A0 Tests coefficients with sandwich estimator of variance and with
> small
> =A0 samples. Regression types supported are gee, cox regression, and
> =A0 conditional logistic regression.
>
> RcppExamples (0.1.0)
> =A0 Dirk Eddelbuettel and Romain Francois
> =A0http://crantastic.org/packages/RcppExamples
>
> =A0 Examples for Seamless R and C++ integration The Rcpp package
> contains
> =A0 a C++ library that facilitates the integration of R and C++ in
> =A0 various ways. This package provides examples.
>
> RcmdrPlugin.MAd (0.2)
> =A0 AC Del Re
> =A0http://crantastic.org/packages/RcmdrPlugin-MAd
>
> =A0 This is an R-Commander plug-in for the MAd package (Meta-Analysis
> with
> =A0 Mean Differences). This package enables the user to conduct a
> =A0 meta-analysis in a menu-driven, graphical user interface environment
> =A0 (e.g., SPSS), while having the full statistical capabilities of R
> =A0 and the MAd package. The MAd package itself contains a variety of
> =A0 useful functions for conducting a research synthesis with mean
> =A0 differences data. One of the unique features of the MAd package is
> =A0 in its integration of user-friendly functions to complete many of
> =A0 the statistical steps involved in a meta-analysis with mean
> =A0 differences. It uses recommended procedures as described in The
> =A0 Handbook of Research Synthesis and Meta-Analysis (Cooper, Hedges, &
> =A0 Valentine, 2009).
>
> =A0ordinal (2010.03-04)
> =A0 Rune Haubo B Christensen
> =A0http://crantastic.org/packages/ordinal
>
> =A0 This package implements likelihood based models for ordinal (ordered
> =A0 categorical) data based on cumulative probabilities in the framework
> =A0 of cumulative link models. This includes the important proportional
> =A0 odds model but also allows for general regression structures for
> =A0 location as well as scale of the latent distribution, i.e. additive
> =A0 as well as multiplicative structures, structured thresholds
> =A0 (cut-points), nominal effects and flexible link functions. Further,
> =A0 a range of estimation procedures and a range of auxiliary functions
> =A0 are implemented.
>
> mtsc (0.0.1)
> =A0 Charlotte Maia
> =A0http://crantastic.org/packages/mtsc
>
> =A0 Place-holder package (roughly speaking an empty package) for finding
> =A0 clusters in multivariate timeseries. Full implementation pending.
>
> MplusAutomation (0.2-3)
> =A0 Michael Hallquist
> =A0http://crantastic.org/packages/MplusAutomation
>
> =A0 The MplusAutomation package leverages the flexibility of the R
> =A0 language to automate latent variable model estimation and
> =A0 interpretation using Mplus, a powerful latent variable modeling
> =A0 program developed by Muthen and Muthen (www.statmodel.com).
> =A0 Specifically, MplusAutomation provides routines for creating related
> =A0 groups of models, running batches of models, and extracting and
> =A0 tabulating model parameters and fit statistics.

Hi SAS-Lers,

  I have a had a few questions about hobocopy. I have not used it and
I don't think it is part of vista. Here is the link for hobocopy.

http://tiny.cc/BYuQl
0
Reply xlr82sas (391) 3/16/2010 6:35:14 PM

4 Replies
29 Views

(page loaded in 0.112 seconds)


Reply: